mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-05-02 17:07:13 +00:00
update chat model filters for openai (#2803)
This commit is contained in:
parent
a0c5d898f0
commit
a69997a715
2 changed files with 13 additions and 3 deletions
server/utils
|
@ -62,7 +62,9 @@ class OpenAiLLM {
|
|||
// we don't want to hit the OpenAI api every chat because it will get spammed
|
||||
// and introduce latency for no reason.
|
||||
async isValidChatCompletionModel(modelName = "") {
|
||||
const isPreset = modelName.toLowerCase().includes("gpt");
|
||||
const isPreset =
|
||||
modelName.toLowerCase().includes("gpt") ||
|
||||
modelName.toLowerCase().includes("o1");
|
||||
if (isPreset) return true;
|
||||
|
||||
const model = await this.openai.models
|
||||
|
|
|
@ -141,9 +141,17 @@ async function openAiModels(apiKey = null) {
|
|||
});
|
||||
|
||||
const gpts = allModels
|
||||
.filter((model) => model.id.startsWith("gpt") || model.id.startsWith("o1"))
|
||||
.filter(
|
||||
(model) => !model.id.includes("vision") && !model.id.includes("instruct")
|
||||
(model) =>
|
||||
(model.id.includes("gpt") && !model.id.startsWith("ft:")) ||
|
||||
model.id.includes("o1")
|
||||
)
|
||||
.filter(
|
||||
(model) =>
|
||||
!model.id.includes("vision") &&
|
||||
!model.id.includes("instruct") &&
|
||||
!model.id.includes("audio") &&
|
||||
!model.id.includes("realtime")
|
||||
)
|
||||
.map((model) => {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue