AlinsRan commented on code in PR #14044:
URL: https://github.com/apache/apisix/pull/14044#discussion_r4375153161
##########
apisix/plugins/ai-protocols/bedrock-converse.lua:
##########
@@ -30,6 +30,31 @@ local table = table
local _M = {}
+local function cache_token_count(raw, key, alias)
Review Comment:
I checked the existing protocol adapters. There are similar fallback
patterns, but they involve nested fields or handle zero values differently, so
they cannot directly reuse this helper.
It is already shared by the two Bedrock cache-token counters, and giving it
a more generic name would not provide an immediate reuse benefit. I'd prefer to
keep `cache_token_count` for now and generalize it when another caller needs
the same behavior.
--
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]