File tree Expand file tree Collapse file tree 3 files changed +61
-1
lines changed
Expand file tree Collapse file tree 3 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ _M.ai_proxy_multi_schema = {
194194 default = { algorithm = " roundrobin" }
195195 },
196196 instances = ai_instance_schema ,
197- logging_schema = logging_schema ,
197+ logging = logging_schema ,
198198 fallback_strategy = {
199199 anyOf = {
200200 {
Original file line number Diff line number Diff line change @@ -653,3 +653,36 @@ qr/6data: \[DONE\]\n\n/
653653--- error_code: 400
654654--- response_body eval
655655qr/.invalid endpoint.*/
656+
657+
658+
659+ === TEST 16: schema accepts 'logging'
660+ --- config
661+ location /t {
662+ content_by_lua_block {
663+ local plugin = require("apisix.plugins.ai-proxy-multi")
664+
665+ local ok, err = plugin.check_schema({
666+ instances = {
667+ {
668+ name = "openai-1",
669+ provider = "openai",
670+ weight = 1,
671+ auth = { header = { apikey = "token" } },
672+ options = { model = "gpt-4" },
673+ },
674+ },
675+ logging = { summaries = true },
676+ })
677+
678+ if ok then
679+ ngx.say("ok")
680+ else
681+ ngx.say("bad:" .. (err or ""))
682+ end
683+ }
684+ }
685+ --- request
686+ GET /t
687+ --- response_body
688+ ok
Original file line number Diff line number Diff line change @@ -671,3 +671,30 @@ POST /embeddings
671671--- error_code: 200
672672--- response_body_like eval
673673qr/.*text-embedding-ada-002*/
674+
675+
676+
677+ === TEST 17: schema accepts 'logging'
678+ --- config
679+ location /t {
680+ content_by_lua_block {
681+ local plugin = require("apisix.plugins.ai-proxy")
682+
683+ local ok, err = plugin.check_schema({
684+ provider = "openai",
685+ auth = { header = { apikey = "token" } },
686+ options = { model = "gpt-4" },
687+ logging = { summaries = true, payloads = false },
688+ })
689+
690+ if ok then
691+ ngx.say("ok")
692+ else
693+ ngx.say("bad:" .. (err or ""))
694+ end
695+ }
696+ }
697+ --- request
698+ GET /t
699+ --- response_body
700+ ok
You can’t perform that action at this time.
0 commit comments