The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
docs: format (#17143)
Erick Friisd397721a3441
diff --git a/docs/docs/integrations/chat/anthropic.ipynb b/docs/docs/integrations/chat/anthropic.ipynbindex f8aa35142d..008d290fa3 100644--- a/docs/docs/integrations/chat/anthropic.ipynb+++ b/docs/docs/integrations/chat/anthropic.ipynb@@ -90,16 +90,20 @@}],"source": [- "system = \"You are a helpful assistant that translates {input_language} to {output_language}.\"\n",+ "system = (\n",+ " \"You are a helpful assistant that translates {input_language} to {output_language}.\"\n",+ ")\n","human = \"{text}\"\n","prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", human)])\n","\n","chain = prompt | chat\n",- "chain.invoke({\n",- " \"input_language\": \"English\",\n",- " \"output_language\": \"Korean\",\n",- " \"text\": \"I love Python\",\n",- "})"+ "chain.invoke(\n",+ " {\n",+ " \"input_language\": \"English\",\n",+ " \"output_language\": \"Korean\",\n",+ " \"text\": \"I love Python\",\n",+ " }\n",+ ")"]},{diff --git a/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb b/docs/docs/integrations/chat/google_vertex_ai_palm.ipynbindex 885174f4a1..ecc7a653a0 100644--- a/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb+++ b/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb@@ -424,9 +424,7 @@"human = \"{text}\"\n","prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", human)])\n","\n",- "chat = ChatVertexAI(\n",- " model_name=\"chat-bison\", max_output_tokens=1000, temperature=0.5\n",- ")\n",+ "chat = ChatVertexAI(model_name=\"chat-bison\", max_output_tokens=1000, temperature=0.5)\n","chain = prompt | chat\n","\n","asyncio.run(\n",diff --git a/docs/docs/use_cases/csv.ipynb b/docs/docs/use_cases/csv.ipynbindex 7ef34f8412..589faa1695 100644--- a/docs/docs/use_cases/csv.ipynb+++ b/docs/docs/use_cases/csv.ipynb@@ -460,9 +460,7 @@"Given a user question, write the Python code to answer it. \\\n","Return ONLY the valid Python code and nothing else. \\\n","Don't assume you have access to any libraries other than built-in Python ones and pandas.\"\"\"\n",- "prompt = ChatPromptTemplate.from_messages(\n",- " [(\"system\", system), (\"human\", \"{question}\")]\n",- ")\n",+ "prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", \"{question}\")])\n","code_chain = prompt | llm_with_tools | parser\n","code_chain.invoke({\"question\": \"What's the correlation between age and fare\"})"]diff --git a/docs/docs/use_cases/sql/agents.ipynb b/docs/docs/use_cases/sql/agents.ipynbindex 9b013f8996..9a91a34a8c 100644--- a/docs/docs/use_cases/sql/agents.ipynb+++ b/docs/docs/use_cases/sql/agents.ipynb@@ -721,7 +721,9 @@"\n","If the question does not seem related to the database, just return \"I don't know\" as the answer.\"\"\"\n","\n",- "prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", \"{input}\"), MessagesPlaceholder(\"agent_scratchpad\")])\n",+ "prompt = ChatPromptTemplate.from_messages(\n",+ " [(\"system\", system), (\"human\", \"{input}\"), MessagesPlaceholder(\"agent_scratchpad\")]\n",+ ")\n","agent = create_sql_agent(\n"," llm=llm,\n"," db=db,\n",diff --git a/docs/docs/use_cases/sql/query_checking.ipynb b/docs/docs/use_cases/sql/query_checking.ipynbindex fcb5d44a2b..238776d0e6 100644--- a/docs/docs/use_cases/sql/query_checking.ipynb+++ b/docs/docs/use_cases/sql/query_checking.ipynb@@ -294,11 +294,15 @@"First draft: <<FIRST_DRAFT_QUERY>>\n","Final answer: <<FINAL_ANSWER_QUERY>>\n","\"\"\"\n",- "prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", \"{input}\")]).partial(dialect=db.dialect)\n",+ "prompt = ChatPromptTemplate.from_messages(\n",+ " [(\"system\", system), (\"human\", \"{input}\")]\n",+ ").partial(dialect=db.dialect)\n",+ "\n","\n","def parse_final_answer(output: str) -> str:\n"," return output.split(\"Final answer: \")[1]\n",- " \n",+ "\n",+ "\n","chain = create_sql_query_chain(llm, db, prompt=prompt) | parse_final_answer\n","prompt.pretty_print()"]