mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-29 22:58:51 +01:00
refactor: title generation logic
- Changed the title generation endpoint from POST to GET, allowing for more efficient retrieval of titles based on conversation ID. - Implemented exponential backoff for title fetching retries, improving responsiveness and reducing server load. - Introduced a queuing mechanism for title generation, ensuring titles are generated only after job completion. - Updated relevant components and hooks to utilize the new title generation logic, enhancing user experience and application performance.
This commit is contained in:
parent
24263c9874
commit
c7bc5548bc
9 changed files with 118 additions and 97 deletions
|
|
@ -101,7 +101,8 @@ export const conversations = (params: q.ConversationListParams) => {
|
|||
|
||||
export const conversationById = (id: string) => `${conversationsRoot}/${id}`;
|
||||
|
||||
export const genTitle = () => `${conversationsRoot}/gen_title`;
|
||||
export const genTitle = (conversationId: string) =>
|
||||
`${conversationsRoot}/gen_title/${encodeURIComponent(conversationId)}`;
|
||||
|
||||
export const updateConversation = () => `${conversationsRoot}/update`;
|
||||
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ export function archiveConversation(
|
|||
}
|
||||
|
||||
export function genTitle(payload: m.TGenTitleRequest): Promise<m.TGenTitleResponse> {
|
||||
return request.post(endpoints.genTitle(), payload);
|
||||
return request.get(endpoints.genTitle(payload.conversationId));
|
||||
}
|
||||
|
||||
export const listMessages = (params?: q.MessagesListParams): Promise<q.MessagesListResponse> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue