Skip to content

Commit

Permalink
fix(ai-proxy): test-mode for streaming tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong committed Jun 18, 2024
1 parent 3b9a95b commit dffa642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/llm/drivers/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ end
function _M.frame_to_events(frame)
local events = {}

-- todo check if it's raw json and
-- Cohere / Other flat-JSON format parser
-- just return the split up data frame
if (not kong.ctx.plugin.truncated_frame) and string.sub(str_ltrim(frame), 1, 1) == "{" then
if (not kong or 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 dffa642

Please sign in to comment.