Skip to content

Commit 10f501e

Browse files
committed
2 parents caa4d9f + 08fa227 commit 10f501e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

app/client/platforms/openai.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ export class ChatGPTApi implements LLMApi {
110110
// Please do not ask me why not send max_tokens, no reason, this param is just shit, I dont want to explain anymore.
111111
};
112112

113+
// add max_tokens to vision model
114+
if (visionModel) {
115+
Object.defineProperty(requestPayload, "max_tokens", {
116+
enumerable: true,
117+
configurable: true,
118+
writable: true,
119+
value: Math.max(modelConfig.max_tokens, 4096),
120+
});
121+
}
122+
113123
console.log("[Request] openai payload: ", requestPayload);
114124

115125
const shouldStream = !!options.config.stream;

0 commit comments

Comments
 (0)