Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shreemaan-abhishek committed Oct 8, 2024
1 parent e16e873 commit 6f9d469
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion apisix/plugins/ai-rag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ local schema = {
-- ensure only one provider can be configured while implementing support for
-- other providers
required = { "azure_openai" },
maxProperties = 1,
},
vector_search_provider = {
type = "object",
Expand All @@ -47,7 +48,8 @@ local schema = {
},
-- ensure only one provider can be configured while implementing support for
-- other providers
required = { "azure_ai_search" }
required = { "azure_ai_search" },
maxProperties = 1
},
},
required = { "embeddings_provider", "vector_search_provider" }
Expand Down
3 changes: 2 additions & 1 deletion apisix/plugins/ai-rag/embeddings/azure_openai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
--
local core = require("apisix.core")
local HTTP_INTERNAL_SERVER_ERROR = ngx.HTTP_INTERNAL_SERVER_ERROR
local HTTP_OK = ngx.HTTP_OK
local type = type

local _M = {}
Expand Down Expand Up @@ -52,7 +53,7 @@ function _M.get_embeddings(conf, body, httpc)
return nil, HTTP_INTERNAL_SERVER_ERROR, err
end

if res.status ~= 200 then
if res.status ~= HTTP_OK then
return nil, res.status, res.body
end

Expand Down
3 changes: 2 additions & 1 deletion apisix/plugins/ai-rag/vector-search/azure_ai_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
--
local core = require("apisix.core")
local HTTP_INTERNAL_SERVER_ERROR = ngx.HTTP_INTERNAL_SERVER_ERROR
local HTTP_OK = ngx.HTTP_OK

local _M = {}

Expand Down Expand Up @@ -61,7 +62,7 @@ function _M.search(conf, search_body, httpc)
return nil, HTTP_INTERNAL_SERVER_ERROR, err
end

if res.status ~= 200 then
if res.status ~= HTTP_OK then
return nil, res.status, res.body
end

Expand Down

0 comments on commit 6f9d469

Please sign in to comment.