Commit graph

43 commits

Author SHA1 Message Date
Hayden Johnson 780b755837 Add SQLite database support for conversation history
- Introduce SQLite database to store conversation history
- Implement functions to save and load conversations from the database
- Replace previous file-based history storage with database-backed solution
- Add new command to list and resume previous conversations
- Update chat logic to generate topics for saved conversations
- Add database initialization and management functions
- Modify command line interface to support resuming conversations
2025-05-17 10:18:50 -07:00
Hayden Johnson 892fdc317e begin to add sqlite functionality 2025-05-16 08:03:36 -07:00
Hayden Johnson 559be56000 use refactored version by default now 2025-05-16 07:44:27 -07:00
Hayden Johnson 15b25aea05 Remove unfinished save_conversation impl 2025-05-10 17:27:05 -07:00
Hayden Johnson f6597f4bd0 arg_shell clears history before running 2025-05-08 09:09:39 -07:00
Hayden Johnson 399f1b1aca update default model for refactored version 2025-04-29 16:30:29 -07:00
Hayden Johnson 1f357118d9 Merge branch 'main' of forgejo.zaydenlab.com:Chewt/ai-assistant 2025-04-29 16:25:17 -07:00
Hayden Johnson 4d6e431563 feat: Refactor code and add clipboard functionality
This commit introduces several improvements and new features to the AI Assistant:

- **Refactored code:** Improved code structure and readability.
- **Added clipboard functionality:** Implemented a `/copy` command to copy code blocks to the clipboard.
- **Improved command parsing:** Added a `/copy` command to copy code blocks to the clipboard.
- **Enhanced error handling:** Added error handling for clipboard operations.
- **Improved documentation:** Updated documentation to reflect changes.
2025-04-29 16:24:58 -07:00
Hayden Johnson 501a85f198 change default model 2025-04-29 12:41:30 -07:00
Hayden Johnson c0d83584c7 add back highlighting into refactored version 2025-04-26 14:20:58 -07:00
Hayden Johnson 4b38d5cb6a Merge branch 'main' of forgejo.zaydenlab.com:Chewt/ai-assistant 2025-04-26 12:01:53 -07:00
Hayden Johnson 89981a82f8 improve multi-line editing with prompt_toolkit 2025-04-26 12:01:42 -07:00
Hayden Johnson 161e4dea77 Add temporary cmdline option 2025-04-26 11:20:52 -07:00
Hayden Johnson 30f2585d33 add copy function 2025-04-25 16:22:41 -07:00
Hayden Johnson 96ffcae953 feat: Begin refactor into class structure
This commit introduces a significant refactor of the AI assistant's codebase, transitioning from a procedural approach to an object-oriented design. This change improves modularity, maintainability, and extensibility.

Key changes include:

- Introduction of classes: AIAssistant, CommandLineParser, InputHandler, and CommandParser.
- Encapsulation of core functionality within the AIAssistant class.
- Improved input handling with separation of interactive and piped input.
- Implementation of command parsing for actions like saving, clearing, and exiting.
- Refactored history management for persistent conversation storage.
2025-04-10 22:19:01 -07:00
Hayden Johnson 0dcc44870e Fix: Correctly guess lexer when no language is specified
The `guess_lexer` function was not correctly handling code snippets when no language was specified. It was only considering the second line of the code, which could lead to incorrect lexer selection. This commit joins the lines of code (excluding the first and last) back into a single string before passing it to `guess_lexer`, ensuring the entire code block is considered for lexer identification.
2025-04-10 20:35:36 -07:00
Hayden Johnson fe4f739eb3 feat: improve input handling and add context length option
This commit introduces several improvements to the input handling process:

- Implemented `improved_input()` to handle multi-line input and prevent accidental sending of pasted content.  The user signals completion by pressing Ctrl+D or entering two consecutive empty lines.
- Added a new command-line argument `--context` to allow users to specify the context length for the model.
- Updated the help message to reflect the new argument.
2025-04-10 20:21:17 -07:00
Hayden Johnson d946938b3d Made assistant history persist with cache file 2025-04-08 19:57:34 -07:00
Hayden Johnson 2237293e16 adjust shell command prompt 2025-04-08 13:22:27 -07:00
Hayden Johnson 70c129a448 increase default context size 2025-04-08 13:06:20 -07:00
Hayden Johnson 01e6a3ef75 change default model and add reasoning mode 2025-04-08 12:39:09 -07:00
Hayden Johnson 24c6625f30 Add import for guess_lexer function 2025-03-16 12:27:00 -07:00
Hayden Johnson b2d66c2937 add requirements.txt 2025-03-16 12:10:15 -07:00
Hayden Johnson e7446b1593 Change default python interpreter to local venv 2025-03-16 12:10:07 -07:00
Hayden Johnson 2436a59ed3 Add red coloring to assistant response
To better distinguish between the user's messages and the ai's messages,
the "assistant" label will be colored red
2024-12-19 08:13:47 -08:00
Hayden Johnson f49142f04c Add /clipboard command
clipboard contents can be added as context in the conversation now.
2024-10-01 13:25:30 -07:00
Hayden Johnson 0455b12d90 Add indicator in chat log for assistant responses
Now it is clear when the assistant responds in the terminal interface.
2024-10-01 13:00:32 -07:00
Hayden Johnson dc772722d6 Add /save /clear and /exit commands
The save command takes an optional filename to save the conversation to.
the clear command clears the chat history.
2024-10-01 12:50:55 -07:00
Hayden Johnson d074c97645 Add tracking of entire conversation 2024-10-01 11:52:31 -07:00
Hayden Johnson 0fb11b0691 Add initial framework for commands 2024-10-01 11:50:35 -07:00
Hayden Johnson f6ec5cde2e Update readme 2024-09-27 09:54:53 -07:00
Hayden Johnson 4ae07a97af Fix default value for stream in chat2 2024-09-25 14:44:54 -07:00
Hayden Johnson 8007943581 Add reflection option 2024-09-25 14:33:14 -07:00
Hayden Johnson c0a9377849 Fix issue with last line not being printed 2024-09-25 13:19:03 -07:00
Hayden Johnson fb57930c69 Add README.md 2024-09-25 13:14:44 -07:00
Hayden Johnson a69b63e4fe Fix --host argument 2024-09-25 13:02:02 -07:00
Hayden Johnson 8deaa3b6e1 Add option to specify host 2024-09-25 12:54:27 -07:00
Hayden Johnson f454e9e17b Fix issue with double newlines in codeblocks 2024-09-25 12:44:28 -07:00
Hayden Johnson b2f218639f Update gitignore 2024-09-25 11:58:55 -07:00
Hayden Johnson 19f430e408 Add syntax highlighting to output 2024-09-25 11:56:48 -07:00
Hayden Johnson 63c38a371f changed to localhost and updated system prompt 2024-09-25 10:26:05 -07:00
Hayden Johnson 65682cf598 feat: add temp flag 2024-09-03 02:38:36 -07:00
Hayden Johnson 46e626b288 Intial commit. Switch from OpenAI to Ollama module 2024-08-11 21:42:37 -07:00