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 authored and fffonion committed Jun 20, 2024
1 parent 192f56f commit 116f017
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

1 comment on commit 116f017

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:116f01754911ed80bbe1df20f1546077d908aed1
Artifacts available https://github.com/Kong/kong/actions/runs/9590350416

Please sign in to comment.