mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 04:20:50 +08:00
- Introduced request and response translation functions to enable compatibility between OpenAI Chat Completions API and Antigravity. - Registered translation utilities for both streaming and non-streaming scenarios. - Added support for reasoning content, tool calls, and metadata handling. - Established request normalization and embedding for Antigravity-compatible payloads. - Added new fields to `Params` struct for better tracking of finish reasons, usage metadata, and tool usage. - Refactored handling of response transitions, final events, and state-driven logic in `ConvertAntigravityResponseToClaude`. - Introduced `appendFinalEvents` and `resolveStopReason` helper functions for cleaner separation of concerns. - Added `TotalTokenCount` field to `Params` struct for enhanced token tracking. - Updated token count calculations to fallback on `TotalTokenCount` when specific counts are missing. - Introduced `hasNonZeroUsageMetadata` function to validate presence of token data in `usage_metadata`.
28 lines
865 B
Go
28 lines
865 B
Go
// Package constant defines provider name constants used throughout the CLI Proxy API.
|
|
// These constants identify different AI service providers and their variants,
|
|
// ensuring consistent naming across the application.
|
|
package constant
|
|
|
|
const (
|
|
// Gemini represents the Google Gemini provider identifier.
|
|
Gemini = "gemini"
|
|
|
|
// GeminiCLI represents the Google Gemini CLI provider identifier.
|
|
GeminiCLI = "gemini-cli"
|
|
|
|
// Codex represents the OpenAI Codex provider identifier.
|
|
Codex = "codex"
|
|
|
|
// Claude represents the Anthropic Claude provider identifier.
|
|
Claude = "claude"
|
|
|
|
// OpenAI represents the OpenAI provider identifier.
|
|
OpenAI = "openai"
|
|
|
|
// OpenaiResponse represents the OpenAI response format identifier.
|
|
OpenaiResponse = "openai-response"
|
|
|
|
// Antigravity represents the Antigravity response format identifier.
|
|
Antigravity = "antigravity"
|
|
)
|