diff --git a/docs/docs/integrations/chat/anthropic.ipynb b/docs/docs/integrations/chat/anthropic.ipynb index f8aa35142de..008d290fa3c 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.ipynb index 885174f4a1b..ecc7a653a0d 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.ipynb index 7ef34f8412f..589faa16950 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.ipynb index 9b013f89963..9a91a34a8cc 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.ipynb index fcb5d44a2ba..238776d0e6c 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: <>\n", "Final answer: <>\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()" ]