-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS ChatBedrock invoke()
returns None
when used with with_structured_output()
method
#338
Comments
Hi I met the same issue. You and I have different versions, but when I look at the code, we have something in common that we are using
First, use But this is definitely a bug. |
@hyejungg thank you for the pointer. I'll consider the recommendation. |
I've done a little digging into the code. From what I understand, From a user perspective, the ideal situation would be that method is supported on all foundational models available through Bedrock. Though I understand this may be contingent on what the underlying run-time libraries of the foundational models provide. In this case, the Bedrock documentation should be explicit on the scope of support. |
Bedrock supports tool use for the models documented in this AWS doc via Converse API. You can use The mistral model used in the issue description,
Output:
|
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: