diff --git a/app/server/lib/Assistance.ts b/app/server/lib/Assistance.ts index bdb9ac3a34..e9dc4f10e7 100644 --- a/app/server/lib/Assistance.ts +++ b/app/server/lib/Assistance.ts @@ -276,7 +276,7 @@ export class OpenAIAssistant implements Assistant { const errorCode = result.error?.code; const errorMessage = result.error?.message; if (errorCode === "context_length_exceeded" || result.choices?.[0].finish_reason === "length") { - log.warn("OpenAI context length exceeded: ", errorMessage); + log.warn("AI context length exceeded: ", errorMessage); if (messages.length <= 2) { throw new TokensExceededFirstMessageError(); } else { @@ -284,11 +284,11 @@ export class OpenAIAssistant implements Assistant { } } if (errorCode === "insufficient_quota") { - log.error("OpenAI billing quota exceeded!!!"); + log.error("AI service provider billing quota exceeded!!!"); throw new QuotaExceededError(); } if (apiResponse.status !== 200) { - throw new Error(`OpenAI API returned status ${apiResponse.status}: ${resultText}`); + throw new Error(`AI service provider API returned status ${apiResponse.status}: ${resultText}`); } return result.choices[0].message.content; } diff --git a/test/server/lib/Assistance.ts b/test/server/lib/Assistance.ts index 4a73aef082..39878387ff 100644 --- a/test/server/lib/Assistance.ts +++ b/test/server/lib/Assistance.ts @@ -184,7 +184,7 @@ describe('Assistance', function () { checkSendForCompletion(), "Sorry, the assistant is unavailable right now. " + "Try again in a few minutes. \n" + - '(Error: OpenAI API returned status 500: {"status":500})', + '(Error: AI service provider API returned status 500: {"status":500})', ); assert.equal(fakeFetch.callCount, 3); });