Skip to main content

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.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
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 = FunctionAgent(
    tools=[*plugin_spec.to_tool_list(), *requests_spec.to_tool_list()],
    llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("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

llama_index_tools_chatgpt_plugin-0.5.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_tools_chatgpt_plugin-0.5.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_chatgpt_plugin-0.5.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_chatgpt_plugin-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2e6d6201d014663939e56ea82b3aec856c5b796cb865d4643577fad57130761f
MD5 ba98e3fd5d8300ec927e115bf1c18c81
BLAKE2b-256 900b1826bab6ba90d4a48c29230eb169114ed8f318f674e69c194ea0d86bf17c

See more details on using hashes here.

File details

Details for the file llama_index_tools_chatgpt_plugin-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_tools_chatgpt_plugin-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_chatgpt_plugin-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 534395149c2a652691bda07b3f86cfa5a2cb4a1b425fd507a970a1d8ea53287e
MD5 e5c535fb88e0f929798900c5317315f5
BLAKE2b-256 763a1410dd578803559f842f77d6f6756860fc41c8ce5e206dbf8ab4d500c197

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page