NeuroplexusQwen2api | Deno 最新解决方案 | OpenAI 格式 中发帖

Code
// Qwen API 配置
const QWEN_API_URL = "https://chat.qwenlm.ai/api/chat/completions";
const QWEN_MODELS_URL = "https://chat.qwenlm.ai/api/models";
const MAX_RETRIES = 3;
const RETRY_DELAY = 1000; // 1秒

const encoder = new TextEncoder();
const streamDecoder = new TextDecoder();

let cachedModels: string | null = null;
let cachedModelsTimestamp = 0;
const CACHE_TTL = 60 * 60 * 1000; // 缓存 1 小时

f...