MCPcopy Create free account

hub / github.com/HisMax/RedInk / functions

Functions355 in github.com/HisMax/RedInk

↓ 1 callersFunction_is_unknown_response_format
(error_detail: str)
backend/generators/image_api_client.py:120
↓ 1 callersMethod_load_prompt_template
加载提示词模板
backend/services/content.py:96
↓ 1 callersMethod_load_prompt_template
(self)
backend/services/outline.py:89
↓ 1 callersFunction_load_provider_config
从配置文件加载服务商配置 Args: provider_type: 服务商类型 provider_name: 服务商名称 config: 当前配置(会被合并) Returns: dict: 合并后的配置
backend/routes/config_routes.py:265
↓ 1 callersMethod_load_text_config
加载文本生成配置
backend/services/content.py:29
↓ 1 callersMethod_load_text_config
加载文本生成配置
backend/services/outline.py:21
↓ 1 callersFunction_looks_like_fake_ip_tls
(text: str)
backend/errors.py:339
↓ 1 callersFunction_looks_like_network
(text: str)
backend/errors.py:353
↓ 1 callersFunction_looks_like_proxy_refused
(text: str)
backend/errors.py:330
↓ 1 callersFunction_looks_like_timeout
(text: str)
backend/errors.py:349
↓ 1 callersMethod_merge_safe_images
(self, current_images: Optional[Dict], incoming_images: Dict)
backend/services/history.py:380
↓ 1 callersFunction_non_negative_float
(value: Any, default: float)
backend/generators/image_provider_policy.py:85
↓ 1 callersFunction_normalize_base_url
(base_url: str)
backend/routes/config_routes.py:562
↓ 1 callersFunction_normalize_endpoint
(endpoint: str)
backend/routes/config_routes.py:569
↓ 1 callersFunction_parse_base64_images
解析 base64 编码的图片列表 Args: images_base64: base64 编码的图片字符串列表 Returns: list: 解码后的图片二进制数据列表
backend/routes/image_routes.py:428
↓ 1 callersMethod_parse_json_response
解析 AI 返回的 JSON 响应
backend/services/content.py:106
↓ 1 callersMethod_parse_outline
(self, outline_text: str)
backend/services/outline.py:98
↓ 1 callersFunction_parse_outline_request
解析大纲生成请求 支持两种格式: 1. multipart/form-data - 用于文件上传 2. application/json - 用于 base64 图片 返回: tuple: (topic, images) - 主题和图片列
backend/routes/outline_routes.py:89
↓ 1 callersFunction_parse_retry_after
(value: Optional[str])
backend/generators/image_api_client.py:125
↓ 1 callersFunction_positive_int
(value: Any, default: int)
backend/generators/image_provider_policy.py:77
↓ 1 callersMethod_protect_status
(self, current_status: Optional[str], incoming_status: str, record: Dict)
backend/services/history.py:402
↓ 1 callersFunction_sanitize_filename
清理文件名中的非法字符 Args: title: 原始标题 Returns: str: 安全的文件名
backend/routes/history_routes.py:492
↓ 1 callersMethod_save_image
保存图片到本地,同时生成缩略图 Args: image_data: 图片二进制数据 filename: 文件名 task_dir: 任务目录(如果为None则使用当前任务目录)
backend/services/image.py:106
↓ 1 callersFunction_should_retry_with_max_completion_tokens
(response)
backend/routes/config_routes.py:547
↓ 1 callersFunction_summarize_raw
(value: str, limit: int)
backend/errors.py:374
↓ 1 callersFunction_test_google_gemini
测试 Google Gemini 文本生成服务
backend/routes/config_routes.py:373
↓ 1 callersFunction_test_google_genai
测试 Google GenAI 图片生成服务
backend/routes/config_routes.py:344
↓ 1 callersFunction_test_image_api
测试图片 API 连接
backend/routes/config_routes.py:408
↓ 1 callersFunction_test_openai_compatible
测试 OpenAI 兼容接口
backend/routes/config_routes.py:402
↓ 1 callersFunction_test_provider_connection
测试服务商连接 Args: provider_type: 服务商类型 config: 服务商配置 Returns: dict: 测试结果
backend/routes/config_routes.py:302
↓ 1 callersFunction_validate_config_on_startup
启动时验证配置
backend/app.py:99
↓ 1 callersFunction_write_config
写入配置文件
backend/routes/config_routes.py:206
↓ 1 callersMethodacquire
(self)
backend/services/image_rate_limiter.py:18
↓ 1 callersFunctioncloseImageModal
* 关闭图片服务商弹窗
frontend/src/composables/useProviderForm.ts:401
↓ 1 callersFunctioncloseTextModal
* 关闭文本服务商弹窗
frontend/src/composables/useProviderForm.ts:245
↓ 1 callersMethodcreate
创建图片生成器实例 Args: provider: 服务商类型 ('google_genai', 'openai', 'openai_compatible') config: 配置字典 Return
backend/generators/factory.py:21
↓ 1 callersFunctioncreateHistory
( topic: string, outline: { raw: string; pages: Page[] }, taskId?: string )
frontend/src/api/history.ts:14
↓ 1 callersFunctioncreate_api_blueprint
创建并配置主 API 蓝图 每次调用都会创建新的蓝图实例,支持多次 create_app() 调用(如测试环境) Returns: 配置好的 api Blueprint
backend/routes/__init__.py:17
↓ 1 callersFunctioncreate_config_blueprint
创建配置路由蓝图(工厂函数,支持多次调用)
backend/routes/config_routes.py:35
↓ 1 callersFunctioncreate_content_blueprint
创建内容生成路由蓝图(工厂函数,支持多次调用)
backend/routes/content_routes.py:23
↓ 1 callersFunctioncreate_history_blueprint
创建历史记录路由蓝图(工厂函数,支持多次调用)
backend/routes/history_routes.py:23
↓ 1 callersFunctioncreate_image_blueprint
创建图片路由蓝图(工厂函数,支持多次调用)
backend/routes/image_routes.py:30
↓ 1 callersFunctioncreate_outline_blueprint
创建大纲路由蓝图(工厂函数,支持多次调用)
backend/routes/outline_routes.py:24
↓ 1 callersMethoddelete_record
删除历史记录 会同时删除: 1. 记录 JSON 文件 2. 关联的任务图片目录 3. 索引中的记录 Args: record_id: 记录 ID Retu
backend/services/history.py:412
↓ 1 callersFunctionensureRecord
()
frontend/src/composables/useGenerationRestore.ts:56
↓ 1 callersMethodextract_from_chat_response
(self, result: Dict[str, Any])
backend/generators/image_response_extractor.py:42
↓ 1 callersFunctiongenerateImagesPost
( pages: Page[], taskId: string | null, fullOutline: string, onProgress: (event: ProgressEvent) => voi
frontend/src/api/image.ts:78
↓ 1 callersMethodgenerate_images
生成图片(生成器,支持 SSE 流式返回) 优化版本:先生成封面,然后并发生成其他页面 Args: pages: 页面列表 task_id: 任务 ID(可选) full_ou
backend/services/image.py:247
↓ 1 callersMethodgenerate_outline
( self, topic: str, images: Optional[List[bytes]] = None )
backend/services/outline.py:132
↓ 1 callersFunctiongetConfig
()
frontend/src/api/config.ts:6
↓ 1 callersFunctiongetHistory
(recordId: string)
frontend/src/api/history.ts:73
↓ 1 callersFunctiongetImageUrl
(taskId: string, filename: string, thumbnail: boolean = true)
frontend/src/api/image.ts:14
↓ 1 callersFunctionget_content_service
获取内容生成服务实例 每次调用都创建新实例以确保配置是最新的
backend/services/content.py:245
↓ 1 callersMethodget_image_provider_config
(cls, provider_name: str = None)
backend/config.py:93
↓ 1 callersFunctionget_outline_service
获取大纲生成服务实例 每次调用都创建新实例以确保配置是最新的
backend/services/outline.py:233
↓ 1 callersMethodget_statistics
获取历史记录统计信息 Returns: Dict: 统计数据 - total: 总记录数 - by_status: 各状态的记录数 -
backend/services/history.py:522
↓ 1 callersMethodget_task_state
获取任务状态
backend/services/image.py:898
↓ 1 callersFunctionhasGeneratedImages
(record: HistoryDetail)
frontend/src/composables/useGenerationRestore.ts:12
↓ 1 callersFunctionhydrateFromHistory
(record: HistoryDetail)
frontend/src/composables/useGenerationRestore.ts:16
↓ 1 callersFunctioninferRetryable
(message: string)
frontend/src/utils/errors.ts:148
↓ 1 callersFunctioninferSuggestion
(message: string)
frontend/src/utils/errors.ts:132
↓ 1 callersFunctioninferTitle
(message: string, fallbackTitle: string)
frontend/src/utils/errors.ts:116
↓ 1 callersMethodlist_records
分页获取历史记录列表 Args: page: 页码,从 1 开始 page_size: 每页记录数 status: 状态过滤(可选),支持:draft/generating/partial/c
backend/services/history.py:457
↓ 1 callersFunctionloadConfig
* 加载配置
frontend/src/composables/useProviderForm.ts:145
↓ 1 callersFunctionloadState
()
frontend/src/stores/generator.ts:86
↓ 1 callersFunctionmask_api_key
遮盖 API Key,只显示前4位和后4位 Args: key: 原始 API Key Returns: str: 遮盖后的 API Key
backend/routes/utils.py:100
↓ 1 callersMethodmerge_generated
( existing: Optional[List[str]], page_index: int, filename: str, total_count:
backend/services/history_image_merger.py:14
↓ 1 callersMethodnormalize_endpoint
(endpoint_type: str)
backend/generators/image_provider_policy.py:67
↓ 1 callersMethodrecord_exists
检查历史记录是否存在 Args: record_id: 记录 ID Returns: bool: 记录是否存在
backend/services/history.py:194
↓ 1 callersMethodregenerate_image
重新生成图片(用户手动触发,即使成功的也可以重新生成) Args: task_id: 任务ID page: 页面数据 use_reference: 是否使用封面作为参考
backend/services/image.py:855
↓ 1 callersFunctionregister_routes
注册所有 API 路由到 Flask 应用 Args: app: Flask 应用实例
backend/routes/__init__.py:45
↓ 1 callersFunctionreset_image_service
重置全局服务实例(配置更新后调用)
backend/services/image.py:918
↓ 1 callersFunctionrestoreFromHistory
()
frontend/src/composables/useGenerationRestore.ts:44
↓ 1 callersFunctionretrySingleImage
(index: number)
frontend/src/composables/useImageRetry.ts:24
↓ 1 callersFunctionsaveState
(state: GeneratorState)
frontend/src/stores/generator.ts:99
↓ 1 callersMethodscan_all_tasks
扫描所有任务文件夹,同步图片列表 批量扫描 history 目录下的所有任务文件夹, 同步图片列表并更新记录状态。 Returns: Dict[str, Any]: 扫描结果统计
backend/services/history.py:644
↓ 1 callersMethodsearch_records
根据关键词搜索历史记录 Args: keyword: 搜索关键词(不区分大小写) Returns: List[Dict]: 匹配的记录列表(按创建时间倒序)
backend/services/history.py:500
↓ 1 callersFunctionsetup_logging
配置日志系统
backend/app.py:10
↓ 1 callersMethodsync_record_images
从任务目录扫描图片并合并回历史记录。
backend/services/history.py:330
↓ 1 callersFunctionupdateConfig
(config: Partial<Config>)
frontend/src/api/config.ts:16
↓ 1 callersFunctionuseGenerationRestore
()
frontend/src/composables/useGenerationRestore.ts:9
↓ 1 callersMethodvalidate_config
验证配置是否有效
backend/generators/image_api.py:33
Method__init__
(self, api_key: str = None, base_url: str = None)
backend/utils/genai_client.py:67
Method__init__
(self, api_key: str = None, base_url: str = None, endpoint_type: str = None)
backend/utils/text_client.py:43
Method__init__
初始化图片生成服务 Args: provider_name: 服务商名称,如果为None则使用配置文件中的激活服务商
backend/services/image.py:24
Method__init__
初始化历史记录服务 创建历史记录存储目录和索引文件
backend/services/history.py:32
Method__init__
(self)
backend/services/content.py:22
Method__init__
(self, max_concurrent: int = 1, interval_seconds: float = 3.0)
backend/services/image_rate_limiter.py:10
Method__init__
(self)
backend/services/outline.py:14
Method__init__
(self, download_image: Callable[[str], bytes])
backend/generators/image_response_extractor.py:13
Method__init__
(self, config: Dict[str, Any])
backend/generators/openai_compatible.py:14
Method__init__
(self, config: Dict[str, Any])
backend/generators/google_genai.py:282
Method__init__
初始化生成器 Args: config: 配置字典
backend/generators/base.py:9
Method__init__
(self, config: Dict[str, Any])
backend/generators/image_api.py:16
Method__init__
( self, policy: ImageProviderPolicy, session: Optional[requests.Session] = None,
backend/generators/image_api_client.py:18
Method__init__
(self, status_code=200, payload=None, text="", content=b"")
tests/image_api_client_test.py:9
Method__init__
(self, responses=None, get_response=None)
tests/image_api_client_test.py:21
FunctionactivateImageProvider
* 激活图片服务商
frontend/src/composables/useProviderForm.ts:364
FunctionactivateTextProvider
* 激活文本服务商
frontend/src/composables/useProviderForm.ts:210
FunctionaddPage
* 在列表末尾添加新页面 * @param type 页面类型:cover-封面, content-内容, summary-总结 * @param content 页面内容,默认为空
frontend/src/stores/generator.ts:235
← previousnext →101–200 of 355, ranked by callers