Skip to main content

llama-index tools metaphor integration

Project description

Metaphor Tool

================================================================================

NOTE: Deprecated in favor of Exa Tool.

================================================================================

This tool connects to Metaphor to easily enable your agent to search and get HTML content from the Internet.

To begin, you need to obtain an API key on the Metaphor developer dashboard.

Usage

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

Here's an example usage of the MetaphorToolSpec.

from llama_index.tools.metaphor import MetaphorToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

metaphor_tool = MetaphorToolSpec(
    api_key="your-key",
)
agent = FunctionAgent(
    tools=metaphor_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(
    await agent.run(
        "Can you summarize the news published in the last month on superconductors"
    )
)

search: Search for a list of articles relating to a natural language query retrieve_documents: Retrieve a list of documents returned from metaphor_search. search_and_retrieve_documents: Combines search and retrieve_documents to directly return a list of documents related to a search find_similar: Find similar documents to a given URL. current_date: Utility for the Agent to get todays date

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_metaphor-0.4.1.tar.gz (4.8 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_metaphor-0.4.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_metaphor-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_metaphor-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2ead7047a4b2258766f1694389c5f056cd66b44062d720ba05beb17d5f6c2414
MD5 9be40d1a96b68abfe2f7bd02e2acf590
BLAKE2b-256 f48e3641db1931751ddfad5ccdac556bc60fc28624e58d803ea4098cd57eca98

See more details on using hashes here.

File details

Details for the file llama_index_tools_metaphor-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_metaphor-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe6030cba9fd4e1c48be51ef9a97fd70014e40c329af63ac53e2cc73dc9f1d72
MD5 4908efeae7d95f5e246538eb22ec9ed1
BLAKE2b-256 0871d586d789bf7748aff1d52d91779ac7ea08ba488c0be52dbaf80a79d8da75

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