mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-26 09:32:25 +02:00
docs: replace 'state_modifier' with 'prompt' (#3190)
This commit is contained in:
@@ -201,7 +201,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"research_agent = create_react_agent(\n",
|
||||
" llm, tools=[tavily_tool], state_modifier=\"You are a researcher. DO NOT do any math.\"\n",
|
||||
" llm, tools=[tavily_tool], prompt=\"You are a researcher. DO NOT do any math.\"\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
||||
@@ -525,7 +525,7 @@
|
||||
"doc_writer_agent = create_react_agent(\n",
|
||||
" llm,\n",
|
||||
" tools=[write_document, edit_document, read_document],\n",
|
||||
" state_modifier=(\n",
|
||||
" prompt=(\n",
|
||||
" \"You can read, write and edit documents based on note-taker's outlines. \"\n",
|
||||
" \"Don't ask follow-up questions.\"\n",
|
||||
" ),\n",
|
||||
@@ -548,7 +548,7 @@
|
||||
"note_taking_agent = create_react_agent(\n",
|
||||
" llm,\n",
|
||||
" tools=[create_outline, read_document],\n",
|
||||
" state_modifier=(\n",
|
||||
" prompt=(\n",
|
||||
" \"You can read documents and create outlines for the document writer. \"\n",
|
||||
" \"Don't ask follow-up questions.\"\n",
|
||||
" ),\n",
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
"research_agent = create_react_agent(\n",
|
||||
" llm,\n",
|
||||
" tools=[tavily_tool],\n",
|
||||
" state_modifier=make_system_prompt(\n",
|
||||
" prompt=make_system_prompt(\n",
|
||||
" \"You can only do research. You are working with a chart generator colleague.\"\n",
|
||||
" ),\n",
|
||||
")\n",
|
||||
@@ -220,7 +220,7 @@
|
||||
"chart_agent = create_react_agent(\n",
|
||||
" llm,\n",
|
||||
" [python_repl_tool],\n",
|
||||
" state_modifier=make_system_prompt(\n",
|
||||
" prompt=make_system_prompt(\n",
|
||||
" \"You can only generate charts. You are working with a researcher colleague.\"\n",
|
||||
" ),\n",
|
||||
")\n",
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
"# Choose the LLM that will drive the agent\n",
|
||||
"llm = ChatOpenAI(model=\"gpt-4-turbo-preview\")\n",
|
||||
"prompt = \"You are a helpful assistant.\"\n",
|
||||
"agent_executor = create_react_agent(llm, tools, state_modifier=prompt)"
|
||||
"agent_executor = create_react_agent(llm, tools, prompt=prompt)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user