Skip to content

How to embedded the parameter when migrating from AgentExecutor to langgraph #991

Answered by vbarda
HoangNguyen689 asked this question in Q&A
Discussion options

You must be logged in to vote

@HoangNguyen689 thanks for flagging this! we're looking into making create_react_agent more flexible to allow customizing graph state (which would enable passing other input keys in your example)

in the meantime, you can use below example to achieve the desired behavior. for additional input keys just modify the AgentState

from typing import Annotated, Literal, TypedDict

from langchain_core.messages import HumanMessage, BaseMessage
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
from langgraph.checkpoint import MemorySaver
from langgraph.graph import END, StateGraph
from langgraph.graph.message import add…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@HoangNguyen689
Comment options

@vbarda
Comment options

@vbarda
Comment options

@HoangNguyen689
Comment options

@vbarda
Comment options

Answer selected by HoangNguyen689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants