docs: replace 'state_modifier' with 'prompt' (#3190)

This commit is contained in:
Vadym Barda
2025-01-28 02:51:40 +00:00
committed by GitHub
parent 928126f2d7
commit 0a861815b7
12 changed files with 22 additions and 22 deletions
@@ -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)"
]
},
{