AWS ChatBedrock invoke()
returns None
when used with with_structured_output()
method
#338
Open
5 tasks done
Labels
Checked other resources
Example Code
This code assumes the relevant envionment variables for Bedrock and OpenAI are defined with respective API Keys.
The code uses the Bedrock Mistral LLM with and without the use of
with_structured_output()
method.Then the code uses the OpenAI
got-4o-mini
model with and without use ofwith_structured_output()
method.Error Message and Stack Trace (if applicable)
Output from the above minimal reproducible example code
The issue is the first output with "None". There should be a response from the Bedrock Mistral LLM.
Description
I'm trying to get structured output from a call to a Bedrock foundational model. However, with the use of
with_structured_output()
, instead of receiving the LLM response, I getNone
returned.I'll point out there is a discussion about this situation in this thread: langchain-ai/langchain#22701
Since I don't see a documented Issue on this particular situation with Bedrock and
with_structured_output()
method, I'm submitting this issue.System Info
The text was updated successfully, but these errors were encountered: