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

docs: Correct thread_id consistency for conversation history example #28470

Closed
wants to merge 1 commit into from

Conversation

asdkfjsd
Copy link

@asdkfjsd asdkfjsd commented Dec 3, 2024

Thank you for contributing to LangChain!

Description: Updated the documentation to ensure that both queries in the conversation history example share the same thread_id, reflecting a single conversation context. This change aligns with the intended behavior where the model should discard the context for query1 after trimming the chat history and retain the context for query2.

Issue: DOC: Managing Conversation History #28450

Dependencies: No additional dependencies required for this change.

To fix the problem DOC: Managing Conversation History langchain-ai#28450
Problem in the Example:

query1: "What is my name?"
thread_id: abc567
query2: "What math problem did I ask?"
thread_id: abc678
The change in thread_id is incorrect, as both queries should belong to the same conversation.

Intended Behavior to Demonstrate:

After trimming the chat history, the context for query1 is discarded. The model cannot answer it.
The context for query2 is retained, so the model can still respond to it.

What have I do:
Change those two thread_id, now they are the same one.
Check other thread_id in Toturials page.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 3, 2024
Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 9:22am

@dosubot dosubot bot added the 🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Dec 3, 2024
@efriis
Copy link
Member

efriis commented Dec 3, 2024

hey! just ran the existing code, and it's working as expected. if we use the same thread id, then it'll duplicate some of the messages, so the intention is actually to create a new thread (with the same conversation history in messages)

@efriis efriis closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants