Skip to main content

llama-index tools wolfram_alpha integration

Project description

Wolfram Alpha Tool

This tool connects to Wolfram|Alpha's LLM API, which returns responses optimized for language model consumption.

You will need to provide an API key: https://products.wolframalpha.com/api

Usage

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

Here's an example usage of the WolframAlphaToolSpec.

from llama_index.tools.wolfram_alpha import WolframAlphaToolSpec
from llama_index.agent.core.agent import FunctionAgent
from llama_index.llms.openai import OpenAI


wolfram_spec = WolframAlphaToolSpec(app_id="API-key")

agent = FunctionAgent(
    tools=wolfram_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("how many calories are in 100g of milk chocolate"))
print(await agent.run("what is the mass of the helium in the sun"))

API Parameters

You can pass additional parameters to the Wolfram|Alpha LLM API:

wolfram_spec = WolframAlphaToolSpec(
    app_id="API-key",
    api_params={
        "maxchars": 2048,  # Maximum characters in response
        "units": "metric",  # Unit system preference
    },
)

See the Wolfram|Alpha LLM API documentation for available parameters.

wolfram_alpha_query: Get the result of a query from Wolfram Alpha

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_wolfram_alpha-0.6.0.tar.gz (5.1 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_wolfram_alpha-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_wolfram_alpha-0.6.0.tar.gz
  • Upload date:
  • Size: 5.1 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_wolfram_alpha-0.6.0.tar.gz
Algorithm Hash digest
SHA256 d2cb42be2c5272eee9d3cb8bf1cef789d74daf3fea07d67d28b22f0572351b33
MD5 03c32348bc7733f1cd165b2a47aca945
BLAKE2b-256 399d8a56389e2011a638d8ae8d491edc7305daea58c7c624b8d983677a39e4ea

See more details on using hashes here.

File details

Details for the file llama_index_tools_wolfram_alpha-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_tools_wolfram_alpha-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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_wolfram_alpha-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d66a89c863ffba1d2dedf7d4b6e9c8bcd717f77f9cdb1b19c5e576ade2f97dce
MD5 70197067bfe0c1401def9ef5387cd54f
BLAKE2b-256 ebd252a01fdb2742f2a6dab87221ecd324b278d9c9a21c9e8613dc8d7d6b05f7

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