-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
documents have error (create_structured_output_chain) #11524
Comments
🤖 Hello, Thank you for reaching out with your issue. The From the error message you provided, it seems like the output from the language model is not a valid dictionary. This could be due to the language model not returning the expected structured output, or the output parser not correctly parsing the output. Here's a few things you could try:
If you're still having issues after trying these steps, please provide more information about the output from the language model and the exact code you're using to create the chain and I'll be happy to help further. Best, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
just print
language model chatgpt 3.5 16k |
Hi, @Dhaizei I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, you raised an issue regarding an error in the documentation for the Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you! |
Issue with current documentation:
https://python.langchain.com/docs/modules/chains/how_to/openai_functions
from typing import Sequence
class Person(BaseModel):
"""Identifying information about a person."""
prompt = ChatPromptTemplate.from_messages(
[
("system", "You are a world class algorithm for extracting information in structured formats."),
("human", "Use the given format to extract information from the following input: {input}"),
("human", "Tip: Make sure to answer in the correct format"),
]
)
class People(BaseModel):
"""Identifying information about all people in a text."""
chain = create_structured_output_chain(People, llm, prompt, verbose=True)
chain.run(
"Sally is 13, Joey just turned 12 and loves spinach. Caroline is 10 years older than Sally."
)
no work,having some error:
ValidationError: 1 validation error for _OutputFormatter
output
value is not a valid dict (type=type_error.dict)
Idea or request for content:
No response
The text was updated successfully, but these errors were encountered: