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

[fix] Problems with overlapping specific turns when generating LLM final answers #606

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SeongBeomLEE
Copy link

@SeongBeomLEE SeongBeomLEE commented Feb 8, 2025

There is an issue in the metaSearchAgent.ts code where the user turn is duplicated when the following code executes. This can be critical when the user's input is long.

      ChatPromptTemplate.fromMessages([
        ['system', this.config.responsePrompt],
        new MessagesPlaceholder('chat_history'),
        ['user', '{query}'],
      ]),

Additionally, in the ChatWindow.tsx code, there is an issue where the rewrite function continues to use the past ChatHistory as is. Since LLMs tend to generate similar responses when the same user input appears in previous turns, this can negatively impact the performance of the rewrite function.

To resolve these issues, I modified the part in the sendMessage function where the history and user turn are combined, and I also updated the rewrite logic to use useEffect.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant