Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure chats always get saved to db when _populateChatContent is called #200

Open
davidzlu opened this issue Nov 23, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@davidzlu
Copy link
Collaborator

Currently, in _populateChatContent, EntryConversations only get saved if the llmResponse is defined:

  const llmResponse = await conversation.getChatContent(
    configId,
    analysis.id,
    messageData.messages[0].message_content,
    conversation.messages
  );

  // If the chat is not empty, update the llm_response
  if (llmResponse) { // FIXME: this will drop chats that fail to get LLM response
    messageData.messages[0].llm_response = llmResponse;
    conversation.messages?.push(messageData.messages[0]);
    await conversation.save();
  }
  return conversation;

The expected behavior should be that user messages should save even if llmResponse fails. Verify bug and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant