Skip to content

Commit

Permalink
experimental honeybadger llm reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
yujonglee committed Sep 21, 2024
1 parent a3fafca commit 0091006
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions core/lib/canary/query/understander.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,24 @@ defmodule Canary.Query.Understander.LLM do
}
]

case Canary.AI.chat(%{model: chat_model, messages: messages}, timeout: 2_000) do
{:ok, completion} -> {:ok, parse(completion)}
error -> error
args = %{model: chat_model, messages: messages}

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

Honeybadger.event("llm", %{
task: "understander",
query: query,
messages: messages,
completion: completion,
parsed: parsed
})

{:ok, parsed}

error ->
error
end
end

Expand Down

0 comments on commit 0091006

Please sign in to comment.