nic-6443 commented on code in PR #13249:
URL: https://github.com/apache/apisix/pull/13249#discussion_r3128813902
##########
apisix/plugins/ai-proxy/schema.lua:
##########
@@ -348,7 +359,42 @@ _M.ai_proxy_multi_schema = {
"instances.auth.header",
"instances.auth.query",
"instances.auth.gcp.service_account_json",
+ "instances.auth.aws.secret_access_key",
+ "instances.auth.aws.session_token",
},
}
+function _M.validate_provider_requirements(conf)
+ local provider = conf.provider
+ local has_override = conf.override and conf.override.endpoint
+
+ if provider == "vertex-ai" then
+ local pc = conf.provider_conf
+ local has_provider_conf = pc and pc.project_id and pc.region
+ if not has_provider_conf and not has_override then
+ return false, "vertex-ai requires either provider_conf "
+ .. "(project_id + region) or override.endpoint"
+ end
+ end
+
+ if provider == "bedrock" then
+ if not (conf.provider_conf and conf.provider_conf.region) then
+ return false, "bedrock requires provider_conf.region"
+ end
+ if not (conf.auth and conf.auth.aws) then
+ return false, "bedrock requires auth.aws"
+ end
+ if not has_override then
+ local has_model = conf.options and conf.options.model
+ if not has_model then
+ return false, "bedrock requires options.model when "
+ .. "override.endpoint is not set"
+ end
+ end
Review Comment:
In this case, users need to configure a separate plugin for each model
supported by bedrock, which feels extremely inconvenient to use. We need to
investigate how other AI gateways handle this situation. For example,
downstream requests should be allowed to specify the model in a certain way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]