mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
⌚ feat: Add Current Datetime to Assistants (v1/v2) (#4952)
* Feature: Added ability to send current date and time to v1 and v2 assistants * remove date_feature.patch * fix: rename append_today_date to append_current_datetime * feat: Refactor time handling in chatV1 and chatV2, add date and time utility functions * fix: Add warning log and response for missing run values in abortRun middleware --------- Co-authored-by: Max Sanna <max@maxsanna.com>
This commit is contained in:
parent
b5c9144127
commit
1dbe6ee75d
38 changed files with 378 additions and 67 deletions
|
|
@ -45,17 +45,22 @@ export default function useSubmitMessage(helpers?: { clearDraft?: () => void })
|
|||
const overrideConvoId = isNewMultiConvo ? v4() : undefined;
|
||||
const overrideUserMessageId = hasAdded ? v4() : undefined;
|
||||
const rootIndex = addedIndex - 1;
|
||||
const clientTimestamp = new Date().toISOString();
|
||||
|
||||
ask({
|
||||
text: data.text,
|
||||
overrideConvoId: appendIndex(rootIndex, overrideConvoId),
|
||||
overrideUserMessageId: appendIndex(rootIndex, overrideUserMessageId),
|
||||
clientTimestamp,
|
||||
});
|
||||
|
||||
if (hasAdded) {
|
||||
askAdditional(
|
||||
{
|
||||
text: data.text,
|
||||
overrideConvoId: appendIndex(addedIndex, overrideConvoId),
|
||||
overrideUserMessageId: appendIndex(addedIndex, overrideUserMessageId),
|
||||
clientTimestamp,
|
||||
},
|
||||
{ overrideMessages: rootMessages },
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue