mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-03 05:34:01 +00:00
[docs]: merge tool/toolkit duplicates (#25197)
This commit is contained in:
parent
2b15518c5f
commit
6bc451b942
@ -4,12 +4,9 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Connery Action Tool\n",
|
||||
"# Connery Toolkit and Tools\n",
|
||||
"\n",
|
||||
"Using this tool, you can integrate individual Connery Action into your LangChain agent.\n",
|
||||
"\n",
|
||||
"If you want to use more than one Connery Action in your agent,\n",
|
||||
"check out the [Connery Toolkit](/docs/integrations/tools/connery_toolkit) documentation.\n",
|
||||
"Using the Connery toolkit and tools, you can integrate Connery Actions into your LangChain agent.\n",
|
||||
"\n",
|
||||
"## What is Connery?\n",
|
||||
"\n",
|
||||
@ -25,19 +22,11 @@
|
||||
"- GitHub: https://github.com/connery-io/connery\n",
|
||||
"- Documentation: https://docs.connery.io\n",
|
||||
"\n",
|
||||
"## Prerequisites\n",
|
||||
"## Setup\n",
|
||||
"\n",
|
||||
"To use Connery Actions in your LangChain agent, you need to do some preparation:\n",
|
||||
"### Installation\n",
|
||||
"\n",
|
||||
"1. Set up the Connery runner using the [Quickstart](https://docs.connery.io/docs/runner/quick-start/) guide.\n",
|
||||
"2. Install all the plugins with the actions you want to use in your agent.\n",
|
||||
"3. Set environment variables `CONNERY_RUNNER_URL` and `CONNERY_RUNNER_API_KEY` so the toolkit can communicate with the Connery Runner.\n",
|
||||
"\n",
|
||||
"## Example of using Connery Action Tool\n",
|
||||
"\n",
|
||||
"In the example below, we fetch action by its ID from the Connery Runner and then call it with the specified parameters.\n",
|
||||
"\n",
|
||||
"Here, we use the ID of the **Send email** action from the [Gmail](https://github.com/connery-io/gmail) plugin."
|
||||
"You need to install the `langchain_community` package to use the Connery tools."
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -46,12 +35,123 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%pip install -upgrade --quiet langchain-community"
|
||||
"%pip install -qU langchain-community"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Credentials\n",
|
||||
"\n",
|
||||
"To use Connery Actions in your LangChain agent, you need to do some preparation:\n",
|
||||
"\n",
|
||||
"1. Set up the Connery runner using the [Quickstart](https://docs.connery.io/docs/runner/quick-start/) guide.\n",
|
||||
"2. Install all the plugins with the actions you want to use in your agent.\n",
|
||||
"3. Set environment variables `CONNERY_RUNNER_URL` and `CONNERY_RUNNER_API_KEY` so the toolkit can communicate with the Connery Runner."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import getpass\n",
|
||||
"import os\n",
|
||||
"\n",
|
||||
"for key in [\"CONNERY_RUNNER_URL\", \"CONNERY_RUNNER_API_KEY\"]:\n",
|
||||
" if key not in os.environ:\n",
|
||||
" os.environ[key] = getpass.getpass(f\"Please enter the value for {key}: \")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Toolkit\n",
|
||||
"\n",
|
||||
"In the example below, we create an agent that uses two Connery Actions to summarize a public webpage and send the summary by email:\n",
|
||||
"\n",
|
||||
"1. **Summarize public webpage** action from the [Summarization](https://github.com/connery-io/summarization-plugin) plugin.\n",
|
||||
"2. **Send email** action from the [Gmail](https://github.com/connery-io/gmail) plugin.\n",
|
||||
"\n",
|
||||
"You can see a LangSmith trace of this example [here](https://smith.langchain.com/public/4af5385a-afe9-46f6-8a53-57fe2d63c5bc/r)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\n",
|
||||
"Invoking: `CA72DFB0AB4DF6C830B43E14B0782F70` with `{'publicWebpageUrl': 'http://www.paulgraham.com/vb.html'}`\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[0m\u001b[33;1m\u001b[1;3m{'summary': 'The author reflects on the concept of life being short and how having children made them realize the true brevity of life. They discuss how time can be converted into discrete quantities and how limited certain experiences are. The author emphasizes the importance of prioritizing and eliminating unnecessary things in life, as well as actively pursuing meaningful experiences. They also discuss the negative impact of getting caught up in online arguments and the need to be aware of how time is being spent. The author suggests pruning unnecessary activities, not waiting to do things that matter, and savoring the time one has.'}\u001b[0m\u001b[32;1m\u001b[1;3m\n",
|
||||
"Invoking: `CABC80BB79C15067CA983495324AE709` with `{'recipient': 'test@example.com', 'subject': 'Summary of the webpage', 'body': 'Here is a short summary of the webpage http://www.paulgraham.com/vb.html:\\n\\nThe author reflects on the concept of life being short and how having children made them realize the true brevity of life. They discuss how time can be converted into discrete quantities and how limited certain experiences are. The author emphasizes the importance of prioritizing and eliminating unnecessary things in life, as well as actively pursuing meaningful experiences. They also discuss the negative impact of getting caught up in online arguments and the need to be aware of how time is being spent. The author suggests pruning unnecessary activities, not waiting to do things that matter, and savoring the time one has.\\n\\nYou can find the full webpage [here](http://www.paulgraham.com/vb.html).'}`\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[0m\u001b[33;1m\u001b[1;3m{'messageId': '<2f04b00e-122d-c7de-c91e-e78e0c3276d6@gmail.com>'}\u001b[0m\u001b[32;1m\u001b[1;3mI have sent the email with the summary of the webpage to test@example.com. Please check your inbox.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"I have sent the email with the summary of the webpage to test@example.com. Please check your inbox.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"\n",
|
||||
"from langchain.agents import AgentType, initialize_agent\n",
|
||||
"from langchain_community.agent_toolkits.connery import ConneryToolkit\n",
|
||||
"from langchain_community.tools.connery import ConneryService\n",
|
||||
"from langchain_openai import ChatOpenAI\n",
|
||||
"\n",
|
||||
"# Specify your Connery Runner credentials.\n",
|
||||
"os.environ[\"CONNERY_RUNNER_URL\"] = \"\"\n",
|
||||
"os.environ[\"CONNERY_RUNNER_API_KEY\"] = \"\"\n",
|
||||
"\n",
|
||||
"# Specify OpenAI API key.\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = \"\"\n",
|
||||
"\n",
|
||||
"# Specify your email address to receive the email with the summary from example below.\n",
|
||||
"recepient_email = \"test@example.com\"\n",
|
||||
"\n",
|
||||
"# Create a Connery Toolkit with all the available actions from the Connery Runner.\n",
|
||||
"connery_service = ConneryService()\n",
|
||||
"connery_toolkit = ConneryToolkit.create_instance(connery_service)\n",
|
||||
"\n",
|
||||
"# Use OpenAI Functions agent to execute the prompt using actions from the Connery Toolkit.\n",
|
||||
"llm = ChatOpenAI(temperature=0)\n",
|
||||
"agent = initialize_agent(\n",
|
||||
" connery_toolkit.get_tools(), llm, AgentType.OPENAI_FUNCTIONS, verbose=True\n",
|
||||
")\n",
|
||||
"result = agent.run(\n",
|
||||
" f\"\"\"Make a short summary of the webpage http://www.paulgraham.com/vb.html in three sentences\n",
|
||||
"and send it to {recepient_email}. Include the link to the webpage into the body of the email.\"\"\"\n",
|
||||
")\n",
|
||||
"print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"NOTE: Connery Action is a structured tool, so you can only use it in the agents supporting structured tools.\n",
|
||||
"\n",
|
||||
"## Tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -110,7 +210,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -148,6 +248,18 @@
|
||||
"source": [
|
||||
"NOTE: Connery Action is a structured tool, so you can only use it in the agents supporting structured tools."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## API reference\n",
|
||||
"\n",
|
||||
"For detailed documentation of all Connery features and configurations head to the API reference:\n",
|
||||
"\n",
|
||||
"- Toolkit: https://api.python.langchain.com/en/latest/agent_toolkits/langchain_community.agent_toolkits.connery.toolkit.ConneryToolkit.html\n",
|
||||
"- Tool: https://api.python.langchain.com/en/latest/tools/langchain_community.tools.connery.service.ConneryService.html"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
@ -1,145 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Connery Toolkit\n",
|
||||
"\n",
|
||||
"Using this toolkit, you can integrate Connery Actions into your LangChain agent.\n",
|
||||
"\n",
|
||||
"If you want to use only one particular Connery Action in your agent,\n",
|
||||
"check out the [Connery Action Tool](/docs/integrations/tools/connery) documentation.\n",
|
||||
"\n",
|
||||
"## What is Connery?\n",
|
||||
"\n",
|
||||
"Connery is an open-source plugin infrastructure for AI.\n",
|
||||
"\n",
|
||||
"With Connery, you can easily create a custom plugin with a set of actions and seamlessly integrate them into your LangChain agent.\n",
|
||||
"Connery will take care of critical aspects such as runtime, authorization, secret management, access management, audit logs, and other vital features.\n",
|
||||
"\n",
|
||||
"Furthermore, Connery, supported by our community, provides a diverse collection of ready-to-use open-source plugins for added convenience.\n",
|
||||
"\n",
|
||||
"Learn more about Connery:\n",
|
||||
"\n",
|
||||
"- GitHub: https://github.com/connery-io/connery\n",
|
||||
"- Documentation: https://docs.connery.io\n",
|
||||
"\n",
|
||||
"## Prerequisites\n",
|
||||
"\n",
|
||||
"To use Connery Actions in your LangChain agent, you need to do some preparation:\n",
|
||||
"\n",
|
||||
"1. Set up the Connery runner using the [Quickstart](https://docs.connery.io/docs/runner/quick-start/) guide.\n",
|
||||
"2. Install all the plugins with the actions you want to use in your agent.\n",
|
||||
"3. Set environment variables `CONNERY_RUNNER_URL` and `CONNERY_RUNNER_API_KEY` so the toolkit can communicate with the Connery Runner.\n",
|
||||
"\n",
|
||||
"## Example of using Connery Toolkit\n",
|
||||
"\n",
|
||||
"In the example below, we create an agent that uses two Connery Actions to summarize a public webpage and send the summary by email:\n",
|
||||
"\n",
|
||||
"1. **Summarize public webpage** action from the [Summarization](https://github.com/connery-io/summarization-plugin) plugin.\n",
|
||||
"2. **Send email** action from the [Gmail](https://github.com/connery-io/gmail) plugin.\n",
|
||||
"\n",
|
||||
"You can see a LangSmith trace of this example [here](https://smith.langchain.com/public/4af5385a-afe9-46f6-8a53-57fe2d63c5bc/r)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%pip install -qU langchain-community"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\n",
|
||||
"Invoking: `CA72DFB0AB4DF6C830B43E14B0782F70` with `{'publicWebpageUrl': 'http://www.paulgraham.com/vb.html'}`\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[0m\u001b[33;1m\u001b[1;3m{'summary': 'The author reflects on the concept of life being short and how having children made them realize the true brevity of life. They discuss how time can be converted into discrete quantities and how limited certain experiences are. The author emphasizes the importance of prioritizing and eliminating unnecessary things in life, as well as actively pursuing meaningful experiences. They also discuss the negative impact of getting caught up in online arguments and the need to be aware of how time is being spent. The author suggests pruning unnecessary activities, not waiting to do things that matter, and savoring the time one has.'}\u001b[0m\u001b[32;1m\u001b[1;3m\n",
|
||||
"Invoking: `CABC80BB79C15067CA983495324AE709` with `{'recipient': 'test@example.com', 'subject': 'Summary of the webpage', 'body': 'Here is a short summary of the webpage http://www.paulgraham.com/vb.html:\\n\\nThe author reflects on the concept of life being short and how having children made them realize the true brevity of life. They discuss how time can be converted into discrete quantities and how limited certain experiences are. The author emphasizes the importance of prioritizing and eliminating unnecessary things in life, as well as actively pursuing meaningful experiences. They also discuss the negative impact of getting caught up in online arguments and the need to be aware of how time is being spent. The author suggests pruning unnecessary activities, not waiting to do things that matter, and savoring the time one has.\\n\\nYou can find the full webpage [here](http://www.paulgraham.com/vb.html).'}`\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[0m\u001b[33;1m\u001b[1;3m{'messageId': '<2f04b00e-122d-c7de-c91e-e78e0c3276d6@gmail.com>'}\u001b[0m\u001b[32;1m\u001b[1;3mI have sent the email with the summary of the webpage to test@example.com. Please check your inbox.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"I have sent the email with the summary of the webpage to test@example.com. Please check your inbox.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"\n",
|
||||
"from langchain.agents import AgentType, initialize_agent\n",
|
||||
"from langchain_community.agent_toolkits.connery import ConneryToolkit\n",
|
||||
"from langchain_community.tools.connery import ConneryService\n",
|
||||
"from langchain_openai import ChatOpenAI\n",
|
||||
"\n",
|
||||
"# Specify your Connery Runner credentials.\n",
|
||||
"os.environ[\"CONNERY_RUNNER_URL\"] = \"\"\n",
|
||||
"os.environ[\"CONNERY_RUNNER_API_KEY\"] = \"\"\n",
|
||||
"\n",
|
||||
"# Specify OpenAI API key.\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = \"\"\n",
|
||||
"\n",
|
||||
"# Specify your email address to receive the email with the summary from example below.\n",
|
||||
"recepient_email = \"test@example.com\"\n",
|
||||
"\n",
|
||||
"# Create a Connery Toolkit with all the available actions from the Connery Runner.\n",
|
||||
"connery_service = ConneryService()\n",
|
||||
"connery_toolkit = ConneryToolkit.create_instance(connery_service)\n",
|
||||
"\n",
|
||||
"# Use OpenAI Functions agent to execute the prompt using actions from the Connery Toolkit.\n",
|
||||
"llm = ChatOpenAI(temperature=0)\n",
|
||||
"agent = initialize_agent(\n",
|
||||
" connery_toolkit.get_tools(), llm, AgentType.OPENAI_FUNCTIONS, verbose=True\n",
|
||||
")\n",
|
||||
"result = agent.run(\n",
|
||||
" f\"\"\"Make a short summary of the webpage http://www.paulgraham.com/vb.html in three sentences\n",
|
||||
"and send it to {recepient_email}. Include the link to the webpage into the body of the email.\"\"\"\n",
|
||||
")\n",
|
||||
"print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"NOTE: Connery Action is a structured tool, so you can only use it in the agents supporting structured tools."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.13"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,187 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e6fd05db-21c2-4227-9900-0840bc62cb31",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Polygon IO Toolkit\n",
|
||||
"\n",
|
||||
"This notebook shows how to use agents to interact with the [Polygon IO](https://polygon.io/) toolkit. The toolkit provides access to Polygon's Stock Market Data API."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a4da342d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Example Use\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"### Setup"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c17b33e0",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%pip install --upgrade --quiet langchain-community > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3cd00ad2",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Get your Polygon IO API key [here](https://polygon.io/), and then set it below.\n",
|
||||
"Note that the tool used in this example requires a \"Stocks Advanced\" subscription"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"id": "a180a2b8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"········\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import getpass\n",
|
||||
"import os\n",
|
||||
"\n",
|
||||
"os.environ[\"POLYGON_API_KEY\"] = getpass.getpass()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ed6f89fa",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"It's also helpful (but not needed) to set up [LangSmith](https://smith.langchain.com/) for best-in-class observability"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "56670cf6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# os.environ[\"LANGCHAIN_TRACING_V2\"] = \"true\"\n",
|
||||
"# os.environ[\"LANGCHAIN_API_KEY\"] = getpass.getpass()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "7d93e6bd-03d7-4d3c-b915-8b73164e2ad8",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Initializing the agent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"id": "648a2cb2-308e-4b2e-9b73-37109be4e258",
|
||||
"metadata": {
|
||||
"is_executing": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from langchain import hub\n",
|
||||
"from langchain.agents import AgentExecutor, create_openai_functions_agent\n",
|
||||
"from langchain_community.agent_toolkits.polygon.toolkit import PolygonToolkit\n",
|
||||
"from langchain_community.utilities.polygon import PolygonAPIWrapper\n",
|
||||
"from langchain_openai import ChatOpenAI\n",
|
||||
"\n",
|
||||
"llm = ChatOpenAI(temperature=0)\n",
|
||||
"\n",
|
||||
"instructions = \"\"\"You are an assistant.\"\"\"\n",
|
||||
"base_prompt = hub.pull(\"langchain-ai/openai-functions-template\")\n",
|
||||
"prompt = base_prompt.partial(instructions=instructions)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"id": "18650040-0ff8-4c0f-a4f2-be6aad7fe63e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"polygon = PolygonAPIWrapper()\n",
|
||||
"toolkit = PolygonToolkit.from_polygon_api_wrapper(polygon)\n",
|
||||
"agent = create_openai_functions_agent(llm, toolkit.get_tools(), prompt)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"id": "fd7463e4-8716-4d1d-860a-770533eaa742",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_executor = AgentExecutor(\n",
|
||||
" agent=agent,\n",
|
||||
" tools=toolkit.get_tools(),\n",
|
||||
" verbose=True,\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "71f05fc9-d80d-4614-b9a3-e0a5e43cbbbb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Get the last price quote for a stock"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b97409f3-dc87-425d-b555-406cf8466a28",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_executor.invoke({\"input\": \"What is the latest stock price for AAPL?\"})"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "9e666ee1",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
@ -78,6 +78,14 @@
|
||||
"source": "/v0.2/docs/integrations/toolkits/airbyte_structured_qa/",
|
||||
"destination": "/v0.2/docs/integrations/document_loaders/airbyte/"
|
||||
},
|
||||
{
|
||||
"source": "/v0.2/docs/integrations/tools/connery_toolkit/",
|
||||
"destination": "/v0.2/docs/integrations/tools/connery/"
|
||||
},
|
||||
{
|
||||
"source": "/v0.2/docs/integrations/tools/polygon_toolkit/",
|
||||
"destination": "/v0.2/docs/integrations/tools/polygon/"
|
||||
},
|
||||
{
|
||||
"source": "/v0.2/docs/integrations/toolkits/document_comparison_toolkit(/?)",
|
||||
"destination": "/v0.2/docs/tutorials/rag/"
|
||||
|
Loading…
Reference in New Issue
Block a user