[Structured output type hints] Type returned after invoking llm.with_structured_output(PydanticClass, method="json_schema") is unknown instead of PydanticClass #28853
Unanswered
ai-learner-00
asked this question in
Q&A
Replies: 1 comment
-
Any updates on this? Having the same issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
I am using the method
llm.with_structured_output
to obtain an instance of a pydantic class. However, the type of the output is_DictOrPydantic[Unknown]
instead ofJoke
.I am wondering if there is an issue with the type hints:
For example, if I try to access
.setup
, I get a warningCannot access attribute "setup" for class "Dict[Unknown, Unknown]" Attribute "setup" is unknown
.System Info
langchain==0.3.9
langchain-community==0.3.8
langchain-core==0.3.21
langchain-openai==0.2.10
langchain-text-splitters==0.3.2
Windows WSL (dev container)
python 3.10
Beta Was this translation helpful? Give feedback.
All reactions