You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code
ihaveprompt, tool, andagentVISUALIZE_PROMPT="""{question}Based on question if ask chart/graph do below task else just return "None".{ai_response}Based on AI response above, analyze data and extract to dataframe.Then generate chart/graph based on dataframe code with matplotlib.The chart/graph result must be in base64.base64:"""# toolpython_repl=PythonREPL()
repl_tool=Tool(
name="python_repl",
description="A Python shell. Use this to execute python commands. Input should be a valid python command. If you want to see the output of a value, you should print it out with `print(...)`.",
func=python_repl.run,
)
# agentvisualize_system_message=SystemMessage(content=VISUALIZE_PROMPT)
visualize_agent_executor=create_react_agent(
llm, [repl_tool], state_modifier=visualize_system_message
)
# invokeresult=visualize_agent_executor.invoke(
{"messages": [HumanMessage(content=question)]}, debug=True
)
print(result)
Description
I have prompt with variable inside.
On documentation when invoking agent just pass "messages" as param and there is no vars to pass inside message.
How to pass value on variable prompt {question} and {ai_response} on create_react_agent langgraph when invoking?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Checked other resources
Commit to Help
Example Code
Description
I have prompt with variable inside.
On documentation when invoking agent just pass "messages" as param and there is no vars to pass inside message.
How to pass value on variable prompt {question} and {ai_response} on create_react_agent langgraph when invoking?
System Info
langchain==0.3.1
langchain-core==0.3.7
langchain-text-splitters==0.3.0
langchain_openai==0.2.1
langchain_community==0.3.1
langgraph==0.2.32
langgraph-checkpoint==2.0.0
langchain_experimental==0.3.2
Beta Was this translation helpful? Give feedback.
All reactions