-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Error in obtaining variables for character settings #1948
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record | |
| question = self.generate_prompt_question(prompt) | ||
| self.context['question'] = question.content | ||
| system = self.workflow_manage.generate_prompt(system) | ||
| self.context['system'] = question.content | ||
| self.context['system'] = system | ||
| message_list = self.generate_message_list(system, prompt, history_message) | ||
| self.context['message_list'] = message_list | ||
| if stream: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no apparent issue with this code. However, there are a couple of small improvements that can be made for readability and maintainability:
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet is generally clean and concise. However, there's one small issue that could be improved:
This comment suggests modifying the last assignment to use the updated system content instead of directly setting
self.context['system']toquestion.content, which can prevent unexpected behavior if the context contains other relevant information that needs to be preserved. Additionally, adding error handling for accessing/modifying context variables can make the code more robust.