Skip to content

Commit

Permalink
fix(ai-proxy): userdata token text returned when function calling
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong authored Jun 10, 2024
1 parent 082be0c commit 6cc8c56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kong/plugins/ai-proxy/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ local function get_token_text(event_t)
-- - event_t.choices[1].delta.content
-- - event_t.choices[1].text
-- - ""
return (first_choice.delta or EMPTY).content or first_choice.text or ""
local token_text = (first_choice.delta or EMPTY).content or first_choice.text or ""
return (type(token_text) == "string" and token_text) or ""
end


Expand Down

0 comments on commit 6cc8c56

Please sign in to comment.