Skip to content

Commit

Permalink
fix(ai-proxy): token streaming truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong committed Jun 18, 2024
1 parent 25fb321 commit 1814a34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kong/llm/drivers/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function _M.frame_to_events(frame)

-- todo check if it's raw json and
-- just return the split up data frame
if string.sub(str_ltrim(frame), 1, 1) == "{" then
if (not kong.ctx.plugin.truncated_frame) and string.sub(str_ltrim(frame), 1, 1) == "{" then
for event in frame:gmatch("[^\r\n]+") do
events[#events + 1] = {
data = event,
Expand Down

0 comments on commit 1814a34

Please sign in to comment.