prebuilt: add a test for using create_react_agent w/ Pydantic schema and ChatPromptTemplate prompt #3867
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @vbarda, this test is to showcase the problems I was refering to in the other PR. The prebuilt react agent still does not play well with pydantic.
It can be improved with a combination of langchain-ai/langchain#30297 and part of the "hack" in #3559 , or probably some better variant of that.
The problems still present:
Not an error, but "pollutes" the outer app state:
RemainingStes
in the state. This is an implementation detail of the agent, and could be part of a private state. It is not really necessary to be declared in the "public" overall state. As it is a managed variable it exists regardless, it could be just requested by the internal node that needs it, by a proper type annotation. The StateGraph already can solve that, no need for the user to do it.