Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/su-kaka/gcli2api
/ functions
Functions
693 in github.com/su-kaka/gcli2api
⨍
Functions
693
◇
Types & classes
71
↳
Endpoints
49
↓ 1 callers
Method
create_jwt
创建JWT令牌
src/google_oauth_api.py:275
↓ 1 callers
Function
create_router
创建并返回整合所有子路由的主路由器
src/panel/__init__.py:10
↓ 1 callers
Function
deduplicate_credentials_by_email_common
批量去重凭证文件的通用函数 - 删除邮箱相同的凭证(只保留一个)
src/panel/creds.py:445
↓ 1 callers
Method
delete_config
删除配置项
src/storage_adapter.py:70
↓ 1 callers
Function
displayLogs
()
front/common.js:2595
↓ 1 callers
Function
download_all_creds_common
打包下载所有凭证文件的通用函数
src/panel/creds.py:301
↓ 1 callers
Function
extract_json_files_from_zip
从ZIP文件中提取JSON文件
src/panel/creds.py:39
↓ 1 callers
Function
fake_stream_generator
()
src/router/antigravity/gemini.py:158
↓ 1 callers
Function
fake_stream_generator
()
src/router/antigravity/openai.py:153
↓ 1 callers
Function
fake_stream_generator
()
src/router/antigravity/anthropic.py:156
↓ 1 callers
Function
fake_stream_generator
()
src/router/geminicli/gemini.py:155
↓ 1 callers
Function
fake_stream_generator
()
src/router/geminicli/openai.py:153
↓ 1 callers
Function
fake_stream_generator
()
src/router/geminicli/anthropic.py:156
↓ 1 callers
Function
fetchAndDisplayVersion
()
front/common.js:3091
↓ 1 callers
Function
fetch_available_models
获取可用模型列表,返回符合 OpenAI API 规范的格式 Returns: 模型列表,格式为字典列表(用于兼容现有代码) Raises: 返回空列表如果获取失败
src/api/antigravity.py:828
↓ 1 callers
Function
fetch_quota_info
获取指定凭证的额度信息 Args: access_token: Antigravity 访问令牌 Returns: 包含额度信息的字典,格式为: { "success": T
src/api/antigravity.py:914
↓ 1 callers
Function
fetch_user_email_common
获取指定凭证文件用户邮箱的通用函数
src/panel/creds.py:343
↓ 1 callers
Function
filterLogs
()
front/common.js:2582
↓ 1 callers
Function
filter_invalid_thinking_blocks
过滤消息中的无效 thinking 块,并清理所有 thinking 块的额外字段(如 cache_control) Args: messages: Anthropic messages 列表 (会被修改)
src/converter/anthropic2gemini.py:128
↓ 1 callers
Function
find_available_port
动态查找可用端口
src/auth.py:152
↓ 1 callers
Function
fix_tool_call_args_types
根据工具的参数 schema 修正函数调用参数的类型 例如:将字符串 "5" 转换为数字 5,根据 schema 中的 type 定义 Args: args: 函数调用的参数字典 parameters_schema: 工具
src/converter/openai2gemini.py:753
↓ 1 callers
Function
formatFileSize
(bytes)
front/common.js:614
↓ 1 callers
Function
gemini_chunk_wrapper
()
src/router/antigravity/anthropic.py:299
↓ 1 callers
Function
gemini_chunk_wrapper
()
src/router/geminicli/anthropic.py:299
↓ 1 callers
Function
getFloat
(id, def = 0.0)
front/common.js:2786
↓ 1 callers
Method
get_all_config
获取所有配置(从内存缓存)
src/storage/psql_manager.py:861
↓ 1 callers
Method
get_all_credential_states
获取所有凭证状态
src/storage/psql_manager.py:552
↓ 1 callers
Function
get_antigravity_stream2nostream
Get use stream for non-stream setting. 控制antigravity非流式请求是否使用流式API并收集为完整响应。 启用后,非流式请求将在后端使用流式API,然后收集所有块后再返回完整响应。 Environment varia
config.py:340
↓ 1 callers
Function
get_api_password
Get API password setting for chat endpoints. Environment variable: API_PASSWORD Database config key: api_password Default: Uses PASS
config.py:233
↓ 1 callers
Function
get_auth_status
获取认证状态
src/auth.py:1028
↓ 1 callers
Method
get_auth_url
生成授权URL
src/google_oauth_api.py:188
↓ 1 callers
Function
get_auto_ban_enabled
Get auto ban enabled setting.
config.py:122
↓ 1 callers
Function
get_callback_port
获取OAuth回调端口
src/auth.py:40
↓ 1 callers
Method
get_config
获取配置项
src/storage_adapter.py:62
↓ 1 callers
Method
get_credential
获取凭证数据
src/storage_adapter.py:168
↓ 1 callers
Method
get_credential_errors
获取凭证的错误信息
src/storage/psql_manager.py:881
↓ 1 callers
Method
get_credential_state
获取凭证状态
src/storage/psql_manager.py:487
↓ 1 callers
Function
get_creds_status_common
获取凭证文件状态的通用函数
src/panel/creds.py:233
↓ 1 callers
Method
get_duplicate_credentials_by_email
获取按邮箱分组的重复凭证信息
src/storage/psql_manager.py:772
↓ 1 callers
Function
get_googleapis_proxy_url
Get Google APIs proxy URL setting. 用于Google APIs调用的代理URL。 Environment variable: GOOGLEAPIS_PROXY_URL Database config key: googleapi
config.py:393
↓ 1 callers
Function
get_keepalive_interval
Get keep-alive interval in seconds. 保活请求发送间隔(秒)。 Environment variable: KEEPALIVE_INTERVAL Database config key: keepalive_interval
config.py:479
↓ 1 callers
Function
get_keepalive_url
Get keep-alive URL setting. 配置后保活服务会定期向该URL发送GET请求。 留空表示禁用保活服务。 Environment variable: KEEPALIVE_URL Database config key: keepal
config.py:465
↓ 1 callers
Method
get_next_available_credential
随机获取一个可用凭证(负载均衡)
src/storage/psql_manager.py:245
↓ 1 callers
Function
get_proxy_config
Get proxy configuration.
config.py:116
↓ 1 callers
Function
get_resource_manager_api_url
Get Google Cloud Resource Manager API URL setting. 用于Google Cloud Resource Manager API的URL。 Environment variable: RESOURCE_MANAGER_API_
config.py:410
↓ 1 callers
Function
get_retry_429_enabled
Get 429 retry enabled setting.
config.py:164
↓ 1 callers
Function
get_retry_429_interval
Get 429 retry interval in seconds.
config.py:173
↓ 1 callers
Function
get_retry_429_max_retries
Get max retries for 429 errors.
config.py:152
↓ 1 callers
Function
get_return_thoughts_to_frontend
Get return thoughts to frontend setting. 控制是否将思维链返回到前端。 启用后,思维链会在响应中返回;禁用后,思维链会在响应中被过滤掉。 Environment variable: RETURN_THOUGHTS_TO_F
config.py:322
↓ 1 callers
Function
get_server_host
Get server host setting. Environment variable: HOST Database config key: host Default: 0.0.0.0
config.py:204
↓ 1 callers
Function
get_server_port
Get server port setting. Environment variable: PORT Database config key: port Default: 7861
config.py:215
↓ 1 callers
Function
get_service_usage_api_url
Get Google Cloud Service Usage API URL setting. 用于Google Cloud Service Usage API的URL。 Environment variable: SERVICE_USAGE_API_URL D
config.py:429
↓ 1 callers
Method
get_streaming_client
获取用于流式请求的HTTP客户端(无超时限制)
src/httpx_client.py:41
↓ 1 callers
Function
get_thinking_settings
根据模型名称获取思考配置 支持两种模式: 1. CLI 模式思考预算 (Gemini 2.5 系列): -max, -high, -medium, -low, -minimal 2. CLI 模式思考等级 (Gemini 3 Preview 系列): -high,
src/converter/gemini_fix.py:491
↓ 1 callers
Function
get_user_info
获取用户信息
src/google_oauth_api.py:332
↓ 1 callers
Function
handle_auto_ban
处理自动封禁:直接禁用凭证 Args: credential_manager: 凭证管理器实例 status_code: HTTP状态码 credential_name: 凭证名称 mode: 模式(gemi
src/api/utils.py:42
↓ 1 callers
Function
init_config
初始化配置缓存(启动时调用一次)
config.py:55
↓ 1 callers
Method
initialize
初始化存储适配器
src/storage_adapter.py:83
↓ 1 callers
Method
is_expired
检查token是否过期
src/google_oauth_api.py:267
↓ 1 callers
Function
is_mobile_user_agent
检测是否为移动设备用户代理
src/panel/utils.py:103
↓ 1 callers
Function
is_search_model
检查是否为搜索模型
src/converter/gemini_fix.py:567
↓ 1 callers
Function
linkifyText
(text)
front/common.js:550
↓ 1 callers
Method
list_credentials
列出所有凭证文件名
src/storage_adapter.py:36
↓ 1 callers
Method
list_credentials
列出所有凭证文件名(包括禁用的)
src/storage/psql_manager.py:400
↓ 1 callers
Function
listen_for_disconnect
()
src/panel/logs.py:149
↓ 1 callers
Function
login
()
front/common.js:833
↓ 1 callers
Function
main
主启动函数
web.py:168
↓ 1 callers
Function
main
主测试函数
src/api/geminicli.py:789
↓ 1 callers
Function
normal_stream_generator
()
src/router/antigravity/gemini.py:308
↓ 1 callers
Function
normal_stream_generator
()
src/router/antigravity/openai.py:308
↓ 1 callers
Function
normal_stream_generator
()
src/router/antigravity/anthropic.py:282
↓ 1 callers
Function
normal_stream_generator
()
src/router/geminicli/gemini.py:305
↓ 1 callers
Function
normal_stream_generator
()
src/router/geminicli/openai.py:308
↓ 1 callers
Function
normal_stream_generator
()
src/router/geminicli/anthropic.py:282
↓ 1 callers
Function
parse_quota_reset_timestamp
从Google API错误响应中提取quota重置时间戳 Args: error_response: Google API返回的错误响应字典 Returns: Unix时间戳(秒),如果无法解析则返回None 示例错误响应:
src/api/utils.py:447
↓ 1 callers
Function
populateConfigForm
()
front/common.js:2731
↓ 1 callers
Function
prepare_image_generation_request
图像生成模型请求体后处理 支持三种方式指定图片参数(优先级从高到低): 1. size 参数: 如 "1024x1536",自动计算 aspectRatio 和 imageSize 2. 模型名后缀: 如 -4k, -2k, -16x9, -1x1 3.
src/converter/gemini_fix.py:409
↓ 1 callers
Function
process_single_file
(file_data)
src/panel/creds.py:160
↓ 1 callers
Method
record_success
成功调用后的条件写入
src/storage/psql_manager.py:989
↓ 1 callers
Function
refresh_all_user_emails_common
刷新所有凭证文件用户邮箱的通用函数 - 只为没有邮箱的凭证获取 利用 get_all_credential_states 批量获取状态
src/panel/creds.py:377
↓ 1 callers
Function
refresh_credential_fast
()
src/api/geminicli.py:184
↓ 1 callers
Function
refresh_credential_fast
()
src/api/antigravity.py:358
↓ 1 callers
Method
register_resource
注册一个需要清理的资源(如HTTP客户端、文件句柄等)
src/task_manager.py:51
↓ 1 callers
Method
register_task
注册一个任务供生命周期管理
src/task_manager.py:35
↓ 1 callers
Method
reload_config_cache
重新加载配置缓存
src/storage/psql_manager.py:849
↓ 1 callers
Function
remove_trailing_unsigned_thinking
移除尾部的无签名 thinking 块 Args: blocks: content blocks 列表 (会被修改)
src/converter/anthropic2gemini.py:96
↓ 1 callers
Function
renderUsageList
()
front/common.js:2936
↓ 1 callers
Function
reorganize_tool_messages
重新组织消息,满足 tool_use/tool_result 约束。
src/converter/anthropic2gemini.py:536
↓ 1 callers
Method
restart
重启保活服务。 配置变更时调用,会停止旧任务并根据最新配置决定是否启动新任务。
src/keeplive.py:73
↓ 1 callers
Function
safe_get_nested
安全获取嵌套字典值 Args: obj: 字典对象 *keys: 嵌套键路径 default: 默认值 Returns: 获取到的值或默认值
src/converter/fake_stream.py:7
↓ 1 callers
Function
sanitize_thinking_block
清理 thinking 块,只保留必要字段(移除 cache_control 等) Args: block: content block 字典 Returns: 清理后的 block 字典
src/converter/anthropic2gemini.py:66
↓ 1 callers
Method
set_config
设置配置项
src/storage_adapter.py:58
↓ 1 callers
Method
set_config
设置配置(写入数据库 + 更新内存缓存)
src/storage/psql_manager.py:828
↓ 1 callers
Method
set_model_cooldown
设置特定模型的冷却时间
src/storage/psql_manager.py:909
↓ 1 callers
Function
shutdown_all_tasks
关闭所有任务的便捷函数
src/task_manager.py:141
↓ 1 callers
Function
startCooldownTimer
()
front/common.js:3019
↓ 1 callers
Method
store_credential
存储凭证数据
src/storage_adapter.py:163
↓ 1 callers
Function
stream_generator
()
src/router/vertex/gemini.py:63
↓ 1 callers
Function
stream_generator
()
src/router/vertex/openai.py:80
↓ 1 callers
Function
test_anti_truncation_stream_request
测试流式抗截断请求
src/router/antigravity/gemini.py:610
← previous
next →
301–400 of 693, ranked by callers