-
Notifications
You must be signed in to change notification settings - Fork 652
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
Refactor Chat Assistant(50%) #811
Conversation
… enhancing conversation management, and implementing new test cases for prompts, chat messages, and history saving. Introduce custom response recorder for improved testing and mock AI for simulating responses.
…ver-sent events (SSE) in chat handling, improving error messaging with structured responses, and refactoring assistant creation logic. Update conversation settings to utilize a new assistant model and implement context management improvements for better performance. Additionally, streamline the DSL structure and enhance test coverage for chat functionalities.
…place map-based error responses with a more concise error method in the message struct, enhancing readability and maintainability. Update related functions to ensure consistent error messaging across chat handling and response writing.
…istration. Introduce OPTIONS handlers for all endpoints, improve CORS middleware logic, and reorganize assistant creation flow in load.go. Additionally, add a delay in the Answer method to ensure proper retrieval of assistant and chat IDs.
…sponse handling and streamline assistant creation. Update HookCreate to return structured CreateResponse with AssistantID and ChatID, enhancing error handling. Modify Load function to create the default assistant after querying the assistant list, ensuring proper initialization. Refactor newAssistant methods for better clarity and maintainability, and update types to include CreateResponse struct for improved response management.
…nagement. Introduce background processing for chat with AI, enhancing responsiveness and client handling. Update assistant initialization logic to streamline the creation of OpenAI assistants and ensure proper error handling. Modify message struct to support structured error responses, improving clarity in communication. Additionally, clean up unused code and enhance overall maintainability of the assistant management system.
…or file uploads and enhancing assistant management. Introduce handleUpload method to process file uploads, including size and type validation. Update context to include upload information and refactor assistant selection logic for improved clarity. Enhance error handling and response structure for file upload operations, ensuring robust communication of success and failure states.
- Introduced a new endpoint for downloading files, enhancing the API's capabilities. - Implemented the handleDownload method to manage download requests, including validation for required parameters (sid and file_id). - Updated the Download method in the assistant interface to retrieve files based on file_id, ensuring proper error handling and response structure. - Enhanced file upload logic to include file extensions in generated IDs for better file management. - Added necessary response headers for file downloads, improving user experience during file retrieval.
- Introduced a NewQuery method to streamline query creation, enhancing code readability and maintainability. - Updated multiple methods (UpdateChatTitle, GetChats, GetHistory, SaveHistory, GetRequest, SaveRequest, clean) to utilize the new query method, reducing redundancy in query table references. - Improved overall structure of the conversation management code by centralizing query logic.
- Introduced new endpoints for retrieving chat details and mentions, enhancing the API's functionality. - Implemented handleChatDetail method to fetch details of a specific chat by ID, including error handling for missing parameters. - Added handleMentions method to retrieve mentions based on keywords, improving user interaction with chat content. - Updated existing GetChats method to support keyword filtering, allowing for more refined chat list retrieval. - Enhanced the DSL structure to include new methods for managing mentions and chat details, improving overall code organization and maintainability.
- Introduced a new endpoint for updating chat details, allowing users to modify chat titles via the handleChatUpdate method. - Implemented error handling for missing session IDs and chat IDs, ensuring robust validation of input parameters. - Enhanced existing API structure by adding status, chat list, chat detail, history, file upload, download, and mentions endpoints, improving overall API usability. - Improved code organization and maintainability by clearly defining new methods for handling chat updates and related functionalities.
… in Neo API - Updated handleChatUpdate method to include content field in the request body, allowing for dynamic chat title generation based on user input. - Implemented GenerateChatTitle method to create a concise title for chats, improving user experience and interaction. - Modified JSON response structure in handleChatDetail and handleChatUpdate methods for better clarity and consistency. - Enhanced error handling for chat updates, ensuring robust validation and feedback for users.
…etrieval in Xun - Introduced a new UserField in the Setting struct to allow customization of the user ID field name. - Implemented getUserID method in Xun to retrieve user IDs based on the configured UserField, improving flexibility in user identification. - Updated multiple methods (UpdateChatTitle, GetChats, GetHistory, SaveHistory, GetRequest, SaveRequest, GetChat) to utilize the new user ID retrieval logic, ensuring consistent handling of user sessions. - Enhanced error handling for user ID retrieval, ensuring robust feedback in case of issues.
- Updated GetChats method across conversation implementations to accept a ChatFilter struct, enabling keyword filtering, pagination, and ordering. - Enhanced handleChatList method in the Neo API to construct a filter from query parameters, improving the flexibility of chat retrieval. - Introduced new types (ChatFilter, ChatGroup, ChatGroupResponse) to facilitate structured responses and better organization of chat data. - Improved error handling and response structure for chat retrieval, ensuring robust feedback and clarity in API responses.
- Implemented DeleteChat and DeleteAllChats methods in Mongo, Redis, Weaviate, and Xun conversation handlers to allow users to delete specific chats and all chats associated with their account. - Updated the Conversation interface in types.go to include the new deletion methods, ensuring consistent API across different storage backends. - Added unit tests for DeleteChat and DeleteAllChats methods in xun_test.go to verify functionality and ensure proper deletion of chat histories. - Enhanced error handling in deletion methods to provide robust feedback during chat removal operations.
- Introduced new API endpoints for deleting individual chats and clearing all chats for a user, enhancing chat management capabilities. - Implemented handleChatDelete and handleChatsDeleteAll methods to process deletion requests, including error handling for missing session and chat IDs. - Updated API router to register new endpoints under the 'dangerous' path, ensuring clear separation of critical operations. - Enhanced overall API structure and maintainability by adding robust feedback mechanisms for deletion operations.
- Updated GetChats method to filter out empty chat IDs, ensuring only valid chats are processed. - Improved date handling by refining the logic for grouping chats into "This Week" and "Last Week" categories. - Enhanced error handling for created_at field parsing, supporting multiple date formats for better robustness. - Streamlined chat grouping logic for clearer organization of chat data in responses.
- Added time-based generation of chat IDs when not provided, improving chat session management. - Updated context handling in handleChat to ensure valid chat IDs are used. - Expanded allowed HTTP methods in CORS headers to include DELETE, enhancing API flexibility. - Removed redundant chat history saving logic from GenerateChatTitle method, streamlining chat processing.
- Convert keywords to lowercase for case-insensitive matching in handleMentions method. - Introduce test data for mentions to improve testing and demonstration of functionality. - Implement filtering of mentions based on keywords, allowing users to retrieve relevant mentions more effectively. - Append test mentions to actual mentions before returning the response, enhancing the API's usability.
- Updated the golang.org/x/net dependency from v0.27.0 to v0.33.0 in go.mod. - Updated the corresponding checksums in go.sum to reflect the new version.
Thank you for the PR! The db: MySQL8.0 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL8.0 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL8.0 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL8.0 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
1 similar comment
Thank you for the PR! The db: MySQL8.0 redis: 5 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL8.0 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 6 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: SQLite3 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
Thank you for the PR! The db: MySQL5.7 redis: 4 mongo: 6.0 test workflow is running, the results of the run will be commented later. |
✨DONE✨ db: SQLite3 redis: 5 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 5 mongo: 6.0 passed. |
✨DONE✨ db: MySQL8.0 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: SQLite3 redis: 5 mongo: 6.0 passed. |
✨DONE✨ db: SQLite3 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: SQLite3 redis: 4 mongo: 6.0 passed. |
✨DONE✨ db: SQLite3 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: SQLite3 redis: 4 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 5 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 4 mongo: 6.0 passed. |
✨DONE✨ db: MySQL8.0 redis: 4 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 4 mongo: 6.0 passed. |
✨DONE✨ db: MySQL8.0 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: MySQL8.0 redis: 5 mongo: 6.0 passed. |
1 similar comment
✨DONE✨ db: MySQL8.0 redis: 5 mongo: 6.0 passed. |
✨DONE✨ db: MySQL5.7 redis: 6 mongo: 6.0 passed. |
✨DONE✨ db: MySQL8.0 redis: 4 mongo: 6.0 passed. |
No description provided.