mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 14:31:55 +00:00
openai[patch]: compat with Bedrock Converse (#31280)
ChatBedrockConverse passes through reasoning content blocks in [Bedrock Converse format](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ContentBlock.html). Similar to how we handle Anthropic thinking blocks, here we ensure these are filtered out of OpenAI request payloads. Resolves https://github.com/langchain-ai/langchain/issues/31279.
This commit is contained in:
@@ -195,7 +195,7 @@ def _format_message_content(content: Any) -> Any:
|
||||
if (
|
||||
isinstance(block, dict)
|
||||
and "type" in block
|
||||
and block["type"] in ("tool_use", "thinking")
|
||||
and block["type"] in ("tool_use", "thinking", "reasoning_content")
|
||||
):
|
||||
continue
|
||||
elif isinstance(block, dict) and is_data_content_block(block):
|
||||
|
Reference in New Issue
Block a user