feat(config): 新增 Gemini 配置项和 geminicli 核心包
- 添加 Gemini OAuth 配置结构 - 实现 geminicli 包(OAuth、Token、CodeAssist 类型) - 更新配置示例文件
This commit is contained in:
20
backend/internal/pkg/geminicli/constants.go
Normal file
20
backend/internal/pkg/geminicli/constants.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package geminicli
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
AIStudioBaseURL = "https://generativelanguage.googleapis.com"
|
||||
GeminiCliBaseURL = "https://cloudcode-pa.googleapis.com"
|
||||
|
||||
AuthorizeURL = "https://accounts.google.com/o/oauth2/v2/auth"
|
||||
TokenURL = "https://oauth2.googleapis.com/token"
|
||||
|
||||
// DefaultScopes is the minimal scope set for GeminiCli/CodeAssist usage.
|
||||
// Keep this conservative and expand only when we have a clear requirement.
|
||||
DefaultScopes = "https://www.googleapis.com/auth/cloud-platform"
|
||||
|
||||
SessionTTL = 30 * time.Minute
|
||||
|
||||
// GeminiCLIUserAgent mimics Gemini CLI to maximize compatibility with internal endpoints.
|
||||
GeminiCLIUserAgent = "GeminiCLI/0.1.5 (Windows; AMD64)"
|
||||
)
|
||||
Reference in New Issue
Block a user