Skip to content

Conversation

@aug6th
Copy link

@aug6th aug6th commented Sep 26, 2025

Problem

ReActChat was not including file contents in the prompt when files were provided during initialization, making the files parameter ineffective.

Solution

  • Added file content retrieval logic to _prepend_react_prompt() method
  • Files are now processed through the memory system and included as system messages
  • Added safe error handling to prevent crashes if memory operations fail

Changes

  • Modified ReActChat._prepend_react_prompt() to check for available files
  • File contents are retrieved via self.mem.run() and prepended as system messages
  • Maintains backward compatibility with existing code

Testing

  • Files provided to ReActChat constructor are now properly included in prompts
  • No breaking changes to existing functionality
  • Safe fallback behavior if file processing fails

Fixes #689

- ReActChat now includes file contents in the prompt when files are provided
- Fixes issue where files parameter was ignored in ReActChat initialization
- Adds safe error handling for memory operations
- Resolves QwenLM#689
@aug6th
Copy link
Author

aug6th commented Oct 18, 2025

I submitted a PR fixing an issue where file contents were not included in the prompt when files are passed to ReActChat.

Our company is interested in this project, and we implemented this by utilizing the memory system as it was necessary during actual use.

If there are any plans for similar functionality or better approaches, I would appreciate it if you could let me know.

Could you please take a look when you have time?

/cc @tuhahaha

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.

ReActChat没有把files的内容添加到提示词中

1 participant