feat(interactions): add support for Google Interactions

- 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.
This commit is contained in:
Luis Pater
2026-07-05 20:20:23 +08:00
parent 4a2a3b29a8
commit 8b9c4da245
85 changed files with 15732 additions and 149 deletions

View File

@@ -12,6 +12,7 @@ import (
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/claude"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/codex"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/gemini"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/interactions"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/kimi"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/openai"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking/provider/xai"
@@ -2363,6 +2364,30 @@ func TestThinkingE2ENewProviderTargets(t *testing.T) {
expectField: "reasoning.effort",
expectValue: "high",
},
// Interactions target: native API uses generation_config.thinking_level and thinking_summaries.
{
name: "I1",
from: "interactions",
to: "interactions",
model: "gemini-zero-mixed-model",
inputJSON: `{"model":"gemini-zero-mixed-model","generation_config":{"thinking_level":"high","thinking_summaries":"auto"},"input":"hi"}`,
expectField: "generation_config.thinking_level",
expectValue: "high",
expectField2: "generation_config.thinking_summaries",
expectValue2: "auto",
},
{
name: "I2",
from: "interactions",
to: "interactions",
model: "gemini-zero-mixed-model(8192)",
inputJSON: `{"model":"gemini-zero-mixed-model(8192)","input":"hi"}`,
expectField: "generation_config.thinking_level",
expectValue: "medium",
expectField2: "generation_config.thinking_summaries",
expectValue2: "auto",
},
}
runThinkingTests(t, cases)