From 3992c1ae9b94990a7091a3c074772c24dc88ab43 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:57:06 -0700 Subject: [PATCH] runnable bind how to nit (#10718) --- docs/extras/expression_language/how_to/binding.ipynb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/extras/expression_language/how_to/binding.ipynb b/docs/extras/expression_language/how_to/binding.ipynb index b839242b88c..d21b44dd8ef 100644 --- a/docs/extras/expression_language/how_to/binding.ipynb +++ b/docs/extras/expression_language/how_to/binding.ipynb @@ -79,7 +79,12 @@ } ], "source": [ - "runnable = {\"equation_statement\": RunnablePassthrough()} | prompt | model.bind(stop=\"SOLUTION\") | StrOutputParser()\n", + "runnable = (\n", + " {\"equation_statement\": RunnablePassthrough()} \n", + " | prompt \n", + " | model.bind(stop=\"SOLUTION\") \n", + " | StrOutputParser()\n", + ")\n", "print(runnable.invoke(\"x raised to the third plus seven equals 12\"))" ] }, @@ -147,10 +152,11 @@ " (\"human\", \"{equation_statement}\")\n", " ]\n", ")\n", + "model = ChatOpenAI(model=\"gpt-4\", temperature=0).bind(function_call={\"name\": \"solver\"}, functions=functions)\n", "runnable = (\n", " {\"equation_statement\": RunnablePassthrough()} \n", " | prompt \n", - " | ChatOpenAI(model=\"gpt-4\", temperature=0).bind(function_call={\"name\": \"solver\"}, functions=functions)\n", + " | model\n", ")\n", "runnable.invoke(\"x raised to the third plus seven equals 12\")" ]