Merge pull request #2669 from continuedev/o1-preview-fix

This commit is contained in:
Nate Sesti 2024-10-24 22:19:24 -07:00 • committed by GitHub
commit 66ae2f03e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

2
core/index.d.ts vendored
View file

@ -664,6 +664,8 @@ export type ModelName =
| "gpt-4-turbo"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
| "o1-preview"
| "o1-mini"
// Mistral
| "codestral-latest"
| "open-mistral-7b"

View file

@ -37,6 +37,8 @@ const CHAT_ONLY_MODELS = [
"gpt-4-0125-preview",
"gpt-4-1106-preview",
"gpt-4o-mini",
"o1-preview",
"o1-mini",
];
class OpenAI extends BaseLLM {
@ -111,9 +113,9 @@ class OpenAI extends BaseLLM {
: url.host === "api.deepseek.com"
? options.stop?.slice(0, 16)
: url.port === "1337" ||
url.host === "api.openai.com" ||
url.host === "api.groq.com" ||
this.apiType === "azure"
url.host === "api.openai.com" ||
url.host === "api.groq.com" ||
this.apiType === "azure"
? options.stop?.slice(0, 4)
: options.stop,
};