Toolkit.WolframAlpha

A prebuilt tool for interacting with Wolfram Alpha.

# USAGE:
# Tool list to initialize the client
tools = [wolfram_short_answer.tool]
# Tool handler map is passed to Tools.handle_tool_calls!
tool_handler_map = Dict.from_list([
    (wolfram_short_answer.name, wolfram_short_answer.handler!),
])
client = Client.new { apiKey, model: "tool-capable/model", tools }
#...
messages = Chat.add_user_message(client, newMessage, {})
response = Http.send!(Chat.build_http_request(client, {}))?
with_tool_results = 
     Chat.update_messages(response, messages)?
    |> Tools.handle_tool_calls!(client toolHandlerMap, { max_model_calls: 5 })

wolfram_short_answer : { name : Str, handler! : Str => Result Str , tool : Tool }

Expose name, handler and tool for shortAnswer.

This tool allows the model to ask Wolfram Alpha a question and get a short answer.