This commit is contained in:
@@ -47,6 +47,18 @@ defmodule ElixirAi.ChatUtils do
|
|||||||
api_key = Application.fetch_env!(:elixir_ai, :ai_token)
|
api_key = Application.fetch_env!(:elixir_ai, :ai_token)
|
||||||
model = Application.fetch_env!(:elixir_ai, :ai_model)
|
model = Application.fetch_env!(:elixir_ai, :ai_model)
|
||||||
|
|
||||||
|
if is_nil(api_url) or api_url == "" do
|
||||||
|
Logger.warning("AI endpoint is empty or nil")
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_nil(api_key) or api_key == "" do
|
||||||
|
Logger.warning("AI token is empty or nil")
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_nil(model) or model == "" do
|
||||||
|
Logger.warning("AI model is empty or nil")
|
||||||
|
end
|
||||||
|
|
||||||
body = %{
|
body = %{
|
||||||
model: model,
|
model: model,
|
||||||
stream: true,
|
stream: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user