Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
shreemaan-abhishek committed Sep 11, 2024
1 parent 073b3f8 commit 5831108
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apisix/plugins/ai-proxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function _M.access(conf, ctx)
local ai_driver = require("apisix.plugins.ai-proxy.drivers." .. conf.model.provider)
local res, err, httpc = ai_driver.request(conf, request_table, ctx)
if not res then
core.log.error("failed to send request to AI service: ", err)
core.log.error("failed to send request to LLM service: ", err)
return internal_server_error
end

Expand Down
3 changes: 1 addition & 2 deletions apisix/plugins/ai-proxy/drivers/openai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ local http = require("resty.http")
local url = require("socket.url")

local pairs = pairs
local type = type

-- globals
local DEFAULT_HOST = "api.openai.com"
Expand Down Expand Up @@ -77,7 +76,7 @@ function _M.request(conf, request_table, ctx)

local res, err = httpc:request(params)
if not res then
return 500, "failed to send request to LLM server: " .. err
return nil, err
end

return res, nil, httpc
Expand Down
2 changes: 1 addition & 1 deletion t/sse_server_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func sseHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "[ERROR]")
return
}
// A simple loop that sends a message every 2 seconds
// A simple loop that sends a message every 500ms
for i := 0; i < 5; i++ {
// Create a message to send to the client
fmt.Fprintf(w, "data: %s\n\n", time.Now().Format(time.RFC3339))
Expand Down

0 comments on commit 5831108

Please sign in to comment.