MCPcopy Create free account

hub / github.com/su-kaka/gcli2api / functions

Functions693 in github.com/su-kaka/gcli2api

↓ 3 callersMethod_check_done_marker_in_text
检测文本中是否包含DONE_MARKER(只检测指定标记)
src/converter/anti_truncation.py:543
↓ 3 callersFunction_close_log_file
()
log.py:62
↓ 3 callersFunction_convert_usage_metadata
将Gemini的usageMetadata转换为OpenAI格式的usage字段 Args: usage_metadata: Gemini API的usageMetadata字段 Returns: OpenAI格式的usage字典,如果没
src/converter/openai2gemini.py:23
↓ 3 callersMethod_get_collected_text
获取收集的文本内容
src/converter/anti_truncation.py:202
↓ 3 callersFunction_map_finish_reason
将Gemini结束原因映射到OpenAI结束原因 Args: gemini_reason: 来自Gemini API的结束原因 Returns: OpenAI兼容的结束原因
src/converter/openai2gemini.py:75
↓ 3 callersFunction_open_log_file
(mode: str = "a")
log.py:74
↓ 3 callersFunction_resolve_ref
解析 $ref 或 ref 引用 Args: ref: 引用路径,如 "#/definitions/MyType" 或 "#/$defs/MyType" root_schema: 根 schema 对象 Retur
src/converter/openai2gemini.py:164
↓ 3 callersFunction_switch_credential_for_retry
优先使用预热凭证,失败后退回同步刷新。
src/api/geminicli.py:90
↓ 3 callersFunction_usage_payload
()
src/converter/anthropic2gemini.py:977
↓ 3 callersFunctionclearLogsDisplay
()
front/common.js:2525
↓ 3 callersMethodclose
手动关闭(优雅退出用)
log.py:296
↓ 3 callersFunctionconvert_openai_to_gemini_request
将 OpenAI 格式请求体转换为 Gemini 格式请求体 注意: 此函数只负责基础转换,不包含 normalize_gemini_request 中的处理 (如 thinking config, search tools, 参数范围限制等) Args:
src/converter/openai2gemini.py:1171
↓ 3 callersFunctioncreate_gemini_model_list
创建Gemini格式的模型列表 Args: model_ids: 模型ID列表 base_name_extractor: 可选的基础模型名提取函数 Returns: 包含模型列表的字典
src/router/base_router.py:40
↓ 3 callersFunctioncreate_openai_model_list
创建OpenAI格式的模型列表 Args: model_ids: 模型ID列表 owned_by: 模型所有者 Returns: ModelList对象
src/router/base_router.py:10
↓ 3 callersMethoddisconnect
(self, websocket: WebSocket)
src/panel/utils.py:44
↓ 3 callersMethodexchange_code
用授权码换取token
src/google_oauth_api.py:206
↓ 3 callersFunctionfetch_project_id_and_tier
从 API 获取 project_id 和订阅等级 Args: access_token: Google OAuth access token user_agent: User-Agent header api_base_url:
src/google_oauth_api.py:534
↓ 3 callersFunctionfetch_recaptcha_token
获取 reCAPTCHA token,最多重试 3 次。
src/api/vertex.py:241
↓ 3 callersMethodget_all_config
获取所有配置
src/storage_adapter.py:66
↓ 3 callersFunctionget_base_model_name
移除模型名称中的后缀,返回基础模型名
src/converter/gemini_fix.py:470
↓ 3 callersFunctionget_code_assist_endpoint
Get Code Assist endpoint setting. Environment variable: CODE_ASSIST_ENDPOINT Database config key: code_assist_endpoint Default: http
config.py:289
↓ 3 callersFunctionhighlightHttpLinks
(text)
front/common.js:2103
↓ 3 callersMethodis_expired
检查token是否过期
src/google_oauth_api.py:53
↓ 3 callersMethodremove_credential
删除一个凭证
src/credential_manager.py:122
↓ 3 callersFunctionselect_default_project
从项目列表中选择默认项目
src/google_oauth_api.py:510
↓ 3 callersFunctionupdateTabSlider
(targetTab, animate = true)
front/common.js:917
↓ 2 callersFunction_accumulate_parts
从单个数据对象中提取 parts 并追加到 all_parts。
src/api/vertex.py:1011
↓ 2 callersMethod_append_content
追加内容到收集器
src/converter/anti_truncation.py:206
↓ 2 callersFunction_batch_graphql_headers
()
src/api/vertex.py:135
↓ 2 callersMethod_build_current_payload
构建当前请求的payload
src/converter/anti_truncation.py:387
↓ 2 callersFunction_build_request_payload
构建发往上游的完整 batchGraphql 请求体。
src/api/vertex.py:387
↓ 2 callersFunction_clean_schema_for_parameters_json_schema
清理 JSON Schema,供 Gemini CLI 内部接口的 parametersJsonSchema 使用。 Code Assist 的内部接口更接近官方 Gemini CLI:工具参数应放在 parametersJsonSchema 中,并保持 JSON Sch
src/converter/openai2gemini.py:575
↓ 2 callersFunction_extract_chunk
从单个数据对象提取标准化 Gemini chunk。
src/api/vertex.py:554
↓ 2 callersFunction_extract_first_user_text
(request_payload: Dict[str, Any])
src/api/antigravity.py:89
↓ 2 callersMethod_get_or_create
获取或创建单例实例(线程安全)
src/credential_manager.py:488
↓ 2 callersFunction_is_quota_error
(text: str)
src/api/vertex.py:414
↓ 2 callersFunction_is_retryable_status
统一判断是否属于可重试状态码。
src/api/geminicli.py:85
↓ 2 callersFunction_is_retryable_status
统一判断是否属于可重试状态码。
src/api/antigravity.py:254
↓ 2 callersMethod_load_config_cache
加载配置到内存缓存(仅在初始化时调用一次)
src/storage/sqlite_manager.py:331
↓ 2 callersMethod_load_config_cache
加载配置到内存缓存
src/storage/psql_manager.py:201
↓ 2 callersMethod_load_config_cache
加载配置到内存缓存(仅在初始化时调用一次)
src/storage/mongodb_manager.py:149
↓ 2 callersMethod_load_config_to_redis
将所有配置从 MongoDB 同步到 Redis Hash
src/storage/mongodb_manager.py:1203
↓ 2 callersFunction_make_new_state
(first_user_text: str, now: float)
src/api/antigravity.py:129
↓ 2 callersFunction_parse_json_objects
从上游响应文本中花括号配对扫描提取所有 JSON 对象。 yield (dict, end_pos) — end_pos 是该对象在 raw_text 中结束后的位置。
src/api/vertex.py:418
↓ 2 callersMethod_rebuild_redis_cache
从 MongoDB 重建指定 mode 的 Redis 凭证池缓存。 使用临时 key + RENAME 原子替换
src/storage/mongodb_manager.py:221
↓ 2 callersMethod_redis_remove_cred
从 Redis 所有池中移除凭证
src/storage/mongodb_manager.py:350
↓ 2 callersMethod_redis_sync_cred
根据最新状态同步单个凭证在 Redis 中的集合成员
src/storage/mongodb_manager.py:368
↓ 2 callersFunction_remove_nulls_for_tool_input
递归移除 dict/list 中值为 null/None 的字段/元素。 背景:Roo/Kilo 在 Anthropic native tool 路径下,若收到 tool_use.input 中包含 null, 可能会把 null 当作真实入参执行(例如"在 null 中
src/converter/anthropic2gemini.py:238
↓ 2 callersFunction_switch_credential_for_retry
优先使用预热凭证,失败后退回同步刷新。
src/api/antigravity.py:259
↓ 2 callersFunction_xhr_headers
(content_type: str, accept: str, origin: str, referer: str, site: str)
src/api/vertex.py:106
↓ 2 callersFunctionanthropic_to_gemini_request
将 Anthropic 格式请求体转换为 Gemini 格式请求体 注意: 此函数只负责基础转换,不包含 normalize_gemini_request 中的处理 (如 thinking config 自动设置、search tools、参数范围限制等) Ar
src/converter/anthropic2gemini.py:710
↓ 2 callersFunctionbuild_anthropic_fake_stream_chunks
构建 Anthropic 格式的假流式响应数据块 Args: content: 主要内容 reasoning_content: 推理内容(thinking content) finish_reason: 结束原因(如 "STOP", "MAX
src/converter/fake_stream.py:356
↓ 2 callersFunctionbuild_gemini_fake_stream_chunks
构建假流式响应的数据块 Args: content: 主要内容 reasoning_content: 推理内容 finish_reason: 结束原因 images: 图片数据列表(可选) chunk_size
src/converter/fake_stream.py:162
↓ 2 callersFunctionbuild_openai_fake_stream_chunks
构建 OpenAI 格式的假流式响应数据块 Args: content: 主要内容 reasoning_content: 推理内容 finish_reason: 结束原因(如 "STOP", "MAX_TOKENS") mod
src/converter/fake_stream.py:242
↓ 2 callersFunctioncheckEnvCredsStatus
()
front/common.js:2608
↓ 2 callersFunctioncleanup_expired_flows
清理过期的认证流程
src/auth.py:986
↓ 2 callersFunctioncreateCredsManager
(type)
front/common.js:46
↓ 2 callersFunctioncreateUploadManager
(type)
front/common.js:365
↓ 2 callersMethoddelete_credential
删除凭证
src/storage_adapter.py:40
↓ 2 callersFunctionestimate_input_tokens
粗略估算 token 数:字符数 / 4 + 图片固定值
src/token_estimator.py:7
↓ 2 callersFunctionextract_content_and_reasoning
从Gemini响应部件中提取内容和推理内容 Args: parts: Gemini 响应中的 parts 列表 Returns: (content, reasoning_content, images): 文本内容、推理内容和图片数据的元组
src/converter/utils.py:9
↓ 2 callersFunctionextract_tool_calls_from_parts
从 Gemini response parts 中提取工具调用和文本内容 Args: parts: Gemini response 的 parts 数组 is_streaming: 是否为流式响应(流式响应需要添加 index 字段) R
src/converter/openai2gemini.py:1050
↓ 2 callersFunctionflush_pending_tool_parts
将累积的 tool parts 作为单个 contents 条目追加
src/converter/openai2gemini.py:1225
↓ 2 callersFunctionformatCooldownTime
(remainingSeconds)
front/common.js:620
↓ 2 callersMethodget_all_credential_states
获取所有凭证状态
src/storage_adapter.py:53
↓ 2 callersFunctionget_antigravity_models_with_features
获取 Antigravity 模型列表并添加功能前缀 Returns: 带有功能前缀的模型列表
src/router/antigravity/model_list.py:40
↓ 2 callersFunctionget_available_models
Get available models with feature prefixes. Args: router_type: "openai" or "gemini" Returns: List of model names with f
src/utils.py:89
↓ 2 callersMethodget_backend_info
获取存储后端信息
src/storage_adapter.py:283
↓ 2 callersMethodget_backend_type
获取当前存储后端类型
src/storage_adapter.py:267
↓ 2 callersMethodget_client
获取配置好的异步HTTP客户端
src/httpx_client.py:31
↓ 2 callersMethodget_client_kwargs
获取httpx客户端的通用配置参数
src/httpx_client.py:19
↓ 2 callersFunctionget_compatibility_mode_enabled
Get compatibility mode setting. 兼容性模式:启用后所有system消息全部转换成user,停用system_instructions。 该选项可能会降低模型理解能力,但是能避免流式空回的情况。 Environment variab
config.py:304
↓ 2 callersMethodget_credential
获取凭证数据
src/storage_adapter.py:32
↓ 2 callersMethodget_credential
获取凭证数据
src/storage/mongodb_manager.py:683
↓ 2 callersMethodget_credential_state
获取凭证状态
src/storage_adapter.py:49
↓ 2 callersMethodget_credential_state
获取凭证状态(不包含error_messages)
src/storage/mongodb_manager.py:905
↓ 2 callersMethodget_credentials_summary
获取凭证的摘要信息,支持分页和状态筛选
src/storage/psql_manager.py:612
↓ 2 callersFunctionget_env_locked_keys
获取被环境变量锁定的配置键集合
src/panel/utils.py:157
↓ 2 callersFunctionget_geminicli_user_agent
生成动态 User-Agent: GeminiCLI/{version}/{model} ({platform}; {arch}; {surface})
src/utils.py:18
↓ 2 callersMethodget_or_fetch_user_email
获取或获取用户邮箱地址
src/credential_manager.py:193
↓ 2 callersFunctionget_panel_password
Get panel password setting for web interface. Environment variable: PANEL_PASSWORD Database config key: panel_password Default: Uses
config.py:250
↓ 2 callersFunctionget_user_email
获取用户邮箱地址
src/google_oauth_api.py:349
↓ 2 callersFunctionhas_valid_thoughtsignature
检查 thinking 块是否有有效签名 Args: block: content block 字典 Returns: bool: 是否有有效签名
src/converter/anthropic2gemini.py:35
↓ 2 callersFunctioninitTabSlider
()
front/common.js:945
↓ 2 callersMethodinitialize
初始化凭证管理器
src/credential_manager.py:34
↓ 2 callersFunctionis_thinking_model
检查是否为思考模型 (包含 -thinking 或 pro)
src/converter/gemini_fix.py:574
↓ 2 callersFunctionloadConfig
()
front/common.js:2703
↓ 2 callersFunctionmerge_system_messages
根据兼容性模式处理请求体中的system消息 - 兼容性模式关闭(False):将连续的system消息合并为systemInstruction - 兼容性模式开启(True):将所有system消息转换为user消息 Args: request
src/converter/utils.py:60
↓ 2 callersFunctionnon_stream_request
非流式请求入口。读取完整响应后解析为 Gemini generateContent 格式。 body 格式: {"model": str, "request": {...gemini payload...}}
src/api/vertex.py:790
↓ 2 callersFunctionprepare_request_headers_and_payload
从凭证数据准备请求头和最终payload Args: payload: 原始请求payload credential_data: 凭证数据字典 target_url: 目标URL Returns:
src/api/geminicli.py:44
↓ 2 callersFunctionrefreshUsageStats
()
front/common.js:2892
↓ 2 callersMethodshutdown
关闭所有任务和资源
src/task_manager.py:58
↓ 2 callersMethodstop
停止保活服务
src/keeplive.py:62
↓ 2 callersFunctionstream_post_async
流式异步POST请求
src/httpx_client.py:88
↓ 2 callersFunctionstream_request
流式请求入口。 body 格式: {"model": str, "request": {...gemini payload...}} Yields: Response 对象(错误时)或 str/bytes(SSE 格式数据)
src/api/vertex.py:595
↓ 2 callersFunctiontoggleCredDetailsCommon
(pathId, manager)
front/common.js:796
↓ 2 callersFunctiontoggleErrorDetailsCommon
(pathId, manager)
front/common.js:1946
↓ 2 callersFunctiontriggerTabDataLoad
(tabName)
front/common.js:1036
↓ 2 callersFunctionupdateEmailDisplay
(filename, email, managerType = 'normal')
front/common.js:1539
↓ 2 callersMethodupdate_credential_state
更新凭证状态
src/storage_adapter.py:45
← previousnext →101–200 of 693, ranked by callers