mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
🛡️ feat: Rate Limiting for Conversation Forking (#8269)
* chore: Improve error logging for fetching conversations, and use new TS packages for utils * feat: Implement fork limiters for conversation forking requests * chore: error message for conversation index deletion to clarify syncing behavior * feat: Enhance error handling for forking with rate limit message
This commit is contained in:
parent
3554625a06
commit
97a99985fa
7 changed files with 111 additions and 9 deletions
|
|
@ -233,9 +233,17 @@ export default function Fork({
|
|||
status: 'info',
|
||||
});
|
||||
},
|
||||
onError: () => {
|
||||
onError: (error) => {
|
||||
/** Rate limit error (429 status code) */
|
||||
const isRateLimitError =
|
||||
(error as any)?.response?.status === 429 ||
|
||||
(error as any)?.status === 429 ||
|
||||
(error as any)?.statusCode === 429;
|
||||
|
||||
showToast({
|
||||
message: localize('com_ui_fork_error'),
|
||||
message: isRateLimitError
|
||||
? localize('com_ui_fork_error_rate_limit')
|
||||
: localize('com_ui_fork_error'),
|
||||
status: 'error',
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -773,6 +773,7 @@
|
|||
"com_ui_fork_change_default": "Default fork option",
|
||||
"com_ui_fork_default": "Use default fork option",
|
||||
"com_ui_fork_error": "There was an error forking the conversation",
|
||||
"com_ui_fork_error_rate_limit": "Too many fork requests. Please try again later",
|
||||
"com_ui_fork_from_message": "Select a fork option",
|
||||
"com_ui_fork_info_1": "Use this setting to fork messages with the desired behavior.",
|
||||
"com_ui_fork_info_2": "\"Forking\" refers to creating a new conversation that start/end from specific messages in the current conversation, creating a copy according to the options selected.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue