mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-07 00:24:17 +08:00
- Introduced API handlers and executor logic for Google Interactions - Added request and response transformations for OpenAI and Claude Interactions. - Integrated Gemini API with Interactions support. - Updated tests to validate Interactions request parsing and error handling. - Refactored translator logic for Interactions data flows.
20 lines
390 B
Go
20 lines
390 B
Go
package common
|
|
|
|
import "github.com/tidwall/gjson"
|
|
|
|
func InteractionsUsage(root gjson.Result) gjson.Result {
|
|
for _, path := range []string{
|
|
"interaction.usage",
|
|
"usage",
|
|
"metadata.total_usage",
|
|
"metadata.usage",
|
|
"interaction.metadata.total_usage",
|
|
"interaction.metadata.usage",
|
|
} {
|
|
if value := root.Get(path); value.Exists() {
|
|
return value
|
|
}
|
|
}
|
|
return gjson.Result{}
|
|
}
|