mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-22 18:26:12 +01:00
🚨 feat: Implement INPUT_LENGTH Error Type (#3866)
* feat: CONTEXT_LENGTH error type * chore: rename error type * chore: import order
This commit is contained in:
parent
6936d0059f
commit
7536e649d4
4 changed files with 26 additions and 4 deletions
|
|
@ -33,6 +33,10 @@ type TExpiredKey = {
|
|||
endpoint: string;
|
||||
};
|
||||
|
||||
type TInputLength = {
|
||||
info: string;
|
||||
};
|
||||
|
||||
const errorMessages = {
|
||||
[ErrorTypes.MODERATION]: 'com_error_moderation',
|
||||
[ErrorTypes.NO_USER_KEY]: 'com_error_no_user_key',
|
||||
|
|
@ -42,6 +46,10 @@ const errorMessages = {
|
|||
const { expiredAt, endpoint } = json;
|
||||
return localize('com_error_expired_user_key', endpoint, expiredAt);
|
||||
},
|
||||
[ErrorTypes.INPUT_LENGTH]: (json: TInputLength, localize: LocalizeFunction) => {
|
||||
const { info } = json;
|
||||
return localize('com_error_input_length', info);
|
||||
},
|
||||
[ViolationTypes.BAN]:
|
||||
'Your account has been temporarily banned due to violations of our service.',
|
||||
invalid_api_key:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue