neokd / NeoGPT

Chat effortlessly, execute commands, and interpret code with Llama3, Phi3, and more - your local AI assistant. Enjoy seamless interaction while ensuring ultimate privacy
https://neogpt.dev
MIT License
68 stars 62 forks source link

Add search functionality to magic_commands.py #213

Closed ayushmorbar closed 3 months ago

ayushmorbar commented 4 months ago

This pull request adds a new feature to the magic_commands.py file, allowing users to search the chat history for a specific keyword. The search functionality is implemented using the "/search [keyword]" command. When the command is executed, the chat history is scanned for messages containing the keyword, and the matching messages are displayed. If no messages are found, a corresponding message is printed. This feature enhances the usability of the chat application by providing users with a convenient way to search for specific content within the chat history.

Refer https://github.com/neokd/NeoGPT/issues/210

neokd commented 3 months ago

This functionality allows to search entire history or current chat hisotry?

ayushmorbar commented 3 months ago

The provided code searches the entire chat history. It iterates over all messages stored in chain.combine_documents_chain.memory.chat_memory.messages, which presumably holds all messages from the start of the chat to the current moment.

neokd commented 3 months ago

Great. Futher we can extend this to search the entire chat history.

ayushmorbar commented 3 months ago

Well, It already does that.

neokd commented 3 months ago

Sorry!! Missed the PR, Thanks for the contribution.

ayushmorbar commented 2 months ago

Sorry!! Missed the PR, Thanks for the contribution.

Haha, no issues.