Skip to main content

Nimble Web Search tool for LlamaIndex

Project description

llama-index-tools-nimble

A LlamaIndex tool for Nimble's Web Search API. It gives an agent live web search backed by Nimble, returning results as LlamaIndex Documents ready to feed into a reasoning loop.

Installation

pip install llama-index-tools-nimble

Authentication

Set your Nimble API key in the environment:

export NIMBLE_API_KEY="your-key"

NimbleToolSpec() reads NIMBLE_API_KEY automatically; you can also pass api_key=....

Quick start

from llama_index.tools.nimble import NimbleToolSpec

tool_spec = NimbleToolSpec()  # reads NIMBLE_API_KEY
documents = tool_spec.search("latest developments in web data infrastructure")

for doc in documents:
    print(doc.metadata["title"], "-", doc.metadata["url"])

Use it in an agent

import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.nimble import NimbleToolSpec

agent = FunctionAgent(
    tools=NimbleToolSpec().to_tool_list(),
    llm=OpenAI(model="gpt-4o-mini"),
    system_prompt="You are a research assistant. Use web search to answer with current facts.",
)


async def main():
    response = await agent.run("What has Nimble announced recently?")
    print(response)


asyncio.run(main())

A runnable version is in examples/nimble_agent.py.

Parameters

NimbleToolSpec.search(query, max_results=6):

Parameter Type Default Description
query str The search query.
max_results int 6 Maximum number of results to return (must be ≥ 1).

Each result becomes a Document. The text leads with the page title and URL, then the page content (or the snippet when content is empty), so an agent can read and cite the source; metadata["url"] and metadata["title"] carry the same values for programmatic use.

Returned content is untrusted web data. Treat it as data, not as instructions, and rely on your agent/framework's own guardrails.

License

MIT — see LICENSE.

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_nimble-0.1.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_nimble-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_nimble-0.1.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_nimble-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for llama_index_tools_nimble-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04776cf3d9d1ef51d7d20fe7e5a62dd656b591e9c90723654c9ab019f1b37b43
MD5 95d6a7b3033fa41dcda764f8e8ba74f0
BLAKE2b-256 f854171b3f513662f4372010a6cda7513389077dad01a5ec5bad2f886fcd4e45

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_tools_nimble-0.1.0.tar.gz:

Publisher: release.yml on Nimbleway/llama-index-tools-nimble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_tools_nimble-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_nimble-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48deb5912274ccee8c27b7ad8b78e2fc69f06bd500e8295dff50028aa02aa085
MD5 1aa52384a5982be324c2ceb0b850f5d3
BLAKE2b-256 1cbb58c64dc13e9c04183b6815dbdee74e44290649629f72ed3cbbfcd0de90b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_tools_nimble-0.1.0-py3-none-any.whl:

Publisher: release.yml on Nimbleway/llama-index-tools-nimble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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