feat: 处理 openai 格式请求

This commit is contained in:
mouyong
2025-08-04 18:20:39 +08:00
parent 327d14bd5e
commit 2eee902988
5 changed files with 1517 additions and 28 deletions

View File

@@ -977,7 +977,7 @@ async function generateContent(client, requestData, userPromptId, projectId = nu
sessionId
});
const response = await axios({
const axiosConfig = {
url: `${CODE_ASSIST_ENDPOINT}/${CODE_ASSIST_API_VERSION}:generateContent`,
method: 'POST',
headers: {
@@ -986,7 +986,9 @@ async function generateContent(client, requestData, userPromptId, projectId = nu
},
data: request,
timeout: 60000, // 生成内容可能需要更长时间
});
};
const response = await axios(axiosConfig);
logger.info('✅ generateContent API调用成功');
return response.data;