snakeying / flux-api-worker

Deployed on Cloudflare Worker, using the free Flux model and optimizing prompts with LLM. It can be called from any application compatible with the OpenAI API. 部署于Cloudflare Worker,免费使用Flux模型,并通过LLM进行提示词优化,支持在任何兼容OpenAI API的应用中调用。
58 stars 3 forks source link

Update flux-api-worker_zh-cn.js 检测提示词不含中文字符则保持原样不翻译 #1

Closed h1xy closed 4 days ago

snakeying commented 4 days ago

目前的设计思路是,当变量 CF_IS_TRANSLATE 设置为 true,且满足 EXTERNAL_API_BASEEXTERNAL_MODELEXTERNAL_API_KEY 的配置要求时,系统将调用外部 API(例如 GPT-4o 等模型)对提示词进行优化,而不仅仅是执行翻译功能。其实我有点偷懒了,应该将 CF_IS_TRANSLATE 改为 PROMPT_OPTIMIZED,这样就不会产生歧义了。

The current design approach is that when the variable CF_IS_TRANSLATE is set to true and the settings for EXTERNAL_API_BASE, EXTERNAL_MODEL, and EXTERNAL_API_KEY are met, the system will invoke external APIs (such as GPT-4o models) to optimize the prompts, rather than just performing translation. In fact, I got a bit lazy—I should have renamed CF_IS_TRANSLATE to PROMPT_OPTIMIZED to avoid any ambiguity.