(text)
| 136 | textPart.text = `${textPart.text || ''}\n\n# Tool-call retry\n${hint}` |
| 137 | } else { |
| 138 | last.content = [{ type: 'text', text: hint }, ...last.content] |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | return { ...requestBody, messages } |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * 处理流式响应 |
| 147 | * @param {object} res - Express 响应对象 |
| 148 | * @param {object} response - 上游响应流 |
| 149 | * @param {boolean} enable_thinking - 是否启用思考模式 |
| 150 | * @param {boolean} enable_web_search - 是否启用网络搜索 |
| 151 | * @param {object} requestBody - 原始请求体,用于提取prompt信息 |
| 152 | * @param {object} [options] - 扩展选项 |
| 153 | * @param {boolean} [options.has_tools] - 是否启用工具调用解析 |
| 154 | * @param {string|Object} [options.tool_choice] - OpenAI tool_choice 控制项 |
| 155 | */ |
no outgoing calls
no test coverage detected