From 6ac120f29957c569741db665de1f0c662c555193 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Tue, 13 Jun 2023 19:33:51 -0700 Subject: [PATCH] bump ver to 200 (#6130) --- .../examples/openai_functions_agent.ipynb | 37 ++++++------------- langchain/callbacks/stdout.py | 2 +- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/docs/modules/agents/agents/examples/openai_functions_agent.ipynb b/docs/modules/agents/agents/examples/openai_functions_agent.ipynb index b3592e6d..a4a72b2e 100644 --- a/docs/modules/agents/agents/examples/openai_functions_agent.ipynb +++ b/docs/modules/agents/agents/examples/openai_functions_agent.ipynb @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 6, "id": "9ff6cee9", "metadata": {}, "outputs": [], @@ -66,46 +66,31 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 7, "id": "ba8e4cbe", "metadata": { "scrolled": false }, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in on_chain_start callback: 'name'\n" - ] - }, { "name": "stdout", "output_type": "stream", "text": [ + "\n", + "\n", + "\u001b[1m> Entering new chain...\u001b[0m\n", "\u001b[32;1m\u001b[1;3m\n", "Invoking: `Search` with `{'query': 'Leo DiCaprio girlfriend'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mAmidst his casual romance with Gigi, Leo allegedly entered a relationship with 19-year old model, Eden Polani, in February 2023.\u001b[0m" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in on_chain_start callback: 'name'\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m\n", + "\u001b[0m\u001b[36;1m\u001b[1;3mAmidst his casual romance with Gigi, Leo allegedly entered a relationship with 19-year old model, Eden Polani, in February 2023.\u001b[0m\u001b[32;1m\u001b[1;3m\n", "Invoking: `Calculator` with `{'expression': '19^0.43'}`\n", "\n", "\n", - "\u001b[0m19^0.43\u001b[32;1m\u001b[1;3m```text\n", + "\u001b[0m\n", + "\n", + "\u001b[1m> Entering new chain...\u001b[0m\n", + "19^0.43\u001b[32;1m\u001b[1;3m```text\n", "19**0.43\n", "```\n", "...numexpr.evaluate(\"19**0.43\")...\n", @@ -123,7 +108,7 @@ "\"Leo DiCaprio's girlfriend is reportedly Eden Polani. Her current age raised to the power of 0.43 is approximately 3.55.\"" ] }, - "execution_count": 4, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } diff --git a/langchain/callbacks/stdout.py b/langchain/callbacks/stdout.py index 90b0a83e..f87fdfb4 100644 --- a/langchain/callbacks/stdout.py +++ b/langchain/callbacks/stdout.py @@ -37,7 +37,7 @@ class StdOutCallbackHandler(BaseCallbackHandler): self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any ) -> None: """Print out that we are entering a chain.""" - class_name = serialized["name"] + class_name = serialized.get("name", "") print(f"\n\n\033[1m> Entering new {class_name} chain...\033[0m") def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> None: diff --git a/pyproject.toml b/pyproject.toml index d452b866..3854a9c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain" -version = "0.0.199" +version = "0.0.200" description = "Building applications with LLMs through composability" authors = [] license = "MIT"