import { FastifyRequest, FastifyReply } from 'fastify'; export { isRetryableXfyunError, extractXfyunError, extractStreamUsage, rewritePath, buildUpstreamUrl, ALLOWED_SSE_EVENTS, SSEFilter, filterSSEEvents, cleanXfyunFields, cleanXfyunFieldsObj, fetchWithRetry, RETRYABLE_STATUS_CODES, RETRYABLE_XFYUN_CODES, summarizeContentTypes, } from './upstream'; /** * 代理请求处理主函数 * * 流程: * 1. 强制覆盖 model 为 astron-code-latest * 2. 构建上游请求(白名单 headers + API Key 注入 + 路径重写) * 3. 带重试地转发请求 * 4. 根据流式/非流式分别处理响应 * - 非流式:直接返回 JSON * - 流式:先缓存所有 SSE chunks 检测讯飞错误码,正常则透传,异常则降级重试 */ export declare function handleProxy(request: FastifyRequest, reply: FastifyReply): Promise; /** * GET 请求透传代理(如 /v1/models) * 不注入 body、不覆盖 model、不做 SSE 过滤,仅路径重写 + API Key 注入 + 透传响应 */ export declare function handleGetProxy(request: FastifyRequest, reply: FastifyReply): Promise; //# sourceMappingURL=proxy.d.ts.map