mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-29 14:37:21 +00:00
openai: fix allowed block types (#20636)
This commit is contained in:
parent
764871f97d
commit
6d530481c1
@ -154,7 +154,11 @@ def _format_message_content(content: Any) -> Any:
|
||||
# Remove unexpected block types
|
||||
formatted_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
|
||||
else:
|
||||
formatted_content.append(block)
|
||||
|
Loading…
Reference in New Issue
Block a user