Merge pull request #2 from SolarifyDev/enhance-openai-o1or-o3-request-params

Enhance OpenAI o1、o3 request params
This commit is contained in:
Ted 2025-02-18 16:23:57 +08:00 committed by GitHub
commit adca477723
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,6 +67,7 @@ export interface RequestPayload {
top_p: number;
max_tokens?: number;
max_completion_tokens?: number;
drop_params?: boolean;
}
export interface DalleRequestPayload {
@ -240,6 +241,7 @@ export class ChatGPTApi implements LLMApi {
// O1 使用 max_completion_tokens 控制token数 (https://platform.openai.com/docs/guides/reasoning#controlling-costs)
if (isO1OrO3) {
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
requestPayload["drop_params"] = true;
}
// add max_tokens to vision model