MCPcopy Create free account

hub / github.com/HisMax/RedInk / functions

Functions355 in github.com/HisMax/RedInk

Functionapp
创建测试用 Flask 应用
tests/conftest.py:15
FunctioncheckHistoryExists
(recordId: string)
frontend/src/api/history.ts:107
Functioncheck_history_exists
检查历史记录是否存在 用于前端在开始生成前检查草稿记录是否已创建。 路径参数: - record_id: 记录 ID 返回: - exists: 记录是否存在(boolean)
backend/routes/history_routes.py:149
FunctioncleanupGenerationRunner
()
frontend/src/composables/useGenerationRunner.ts:75
Methodcleanup_task
清理任务状态(释放内存)
backend/services/image.py:902
FunctionclearContent
* 清除生成的内容数据 * 重置为初始状态
frontend/src/stores/generator.ts:482
FunctionclearFeedback
()
frontend/src/composables/useProviderForm.ts:201
Functionclient
创建测试客户端
tests/conftest.py:24
Functioncompress_images
批量压缩图片 Args: images: 图片数据列表 max_size_kb: 最大文件大小(KB) Returns: 压缩后的图片数据列表
backend/utils/image_compressor.py:94
Functioncreate_history
创建历史记录(草稿) 在用户生成大纲后立即调用,创建一个草稿状态的历史记录。 初始状态为 draft,表示大纲已创建但尚未开始生成图片。 请求体: - topic: 主题标题(必填) - outli
backend/routes/history_routes.py:30
Functiondecorator
(func)
backend/utils/genai_client.py:14
Functiondecorator
(func)
backend/utils/text_client.py:13
FunctiondeleteHistory
(recordId: string)
frontend/src/api/history.ts:124
FunctiondeleteImageProvider
* 删除图片服务商
frontend/src/composables/useProviderForm.ts:463
FunctiondeletePage
* 删除指定索引的页面 * @param index 页面索引
frontend/src/stores/generator.ts:220
FunctiondeleteTextProvider
* 删除文本服务商
frontend/src/composables/useProviderForm.ts:304
Functiondelete_history
删除历史记录 路径参数: - record_id: 记录 ID 返回: - success: 是否成功
backend/routes/history_routes.py:249
FunctiondiagnosticsText
(error: AppError)
frontend/src/utils/errors.ts:59
Functiondownload_history_zip
下载历史记录的所有图片为 ZIP 文件 路径参数: - record_id: 记录 ID 返回: - 成功:ZIP 文件下载 - 失败:JSON 错误信息
backend/routes/history_routes.py:396
Functionfake_post
(url, headers=None, json=None, timeout=None)
tests/errors_test.py:151
Functionfallback
(e)
backend/app.py:80
FunctionfinishGeneration
* 完成图片生成流程 * @param taskId 生成任务的ID
frontend/src/stores/generator.ts:348
FunctiongenerateContent
( topic: string, outline: string )
frontend/src/api/content.ts:5
FunctiongenerateOutline
( topic: string, images?: File[] )
frontend/src/api/outline.ts:5
Functiongenerate_content
生成标题、文案、标签 请求格式(application/json): - topic: 主题文本 - outline: 大纲内容 返回: - success: 是否成功 - titl
backend/routes/content_routes.py:28
Methodgenerate_image
生成图片 Args: prompt: 提示词 size: 图片尺寸 (如 "1024x1024", "2048x2048", "4096x4096") model: 模型名称
backend/generators/openai_compatible.py:48
Methodgenerate_image
生成图片 Args: prompt: 提示词 aspect_ratio: 宽高比 (如 "3:4", "1:1", "16:9") temperature: 温度 mo
backend/generators/google_genai.py:329
Methodgenerate_image
生成图片 Args: prompt: 提示词 **kwargs: 其他参数(如分辨率、宽高比等) Returns: 图片二进制数据
backend/generators/base.py:21
Methodgenerate_image
生成图片 Args: prompt: 图片描述 aspect_ratio: 宽高比 temperature: 创意度(未使用,保留接口兼容) model: 模型名称
backend/generators/image_api.py:51
Methodgenerate_image
(self, **kwargs)
tests/history_and_image_service_test.py:92
Functiongenerate_images
批量生成图片(SSE 流式返回) 请求体: - pages: 页面列表(必填) - task_id: 任务 ID - full_outline: 完整大纲文本 - user_topic: 用户原始输入
backend/routes/image_routes.py:37
Functiongenerate_outline
生成大纲(支持图片上传) 请求格式: 1. multipart/form-data(带图片文件) - topic: 主题文本 - images: 图片文件列表 2. applicatio
backend/routes/outline_routes.py:29
Methodgenerate_text
生成文本(支持图片输入) Args: prompt: 提示词 model: 模型名称 temperature: 温度 max_output_tokens: 最大输出 t
backend/utils/text_client.py:105
FunctiongetFailedImages
* 获取所有生成失败的图片列表 * @returns 失败的图片数组
frontend/src/stores/generator.ts:369
FunctiongetFailedPages
* 获取生成失败的图片对应的页面 * @returns 失败页面的数组
frontend/src/stores/generator.ts:377
FunctiongetHistoryList
( page: number = 1, pageSize: number = 20, status?: string )
frontend/src/api/history.ts:37
FunctiongetHistoryStats
()
frontend/src/api/history.ts:159
Functionget_config
获取当前配置 返回: - success: 是否成功 - config: 配置对象 - text_generation: 文本生成配置 - image_generation: 图片生成配置
backend/routes/config_routes.py:42
Functionget_genai_client
获取全局 GenAI 客户端实例
backend/utils/genai_client.py:250
Functionget_history
获取历史记录详情 路径参数: - record_id: 记录 ID 返回: - success: 是否成功 - record: 完整的记录数据
backend/routes/history_routes.py:118
Functionget_history_stats
获取历史记录统计信息 返回: - success: 是否成功 - total: 总记录数 - by_status: 按状态分组的统计
backend/routes/history_routes.py:312
Functionget_image
获取图片文件 路径参数: - task_id: 任务 ID - filename: 文件名 查询参数: - thumbnail: 是否返回缩略图(默认 true) 返回:
backend/routes/image_routes.py:125
Methodget_image_path
获取图片完整路径 Args: task_id: 任务ID filename: 文件名 Returns: 完整路径
backend/services/image.py:884
Methodget_supported_aspect_ratios
获取支持的宽高比
backend/generators/google_genai.py:446
Methodget_supported_aspect_ratios
获取支持的宽高比 Returns: 支持的宽高比列表
backend/generators/base.py:57
Methodget_supported_aspect_ratios
获取支持的宽高比
backend/generators/image_api.py:47
Methodget_supported_sizes
获取支持的图片尺寸
backend/generators/openai_compatible.py:125
Methodget_supported_sizes
获取支持的图片尺寸 Returns: 支持的尺寸列表
backend/generators/base.py:48
Methodget_supported_sizes
获取支持的图片尺寸
backend/generators/image_api.py:43
Functionget_task_state
获取任务状态 路径参数: - task_id: 任务 ID 返回: - success: 是否成功 - state: 任务状态 - generated: 已生成的图片
backend/routes/image_routes.py:367
Methodhandle_result
(page: Dict, result: Tuple[int, bool, Optional[str], Optional[str]])
backend/services/image.py:768
FunctionhasFailedImages
* 检查是否存在生成失败的图片 * @returns true-存在失败的图片, false-所有图片都成功
frontend/src/stores/generator.ts:388
FunctionhasUnsavedChanges
* 检查是否有未保存的更改 * @returns true-有未保存的更改, false-没有未保存的更改
frontend/src/stores/generator.ts:530
Functionhealth_check
健康检查接口 返回: - success: 服务是否正常 - message: 状态消息
backend/routes/image_routes.py:410
Functionindex
()
backend/app.py:84
FunctioninsertPage
* 在指定位置后插入新页面 * @param afterIndex 在此索引后插入 * @param type 页面类型 * @param content 页面内容
frontend/src/stores/generator.ts:252
Methodis_chat_endpoint
(self)
backend/generators/image_provider_policy.py:56
Methodjson
(self)
tests/errors_test.py:261
Methodjson
(self)
tests/image_api_client_test.py:16
Functionlist_history
获取历史记录列表(分页) 查询参数: - page: 页码(默认 1) - page_size: 每页数量(默认 20) - status: 状态过滤(可选:all/completed/draft)
backend/routes/history_routes.py:86
Methodload_text_providers_config
加载文本生成服务商配置
backend/config.py:52
FunctionmarkSaved
* 标记已保存到服务器 * 更新最后保存时间为当前时间
frontend/src/stores/generator.ts:522
FunctionmovePage
* 移动页面位置(用于拖拽排序) * @param fromIndex 源位置索引 * @param toIndex 目标位置索引
frontend/src/stores/generator.ts:272
FunctionopenAddImageModal
* 打开添加图片服务商弹窗
frontend/src/composables/useProviderForm.ts:372
FunctionopenAddTextModal
* 打开添加文本服务商弹窗
frontend/src/composables/useProviderForm.ts:218
FunctionopenEditImageModal
* 打开编辑图片服务商弹窗
frontend/src/composables/useProviderForm.ts:381
FunctionopenEditTextModal
* 打开编辑文本服务商弹窗
frontend/src/composables/useProviderForm.ts:227
Functionraise_rate_limit
(provider_type, config)
tests/errors_test.py:120
FunctionreadFileAsDataUrl
(file: File)
frontend/src/api/image.ts:128
FunctionregenerateImage
( taskId: string, page: Page, useReference: boolean = true, context?: { fullOutline?: string u
frontend/src/api/image.ts:19
FunctionregenerateImage
(index: number)
frontend/src/composables/useImageRetry.ts:61
Functionregenerate_image
重新生成图片(即使成功的也可以重新生成) 请求体: - task_id: 任务 ID(必填) - page: 页面信息(必填) - use_reference: 是否使用参考图(默认 true) -
backend/routes/image_routes.py:302
Methodregister_generator
注册自定义生成器 Args: name: 生成器名称 generator_class: 生成器类
backend/generators/factory.py:50
Methodreload_config
重新加载配置(清除缓存)
backend/config.py:149
Functionreset
* 重置所有状态到初始值 * 用于开始新的生成任务时清空之前的数据
frontend/src/stores/generator.ts:396
FunctionretryAllFailed
()
frontend/src/composables/useImageRetry.ts:65
FunctionretryFailedImages
( taskId: string, pages: Page[], onProgress: (event: ProgressEvent) => void, onComplete: (event: Progr
frontend/src/api/image.ts:40
Functionretry_failed_images
批量重试失败的图片(SSE 流式返回) 请求体: - task_id: 任务 ID(必填) - pages: 要重试的页面列表(必填) 返回: SSE 事件流
backend/routes/image_routes.py:238
Functionretry_on_429
429 错误自动重试装饰器(带智能错误解析)
backend/utils/genai_client.py:12
Functionretry_on_429
429 错误自动重试装饰器
backend/utils/text_client.py:11
Functionretry_single_image
重试生成单张失败的图片 请求体: - task_id: 任务 ID(必填) - page: 页面信息(必填) - use_reference: 是否使用参考图(默认 true) 返回:
backend/routes/image_routes.py:179
Functionsample_history_record
示例历史记录
tests/conftest.py:62
Functionsample_outline
示例大纲数据
tests/conftest.py:49
Functionsample_pages
示例页面数据
tests/conftest.py:38
FunctionsaveImageProvider
* 保存图片服务商
frontend/src/composables/useProviderForm.ts:409
FunctionsaveTextProvider
* 保存文本服务商
frontend/src/composables/useProviderForm.ts:253
FunctionsaveToStorage
* 保存当前状态到 localStorage * 用于浏览器刷新后恢复状态
frontend/src/stores/generator.ts:551
FunctionscanAllTasks
()
frontend/src/api/history.ts:176
Functionscan_all_tasks
扫描所有任务并同步图片列表 返回: - success: 是否成功 - total_tasks: 扫描的任务总数 - synced: 成功同步的任务数 - failed: 失败的任务数
backend/routes/history_routes.py:365
Functionscan_task
扫描单个任务并同步图片列表 路径参数: - task_id: 任务 ID 返回: - success: 是否成功 - images: 同步后的图片列表
backend/routes/history_routes.py:336
FunctionsearchHistory
(keyword: string)
frontend/src/api/history.ts:142
Functionsearch_history
搜索历史记录 查询参数: - keyword: 搜索关键词(必填) 返回: - success: 是否成功 - records: 匹配的记录列表
backend/routes/history_routes.py:280
Functionserve_index
()
backend/app.py:75
FunctionsetContent
* 设置生成的内容数据 * @param titles 标题列表 * @param copywriting 文案内容 * @param tags 标签列表
frontend/src/stores/generator.ts:461
FunctionsetContentError
* 设置内容生成失败的错误信息 * @param error 错误描述
frontend/src/stores/generator.ts:473
FunctionsetImageRetrying
* 设置指定图片为重试中状态 * @param index 页面索引
frontend/src/stores/generator.ts:358
FunctionsetOutline
* 设置大纲数据 * @param raw 原始大纲文本 * @param pages 解析后的页面数组
frontend/src/stores/generator.ts:185
FunctionsetOutlineStatus
* 设置大纲生成状态 * @param status 大纲生成状态:idle-未开始, generating-生成中, done-已完成, error-出错
frontend/src/stores/generator.ts:495
FunctionsetRecordId
* 设置历史记录ID(带验证) * @param recordId 历史记录ID,null表示清空
frontend/src/stores/generator.ts:503
FunctionsetTopic
* 设置用户输入的主题 * @param topic 主题内容
frontend/src/stores/generator.ts:176
← previousnext →201–300 of 355, ranked by callers