Use gpt 4.1 with search

This commit is contained in:
Claudio Ortolina
2026-02-22 10:27:44 +00:00
parent 8d38512712
commit 78025eba69
3 changed files with 27 additions and 25 deletions
+3 -2
View File
@@ -17,11 +17,12 @@ defmodule OpenAI do
end
def chat_stream(messages, opts \\ []) when is_list(messages) do
model = Keyword.get(opts, :model, "gpt-4o-mini")
model = Keyword.get(opts, :model, "gpt-4.1")
temperature = Keyword.get(opts, :temperature, 0.7)
instructions = Keyword.get(opts, :instructions, "")
on_chunk = Keyword.fetch!(opts, :on_chunk)
case API.chat_stream(messages, model, temperature, api_key(), on_chunk) do
case API.chat_stream(messages, instructions, model, temperature, api_key(), on_chunk) do
:ok -> :ok
{:error, _reason} = error -> error
end