Toolkit.WorldTimeApi

A prebuilt tool for interacting with the WorldTimeApi.

# USAGE:
# Tool list to initialize the client
tools = [current_time.tool]
# Tool handler map is passed to Tools.handle_tool_calls!
tool_handler_map = Dict.from_list([(currentTime.name, currentTime.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 })

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

Expose name, handler and tool for the currentTime.

This tool allows the model to get the current time data for a given timezone.