Skip to main content

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.

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.7.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.7.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_wolfram_alpha-0.7.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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.7.0.tar.gz
Algorithm Hash digest
SHA256 abbf4c4017491512ed779044c5a019a6bdcfc14fbf9951c395db244bca68cdec
MD5 0c6c94d52f2dded1e919693178ae4861
BLAKE2b-256 5e5cbebca4b392a559aca7c2e614b320848eb1c1892e642f7a1fb2c76cbc0cde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_tools_wolfram_alpha-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5beed31a54052470721b534f8772fe8cc3443ec7a953f4ee4c5e08cf5492245b
MD5 d53a5dc89c160a317c4bcd9e4e43c6f8
BLAKE2b-256 54a1982d6506ff5be12c277e1f7e42459b8f43712d57079bf9d862d37f502ecf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page