improving tool calling tracking
Some checks failed
CI/CD Pipeline / build (push) Failing after 5s

This commit is contained in:
2026-03-23 12:34:22 -06:00
parent 6fc4a686f8
commit e0ca44df23
12 changed files with 417 additions and 115 deletions

View File

@@ -47,7 +47,7 @@ defmodule ElixirAi.ChatUtils do
}
end
def request_ai_response(server, messages, tools, provider) do
def request_ai_response(server, messages, tools, provider, tool_choice \\ "auto") do
Task.start_link(fn ->
api_url = provider.completions_url
api_key = provider.api_token
@@ -69,7 +69,8 @@ defmodule ElixirAi.ChatUtils do
model: model,
stream: true,
messages: messages |> Enum.map(&api_message/1),
tools: Enum.map(tools, & &1.definition)
tools: Enum.map(tools, & &1.definition),
tool_choice: tool_choice
}
headers = [{"authorization", "Bearer #{api_key}"}]