llama-index tools chatgpt_plugin integration
Project description
ChatGPT Plugin Tool
This tool allows Agents to load a plugin using a ChatGPT manifest file, and have the Agent interact with it.
Usage
This tool has more extensive example usage documented in a Jupyter notebook here
# Load the manifest
import requests
import yaml
f = requests.get(
"https://raw.githubusercontent.com/sisbell/chatgpt-plugin-store/main/manifests/today-currency-converter.oiconma.repl.co.json"
).text
manifest = yaml.safe_load(f)
from llama_index.tools.chatgpt_plugin import ChatGPTPluginToolSpec
from llama_index.agent.openai import OpenAIAgent
from llama_index.tools.requests import RequestsToolSpec
requests_spec = RequestsToolSpec()
plugin_spec = ChatGPTPluginToolSpec(manifest)
# OR
plugin_spec = ChatGPTPluginToolSpec(
manifest_url="https://raw.githubusercontent.com/sisbell/chatgpt-plugin-store/main/manifests/today-currency-converter.oiconma.repl.co.json"
)
agent = OpenAIAgent.from_tools(
[*plugin_spec.to_tool_list(), *requests_spec.to_tool_list()], verbose=True
)
print(agent.chat("Convert 100 euros to CAD"))
describe_plugin
: Describe the plugin that has been loaded.
load_openapi_spec
: Returns the parsed OpenAPI spec that the class was initialized with
In addition to the above method, this tool makes all of the tools available from the OpenAPI Tool Spec and Requests Tool Spec available to the agent. The plugin OpenAPI definition is loaded into the OpenAPI tool spec, and authentication headers are passed in to the Requests tool spec
This loader is designed to be used as a way to load data as a Tool in a Agent.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for llama_index_tools_chatgpt_plugin-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea25eb293864eeb8193d57c06019beae0945e44d55e973f1e862dbfbe36d3bef |
|
MD5 | 1aa4c97b86bba4fde03223176b17b4e0 |
|
BLAKE2b-256 | 978a8a29e168409092fc761beb17dd154ca9239816702eea1dd7fb2018a0aa3d |
Hashes for llama_index_tools_chatgpt_plugin-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 804fe59b6c8bbfaa0259f3009ffabecbc4b74a6de2bd6d6e8e272eb5c3aab1ae |
|
MD5 | 4556ff284b0007957d9d2b7623916802 |
|
BLAKE2b-256 | c5b1eae50be45ed8b9c637645c9eee83475c94d6e014f1bd1aa8e4f77d35884f |