Toolkit.Roc
A collection of prebuilt tools for interacting with the Roc programming language CLI.
# USAGE: # Tool list to initialize the client tools = [roc.tool, roc_check.tool, roc_test.tool, roc_start.tool] # Tool handler map is passed to Tools.handle_tool_calls! tool_handler_map = Dict.from_list([ (roc.name, roc.handler), (rocCheck.name, rocCheck.handler), (rocTest.name, rocTest.handler), (rocStart.name, rocStart.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 })
roc :
{
name : Str,
handler! : Str => Result Str ,
tool : Tool
}
Expose name, handler and tool for roc.
This tool will allow the model to run roc
for a roc file.
roc_check :
{
name : Str,
handler! : Str => Result Str ,
tool : Tool
}
Expose name, handler and tool for rocCheck.
This tool will allow the model to run roc check
for a Roc file.
roc_test :
{
name : Str,
handler! : Str => Result Str ,
tool : Tool
}
Expose name, handler and tool for rocTest.
This tool will allow the model to run roc test
for a Roc file.
roc_start :
{
name : Str,
handler! : Str => Result Str ,
tool : Tool
}
Expose name, handler and tool for rocStart.
This tool will allow the model to use roc-start
to initialize a new Roc application.