😎 fix: Azure Bug, short default max_tokens response using gpt-4-vision-preview (#2885)

This commit is contained in:
Danny Avila 2024-05-27 22:56:26 -04:00 committed by GitHub
parent c704a23749
commit 2b7a973a33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1108,7 +1108,12 @@ ${convo}
}
if (this.azure || this.options.azure) {
// Azure does not accept `model` in the body, so we need to remove it.
/* Azure Bug, extremely short default `max_tokens` response */
if (!modelOptions.max_tokens && modelOptions.model === 'gpt-4-vision-preview') {
modelOptions.max_tokens = 4000;
}
/* Azure does not accept `model` in the body, so we need to remove it. */
delete modelOptions.model;
opts.baseURL = this.langchainProxy