Refactor Prompt Generation and Context Handling #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor Prompt Generation and Context Handling
Summary
This Pull Request (PR) introduces significant improvements to how the SheLLM project handles context and prompt generation. The primary focus is solving a Known Issue from the project's README:
Problem
Previously, the system passed the entire terminal session history as a single object to the LLM, without distinguishing between different elements or prioritizing recent output. This approach made it impossible to emphasize the most contextually relevant information—namely, the last command and its output.
Additionally, only the outputs of commands were included in the session history, leaving out the commands themselves. This omission severely hindered context awareness, as the LLM had no way of knowing what user input produced the outputs it was processing.
Changes
Improved Context Prioritization:
Complete Session History:
Dynamic Query Construction:
Notes
groqmodel, but no compatibility issues are anticipated.This PR enhances the contextual handling mechanism in SheLLM, making it more dynamic and contextually aware. Feedback and additional suggestions are welcome!