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

[Question]: During the conversation, the history id will always be spelled with a lot of user, assistant, is this a BUG or to solve some problem? #4409

Closed
kuschzzp opened this issue Jan 8, 2025 · 6 comments
Labels
question Further information is requested

Comments

@kuschzzp
Copy link
Contributor

kuschzzp commented Jan 8, 2025

Describe your problem

During the conversation, the history id will always be spelled with a lot of user, assistant, is this a BUG or to solve some problem?
C08D0924-01ED-40bb-A490-F456093AA634

@kuschzzp kuschzzp added the question Further information is requested label Jan 8, 2025
@KevinHuSh
Copy link
Collaborator

Which API do you refer to?

@kuschzzp
Copy link
Contributor Author

kuschzzp commented Jan 8, 2025

Which API do you refer to?
this one

image

@KevinHuSh
Copy link
Collaborator

I mean that which completion API?

@kuschzzp
Copy link
Contributor Author

kuschzzp commented Jan 8, 2025

I mean that which completion API?

I'm also not sure if the issue is in the 'completion' API

My front-end developer friend found this concatenation and I didn't understand it. Why are the prefixes' user 'and' assistant 'repeatedly concatenated in the code.

https://github.com/infiniflow/ragflow/blob/3d66d783045051de911f619033c3bf37a2c18a3c/web/src/utils/chat.ts#L11C1-L18C3

The more conversations you have, the longer 'user_' and 'assistant_' will be in the history ID

image

cike8899 added a commit to cike8899/ragflow that referenced this issue Jan 13, 2025
@cike8899
Copy link
Contributor

The message id is generated on the front end, and the message id returned by the back end is the same as the question id, so that the pair of messages can be deleted together when deleting the message. I have fixed this issue so that duplicate prefixes no longer appear in the message ids.

KevinHuSh pushed a commit that referenced this issue Jan 13, 2025
…efix to the id when rendering the message. #4409 (#4451)

### What problem does this PR solve?

Fix: In order to distinguish the keys of a pair of messages, add a
prefix to the id when rendering the message. #4409

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
@kuschzzp
Copy link
Contributor Author

The message id is generated on the front end, and the message id returned by the back end is the same as the question id, so that the pair of messages can be deleted together when deleting the message. I have fixed this issue so that duplicate prefixes no longer appear in the message ids.

Great, thanks for your reply.

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

No branches or pull requests

3 participants