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

chat: fix localdocs breakage in v3.5.2 #3302

Merged
merged 3 commits into from
Dec 16, 2024
Merged

chat: fix localdocs breakage in v3.5.2 #3302

merged 3 commits into from
Dec 16, 2024

Conversation

cebtenzzre
Copy link
Member

In v3.5.0 and v3.5.1, the API server incorrectly used the entire ChatModel to generate a response, which included messages from previous, unrelated chat sessions.

In v3.5.2, this was fixed but it consolidated the chat model access in a way that broke LocalDocs, by copying the messages before the sources had been added in promptInternalChat, which are necessary to generate the correct combined prompt for RAG.

With this PR, the early copy is replaced with a lambda to access the relevant part of the ChatModel. The API server selects the relevant messages by their indices instead of passing in a copy of them.

I have confirmed that LocalDocs does not seem to use the sources at all in v3.5.2, but with this PR it uses the sources appropriately both with a regular chat and via the local API server.

Signed-off-by: Jared Van Bortel <[email protected]>
Signed-off-by: Jared Van Bortel <[email protected]>
@cebtenzzre cebtenzzre marked this pull request as ready for review December 15, 2024 22:26
@cebtenzzre cebtenzzre requested a review from manyoso December 15, 2024 22:27
@manyoso manyoso merged commit db58003 into main Dec 16, 2024
4 of 8 checks passed
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.

2 participants