Move model definition into completion struct
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ defmodule OpenAI.API do
|
|||||||
|
|
||||||
Req.post!("https://api.openai.com/v1/chat/completions",
|
Req.post!("https://api.openai.com/v1/chat/completions",
|
||||||
json: %{
|
json: %{
|
||||||
model: "gpt-4o-mini",
|
model: completion.model,
|
||||||
messages: [Map.take(completion, [:content, :role])],
|
messages: [Map.take(completion, [:content, :role])],
|
||||||
response_format: %{type: "json_object"},
|
response_format: %{type: "json_object"},
|
||||||
stream: true,
|
stream: true,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
defmodule OpenAI.Completion do
|
defmodule OpenAI.Completion do
|
||||||
defstruct content: "",
|
defstruct content: "",
|
||||||
temperature: 0.2,
|
temperature: 0.2,
|
||||||
role: "user"
|
role: "user",
|
||||||
|
model: "gpt-4o-mini"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user