Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI
Python agentagentopsagents-sdkaianthropicautogencost-estimationcrewaievalsevaluation-metricsgroqlangchainllmmistralollamaopenaiopenai-agents
fix notebook example
reibs64ec9e50ac67
diff --git a/examples/langchain_examples.ipynb b/examples/langchain_examples.ipynbindex 76148b41..746a5a46 100644--- a/examples/langchain_examples.ipynb+++ b/examples/langchain_examples.ipynb@@ -108,7 +108,7 @@"name": "stdout","output_type": "stream","text": [- "Agent Ops session ID: f68f8aa4-ce87-4345-8678-50f4a07a9fe2\n"+ "Agent Ops session ID: d08efbb9-05aa-4bbe-bc9c-abfe78cad8dc\n"]}],@@ -134,7 +134,7 @@},{"cell_type": "code",- "execution_count": 6,+ "execution_count": 5,"id": "6abf26f9","metadata": {},"outputs": [],@@ -158,7 +158,7 @@},{"cell_type": "code",- "execution_count": 7,+ "execution_count": 6,"id": "71d56635-d0db-4362-b140-5072abee249f","metadata": {},"outputs": [],@@ -177,7 +177,7 @@},{"cell_type": "code",- "execution_count": 8,+ "execution_count": 7,"id": "d538b20aa954ee80","metadata": {"ExecuteTime": {@@ -197,7 +197,7 @@},{"cell_type": "code",- "execution_count": 9,+ "execution_count": 8,"id": "6dfb127553751384","metadata": {"scrolled": true@@ -210,62 +210,21 @@"\n","\n","\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",- "\u001b[32;1m\u001b[1;3mI should use the `find_movie` tool to find the available movies.\n",- "\n",- "Action:\n",- "```\n",- "{\n",- " \"action\": \"find_movie\",\n",- " \"action_input\": \"\"\n",- "}\n",- "```\u001b[0m\n",- "Observation: \u001b[36;1m\u001b[1;3mCitizen Kane\u001b[0m\n",- "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: I now know the final answer.\u001b[0m\n",+ "\u001b[32;1m\u001b[1;3mCould not parse LLM output: I can use the `find_movie` tool to find the available movies playing.\u001b[0m\n","Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mI need to try again with the `find_movie` tool to get the list of available movies.\n",- "\n",- "Action:\n",- "```\n",- "{\n",- " \"action\": \"find_movie\",\n",- " \"action_input\": \"\"\n",- "}\n",- "```\u001b[0m\n",- "Observation: \u001b[36;1m\u001b[1;3mCitizen Kane\u001b[0m\n",- "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: I now know the final answer.\u001b[0m\n",- "Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mI need to try again with the `find_movie` tool to get the list of available movies.\n",- "\n",- "Action:\n",- "```\n",- "{\n",- " \"action\": \"find_movie\",\n",- " \"action_input\": \"\"\n",- "}\n",- "```\n",- "\u001b[0m\n",- "Observation: \u001b[36;1m\u001b[1;3mCitizen Kane\u001b[0m\n",- "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: Could not parse LLM output: I now know the final answer.\n",- "\u001b[0m\n",+ "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: I should use the `find_movie` tool to find the available movies playing.\u001b[0m\n","Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mI need to try again with the `find_movie` tool to get the list of available movies.\n",- "\n",+ "Thought:\u001b[32;1m\u001b[1;3mI should use the `find_movie` tool to find the available movies playing.\n","Action:\n",- "```\n",+ "```json\n","{\n"," \"action\": \"find_movie\",\n"," \"action_input\": \"\"\n","}\n","```\u001b[0m\n","Observation: \u001b[36;1m\u001b[1;3mCitizen Kane\u001b[0m\n",- "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: Could not parse LLM output: Could not parse LLM output: Could not parse LLM output: Could not parse LLM output: I now know the final answer.\n",- "\u001b[0m\n",- "Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mCould not parse LLM output: I'm sorry, but it seems that I am currently unable to access the movie information. I apologize for the inconvenience.\u001b[0m\n",- "Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mI'm sorry, but it seems that I am currently unable to access the movie information. I apologize for the inconvenience.\n",- "\n",- "Final Answer: I'm sorry, I don't have access to the movie information at the moment.\u001b[0m\n",+ "Thought:\u001b[32;1m\u001b[1;3mThe movie playing is \"Citizen Kane\".\n",+ "Final Answer: Citizen Kane\u001b[0m\n","\n","\u001b[1m> Finished chain.\u001b[0m\n"]@@ -273,10 +232,10 @@{"data": {"text/plain": [- "\"I'm sorry, I don't have access to the movie information at the moment.\""+ "'Citizen Kane'"]},- "execution_count": 9,+ "execution_count": 8,"metadata": {},"output_type": "execute_result"}@@ -312,7 +271,7 @@},{"cell_type": "code",- "execution_count": 10,+ "execution_count": 9,"id": "973f00a2-24da-48b3-adf7-97872d0d5afd","metadata": {},"outputs": [],@@ -326,7 +285,7 @@},{"cell_type": "code",- "execution_count": 11,+ "execution_count": 10,"id": "16d8136c-cac2-47a5-85d8-cc466089feea","metadata": {},"outputs": [],@@ -336,7 +295,7 @@},{"cell_type": "code",- "execution_count": 12,+ "execution_count": 11,"id": "b5986ed0-02d0-4e5f-99cd-c1fdfd7e5f1c","metadata": {},"outputs": [],@@ -350,7 +309,7 @@},{"cell_type": "code",- "execution_count": 13,+ "execution_count": 12,"id": "bdce6ac1-bdbc-46ba-a9f1-7fd384187016","metadata": {},"outputs": [@@ -358,7 +317,7 @@"name": "stdout","output_type": "stream","text": [- "Agent Ops session ID: 31ca6d3f-669c-4498-9873-6820d22747a4\n"+ "Agent Ops session ID: d228326a-6392-4863-8ba5-a27ead34f586\n"]}],@@ -374,7 +333,7 @@},{"cell_type": "code",- "execution_count": 15,+ "execution_count": 13,"id": "d728c326-9a41-498b-bb64-9720577aac3e","metadata": {},"outputs": [],@@ -392,7 +351,7 @@},{"cell_type": "code",- "execution_count": 16,+ "execution_count": 14,"id": "5d01e2b2-42f1-45ed-8a9d-fdfe82154926","metadata": {},"outputs": [@@ -400,7 +359,7 @@"name": "stdout","output_type": "stream","text": [- "Agent Ops session ID: 31ca6d3f-669c-4498-9873-6820d22747a4\n"+ "Agent Ops session ID: d228326a-6392-4863-8ba5-a27ead34f586\n"]}],@@ -410,7 +369,7 @@},{"cell_type": "code",- "execution_count": 17,+ "execution_count": 15,"id": "30eddc8b-0c90-4d96-9f1f-45da38c0d984","metadata": {},"outputs": [@@ -423,33 +382,16 @@"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n","\n","Observation: Invalid or incomplete response\n",- "Thought:\n",- "Observation: Invalid or incomplete response\n",- "Thought:\u001b[32;1m\u001b[1;3mI can use the `find_movie` tool to get the list of available movies.\n",+ "Thought:\u001b[32;1m\u001b[1;3mI need to use the `find_movie` tool to find the available movies playing.\n","Action:\n",- "```\n",+ "```json\n","{\n"," \"action\": \"find_movie\",\n"," \"action_input\": \"\"\n","}\n","```\u001b[0m\n","Observation: \u001b[36;1m\u001b[1;3mCitizen Kane\u001b[0m\n",- "Thought:"- ]- },- {- "name": "stderr",- "output_type": "stream",- "text": [- "WARNING:langchain_core.callbacks.manager:Error in AsyncLangchainCallbackHandler.on_agent_finish callback: NameError(\"name 'finishfinish' is not defined\")\n"- ]- },- {- "name": "stdout",- "output_type": "stream",- "text": [- "\u001b[32;1m\u001b[1;3mThe movie \"Citizen Kane\" is currently playing. \n",- "\n",+ "Thought:\u001b[32;1m\u001b[1;3mThe movie \"Citizen Kane\" is playing. \n","Final Answer: Citizen Kane\u001b[0m\n","\n","\u001b[1m> Finished chain.\u001b[0m\n"