Conversation as a read-only object #7698
Closed
LeesinChen
started this conversation in
Feature Requests & Suggestions
Replies: 4 comments 2 replies
-
Is this creating unexpected behavior for you? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
This issue affected me as well. (The result is that messages fail to send when I select a model that uses a promptPrefix.) Took a stab at a fix here: #7966 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
`js
import {
useRecoilValue,
} from 'recoil';
const conversation = useRecoilValue(conversationByIndex(key));
// in the /client/src/hooks/Chat/useChatFunctions.ts file
if (conversation?.promptPrefix) {
conversation.promptPrefix = replaceSpecialVars({
text: conversation.promptPrefix,
user,
});
}
`
Conversation as a read-only object, should not be modified in this way and should be modified via the setConversation method
like this
`
if (conversation?.promptPrefix && setConversation) {
setConversation({
...conversation,
text: conversation.promptPrefix,
user,
});
}
Version Information
none
Steps to Reproduce
none
What browsers are you seeing the problem on?
No response
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions