Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yujonglee committed Sep 29, 2024
1 parent 96e8f29 commit 68b1fbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/lib/canary/ai.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule Canary.AI.OpenAI do
retry with: exponential_backoff() |> randomize |> cap(1_000) |> expiry(4_000) do
client()
|> Req.post(
url: "/v1/chat/completions",
url: "/chat/completions",
json: request,
into: into,
receive_timeout: opts[:timeout] || 15_000
Expand Down
3 changes: 3 additions & 0 deletions core/lib/canary/interactions/responder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ defmodule Canary.Interactions.Responder.Default do
%{"choices" => [%{"delta" => %{"content" => content}}]} ->
safe(handle_delta, {:delta, content})
Agent.update(pid, &(&1 <> content))

_ ->
:ok
end
end
)
Expand Down
2 changes: 1 addition & 1 deletion core/lib/canary/query/understander.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule Canary.Query.Understander.LLM do

args = %{model: chat_model, messages: messages, temperature: 0}

case Canary.AI.chat(args, timeout: 2_000) do
case Canary.AI.chat(args, timeout: 3_000) do
{:ok, completion} ->
parsed = parse(completion, max: 5)

Expand Down

0 comments on commit 68b1fbd

Please sign in to comment.