Skip to content

Commit ace442b

Browse files
authored
bump to ver 208 (#6540)
1 parent 53c1f12 commit ace442b

File tree

2 files changed

+14
-35
lines changed

2 files changed

+14
-35
lines changed

docs/extras/modules/agents/agent_types/openai_multi_functions_agent.ipynb

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "9502d5b0",
66
"metadata": {},
77
"source": [
8-
"# OpenAI Functions Agent\n",
8+
"# OpenAI Multi Functions Agent\n",
99
"\n",
1010
"This notebook showcases using an agent that uses the OpenAI functions ability to respond to the prompts of the user using a Large Language Model\n",
1111
"\n",
@@ -16,27 +16,12 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 1,
19+
"execution_count": 2,
2020
"id": "c0a83623",
2121
"metadata": {},
22-
"outputs": [
23-
{
24-
"name": "stderr",
25-
"output_type": "stream",
26-
"text": [
27-
"/Users/harrisonchase/.pyenv/versions/3.9.1/envs/langchain/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.5) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n",
28-
" warnings.warn(\n"
29-
]
30-
}
31-
],
22+
"outputs": [],
3223
"source": [
33-
"from langchain import (\n",
34-
" LLMMathChain,\n",
35-
" OpenAI,\n",
36-
" SerpAPIWrapper,\n",
37-
" SQLDatabase,\n",
38-
" SQLDatabaseChain,\n",
39-
")\n",
24+
"from langchain import SerpAPIWrapper\n",
4025
"from langchain.agents import initialize_agent, Tool\n",
4126
"from langchain.agents import AgentType\n",
4227
"from langchain.chat_models import ChatOpenAI"
@@ -47,21 +32,15 @@
4732
"id": "86198d9c",
4833
"metadata": {},
4934
"source": [
50-
"The agent is given ability to perform 3 search functionalities with the respective tools\n",
35+
"The agent is given ability to perform search functionalities with the respective tool\n",
5136
"\n",
5237
"SerpAPIWrapper:\n",
53-
">This initializes the SerpAPIWrapper for search functionality (search).\n",
54-
"\n",
55-
"LLMMathChain Initialization:\n",
56-
">This component provides math-related functionality.\n",
57-
"\n",
58-
"SQL Database Initialization:\n",
59-
">This component provides the agent to query in Custom Data Base.\n"
38+
">This initializes the SerpAPIWrapper for search functionality (search).\n"
6039
]
6140
},
6241
{
6342
"cell_type": "code",
64-
"execution_count": 2,
43+
"execution_count": 3,
6544
"id": "6fefaba2",
6645
"metadata": {},
6746
"outputs": [],
@@ -86,7 +65,7 @@
8665
},
8766
{
8867
"cell_type": "code",
89-
"execution_count": 3,
68+
"execution_count": 4,
9069
"id": "9ff6cee9",
9170
"metadata": {},
9271
"outputs": [],
@@ -128,7 +107,7 @@
128107
" \"System: You are a helpful AI assistant.\\nHuman: What is the weather in LA and SF?\"\n",
129108
" ]\n",
130109
"}\n",
131-
"\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 2:llm:ChatOpenAI] [2.76s] Exiting LLM run with output:\n",
110+
"\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 2:llm:ChatOpenAI] [2.91s] Exiting LLM run with output:\n",
132111
"\u001b[0m{\n",
133112
" \"generations\": [\n",
134113
" [\n",
@@ -160,19 +139,19 @@
160139
"}\n",
161140
"\u001b[32;1m\u001b[1;3m[tool/start]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 3:tool:Search] Entering Tool run with input:\n",
162141
"\u001b[0m\"{'tool_input': 'weather in Los Angeles'}\"\n",
163-
"\u001b[36;1m\u001b[1;3m[tool/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 3:tool:Search] [112.99199999999999ms] Exiting Tool run with output:\n",
142+
"\u001b[36;1m\u001b[1;3m[tool/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 3:tool:Search] [608.693ms] Exiting Tool run with output:\n",
164143
"\u001b[0m\"Mostly cloudy early, then sunshine for the afternoon. High 76F. Winds SW at 5 to 10 mph. Humidity59%.\"\n",
165144
"\u001b[32;1m\u001b[1;3m[tool/start]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 4:tool:Search] Entering Tool run with input:\n",
166145
"\u001b[0m\"{'tool_input': 'weather in San Francisco'}\"\n",
167-
"\u001b[36;1m\u001b[1;3m[tool/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 4:tool:Search] [522.576ms] Exiting Tool run with output:\n",
146+
"\u001b[36;1m\u001b[1;3m[tool/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 4:tool:Search] [517.475ms] Exiting Tool run with output:\n",
168147
"\u001b[0m\"Partly cloudy this evening, then becoming cloudy after midnight. Low 53F. Winds WSW at 10 to 20 mph. Humidity83%.\"\n",
169148
"\u001b[32;1m\u001b[1;3m[llm/start]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 5:llm:ChatOpenAI] Entering LLM run with input:\n",
170149
"\u001b[0m{\n",
171150
" \"prompts\": [\n",
172151
" \"System: You are a helpful AI assistant.\\nHuman: What is the weather in LA and SF?\\nAI: {'name': 'tool_selection', 'arguments': '{\\\\n \\\"actions\\\": [\\\\n {\\\\n \\\"action_name\\\": \\\"Search\\\",\\\\n \\\"action\\\": {\\\\n \\\"tool_input\\\": \\\"weather in Los Angeles\\\"\\\\n }\\\\n },\\\\n {\\\\n \\\"action_name\\\": \\\"Search\\\",\\\\n \\\"action\\\": {\\\\n \\\"tool_input\\\": \\\"weather in San Francisco\\\"\\\\n }\\\\n }\\\\n ]\\\\n}'}\\nFunction: Mostly cloudy early, then sunshine for the afternoon. High 76F. Winds SW at 5 to 10 mph. Humidity59%.\\nAI: {'name': 'tool_selection', 'arguments': '{\\\\n \\\"actions\\\": [\\\\n {\\\\n \\\"action_name\\\": \\\"Search\\\",\\\\n \\\"action\\\": {\\\\n \\\"tool_input\\\": \\\"weather in Los Angeles\\\"\\\\n }\\\\n },\\\\n {\\\\n \\\"action_name\\\": \\\"Search\\\",\\\\n \\\"action\\\": {\\\\n \\\"tool_input\\\": \\\"weather in San Francisco\\\"\\\\n }\\\\n }\\\\n ]\\\\n}'}\\nFunction: Partly cloudy this evening, then becoming cloudy after midnight. Low 53F. Winds WSW at 10 to 20 mph. Humidity83%.\"\n",
173152
" ]\n",
174153
"}\n",
175-
"\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 5:llm:ChatOpenAI] [1.88s] Exiting LLM run with output:\n",
154+
"\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor > 5:llm:ChatOpenAI] [2.33s] Exiting LLM run with output:\n",
176155
"\u001b[0m{\n",
177156
" \"generations\": [\n",
178157
" [\n",
@@ -197,7 +176,7 @@
197176
" },\n",
198177
" \"run\": null\n",
199178
"}\n",
200-
"\u001b[36;1m\u001b[1;3m[chain/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor] [5.28s] Exiting Chain run with output:\n",
179+
"\u001b[36;1m\u001b[1;3m[chain/end]\u001b[0m \u001b[1m[1:chain:AgentExecutor] [6.37s] Exiting Chain run with output:\n",
201180
"\u001b[0m{\n",
202181
" \"output\": \"The weather in Los Angeles is mostly cloudy with a high of 76°F and a humidity of 59%. The weather in San Francisco is partly cloudy in the evening, becoming cloudy after midnight, with a low of 53°F and a humidity of 83%.\"\n",
203182
"}\n"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "langchain"
3-
version = "0.0.207"
3+
version = "0.0.208"
44
description = "Building applications with LLMs through composability"
55
authors = []
66
license = "MIT"

0 commit comments

Comments
 (0)