Skip to content

Commit

Permalink
auto-title character limit
Browse files Browse the repository at this point in the history
  • Loading branch information
jackschedel committed Jan 2, 2024
1 parent c5fde5f commit bfc808a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hooks/useSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ const useSubmit = () => {
!currChats[currentChatIndex]?.titleSet
) {
const messages_length = currChats[currentChatIndex].messages.length;

// only first 800 chars of each message
const assistant_message =
currChats[currentChatIndex].messages[messages_length - 1].content;
currChats[currentChatIndex].messages[messages_length - 1].content.slice(0, 800);
const user_message =
currChats[currentChatIndex].messages[messages_length - 2].content;
currChats[currentChatIndex].messages[messages_length - 2].content.slice(0, 800);

const message: MessageInterface = {
role: 'user',
Expand Down

0 comments on commit bfc808a

Please sign in to comment.