mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-24 21:48:12 +00:00
update error handling for OpenAI providers
This commit is contained in:
parent
196c4c13c4
commit
9f327d015a
8 changed files with 8 additions and 8 deletions
|
@ -97,7 +97,7 @@ class GenericOpenAiLLM {
|
|||
max_tokens: this.maxTokens,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -103,7 +103,7 @@ class GroqLLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -92,7 +92,7 @@ class KoboldCPPLLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -93,7 +93,7 @@ class LiteLLM {
|
|||
max_tokens: parseInt(this.maxTokens), // LiteLLM requires int
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -130,7 +130,7 @@ class OpenAiLLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -142,7 +142,7 @@ class OpenRouterLLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -93,7 +93,7 @@ class PerplexityLLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
|
@ -89,7 +89,7 @@ class TextGenWebUILLM {
|
|||
temperature,
|
||||
})
|
||||
.catch((e) => {
|
||||
throw new Error(e.response.data.error.message);
|
||||
throw new Error(e.message);
|
||||
});
|
||||
|
||||
if (!result.hasOwnProperty("choices") || result.choices.length === 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue