using providers
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s

This commit is contained in:
2026-03-13 15:55:05 -06:00
parent 4de7db6f56
commit 179149b986
7 changed files with 80 additions and 37 deletions

View File

@@ -40,11 +40,11 @@ defmodule ElixirAi.ChatUtils do
}
end
def request_ai_response(server, messages, tools) do
def request_ai_response(server, messages, tools, provider) do
Task.start(fn ->
api_url = Application.fetch_env!(:elixir_ai, :ai_endpoint)
api_key = Application.fetch_env!(:elixir_ai, :ai_token)
model = Application.fetch_env!(:elixir_ai, :ai_model)
api_url = provider.completions_url
api_key = provider.api_token
model = provider.model_name
if is_nil(api_url) or api_url == "" do
Logger.warning("AI endpoint is empty or nil")