membphis commented on code in PR #12933:
URL: https://github.com/apache/apisix/pull/12933#discussion_r2720387004
##########
apisix/plugins/ai-drivers/openai-base.lua:
##########
@@ -189,7 +206,42 @@ local function read_response(ctx, res)
ctx.var.llm_response_text = content_to_check
end
end
- plugin.lua_response_filter(ctx, res.headers, raw_res_body)
+ plugin.lua_response_filter(ctx, headers, raw_res_body)
+end
+
+
+local gcp_access_token_cache = lrucache.new(1024 * 4)
+
+local function fetch_gcp_access_token(ctx, name, gcp_conf)
+ local key = core.lrucache.plugin_ctx_id(ctx, name)
+ local access_token = gcp_access_token_cache:get(key)
+ if not access_token then
Review Comment:
another style:
```
if access_token then
return access_token
end
-- generate access token
... ...
--
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]