mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 02:50:47 +00:00
openai: fix allowed block types (#20636)
This commit is contained in:
@@ -154,7 +154,11 @@ def _format_message_content(content: Any) -> Any:
|
|||||||
# Remove unexpected block types
|
# Remove unexpected block types
|
||||||
formatted_content = []
|
formatted_content = []
|
||||||
for block in content:
|
for block in content:
|
||||||
if isinstance(block, dict) and "type" in block and block["type"] != "text":
|
if (
|
||||||
|
isinstance(block, dict)
|
||||||
|
and "type" in block
|
||||||
|
and block["type"] == "tool_use"
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
formatted_content.append(block)
|
formatted_content.append(block)
|
||||||
|
Reference in New Issue
Block a user