Skip to main content

llama-index tools requests integration

Project description

Requests Tool

This tool provides the agent the ability to make HTTP requests. It can be combined with the OpenAPIToolSpec to interface with an OpenAPI server.

For security reasons, you must specify the hostname for the headers that you wish to provide. See here for an example

Usage

This tool has more extensive example usage documented in a Jupyter notebook here

Here's an example usage of the RequestsToolSpec.

from llama_index.tools.requests import RequestsToolSpec
from llama_index.agent.openai import OpenAIAgent

domain_headers = {
    "api.openai.com": {
        "Authorization": "Bearer sk-your-key",
        "Content-Type": "application/json",
    }
}

tool_spec = RequestsToolSpec(domain_headers=domain_headers)

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat("")

get_request: Performs a get request against the URL post_request: Performs a post request against the URL patch_request: Performs a patch request against the URL

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_requests-0.4.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.

llama_index_tools_requests-0.4.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_requests-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_requests-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4025c9feaa372064980217226abf0846ca44e9c74d739811d2b0f7a9fd9f7377
MD5 ead78d1139c2c9fdc58921208a6572f6
BLAKE2b-256 83b99240ddf90cfdb97990e696eedb399983472e567225c75fa51a2e0de1c790

See more details on using hashes here.

File details

Details for the file llama_index_tools_requests-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_requests-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8228a1150810b8c6f07e4a379c38020cd91f1aeb2a028bc8f88c4e44ecac8a61
MD5 3ebe84549ecd03a4e2998762180e98f4
BLAKE2b-256 64140d702c32d3692d7ea161b347c158fdcfb8aca20f1c7914aa245732d71024

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