Commit graph

58 commits

Author SHA1 Message Date
Max
7f9307dbdd Add chat deletion functionality across conversation implementations
- 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.
2024-12-17 10:27:44 +08:00
Max
9db67a2456 Refactor chat retrieval in Neo API to support filtering and pagination
- 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.
2024-12-17 10:18:37 +08:00
Max
f666070bb3 Add user field support in conversation settings and enhance user ID retrieval 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.
2024-12-17 09:54:57 +08:00
Max
b3bc843235 Enhance chat update functionality and introduce chat title generation 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.
2024-12-16 19:59:23 +08:00
Max
869ed3717a Add chat update functionality and enhance API endpoints in Neo API
- 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.
2024-12-16 17:46:17 +08:00
Max
eadc550980 Add chat detail and mentions handling in Neo API
- 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.
2024-12-16 17:36:02 +08:00
Max
2da7c30ac5 Refactor query handling in Xun conversation management
- 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.
2024-12-16 12:37:11 +08:00
Max
b34f97ac2a Add file download functionality to Neo API
- 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.
2024-12-16 11:07:22 +08:00
Max
3fbcd4a5e1 Add support for JSON file type in AllowedFileTypes across assistant modules 2024-12-15 09:54:18 +08:00
Max
773e050925 Implement file upload functionality in Neo API, adding new endpoint for 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. 2024-12-14 19:39:14 +08:00
Max
c98a402e54 Refactor Neo API chat handling to improve AI interaction and error management. 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. 2024-12-14 17:45:40 +08:00
Max
c8643bbe45 Refactor HookCreate and assistant management in Neo API to improve response 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. 2024-12-14 14:53:01 +08:00
Max
6c244d8788 Refactor Neo API to enhance CORS handling and streamline endpoint registration. 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. 2024-12-14 13:03:05 +08:00
Max
79ee5b75f9 Refactor error handling in Neo API to streamline message creation. Replace 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. 2024-12-13 19:49:54 +08:00
Max
2ebc29d6f7 Enhance Neo API and conversation management by adding support for server-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. 2024-12-13 17:51:13 +08:00
Max
1c078a5d2e Refactor Neo DSL tests and API structure by removing unused handlers, 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. 2024-12-13 11:17:00 +08:00
Max
de7f5fc9b1 Enhance NewContext function to include ChatID parameter for improved context management 2024-12-12 20:21:02 +08:00
Max
153efc1a49 Refactor command handling and conversation management by removing the command package, updating conversation methods to support chat IDs, and enhancing API functionality for chat history and titles. This includes adjustments to the DSL context and conversation settings for improved data handling. 2024-12-12 16:37:59 +08:00
Max
91091b8dc2 Enhance JSON message handling with improved error reporting and response writing 2024-11-07 14:37:40 +08:00
Max
6450fd49e8 Refactor Neo message handling to use gin.ResponseWriter and improve error management 2024-11-07 08:40:15 +08:00
Max
15fb961ad0 Refactor Neo execution methods to improve error handling and streamline message preparation 2024-11-06 20:27:16 +08:00
Max
61a292c7a6 Neo initialization to enable ‘moapi’ connector and default model support 2024-11-05 16:06:32 +08:00
Max
953d592669 feat: Integrate AIGC & OpenAI with Moapi service 2024-07-30 16:59:13 +08:00
Max
1f4e9e5a16 feat: Add SelectModel command to DSL
Add the SelectModel command to the DSL, allowing the selection of a specific model. This command takes a model name as input and sets the AI to use that model. It returns a success message with a status code of 200 if the selection is successful.
2024-05-25 20:17:25 +08:00
Max
7c3fdbe096 Refactor bridge functions in request.go 2023-12-26 03:07:30 +08:00
Max
59dfe49302 [add] neo local model support 2023-12-01 00:05:57 +08:00
Max
c19d4b0534 [add] moapi process and api 2023-11-10 01:37:09 +08:00
Max
b479bd3ff3 [add] Neo context signal 2023-10-25 01:21:48 +08:00
Max
ff74842053 [add] neo content 2023-10-25 00:50:43 +08:00
Max
c6c5784ffb [add] Neo context namespace 2023-10-25 00:25:19 +08:00
Max
9e88507e83 [change] neo context type 2023-10-21 00:57:38 +08:00
Max
ef941450ac [_] 2023-10-20 14:24:28 +08:00
Max
bd518610b9 [add] neo custom write process 2023-10-20 13:59:44 +08:00
Max
1b8afda828 [change] Neo history api 2023-10-20 11:07:36 +08:00
Max
5a3d42a965 fix CROS bug 2023-09-21 11:32:03 +08:00
Max
deefe6db70 [add] Neo prepare match sid support 2023-08-04 17:14:09 +08:00
Max
b477a29403 Optimize Neo the prepare prompts 2023-05-24 13:45:43 +08:00
Max
e722144329 [add] __neo.ExecCommand service 2023-05-16 20:45:25 +08:00
Max
4530aeab2f Improve neo error messages 2023-05-15 19:59:35 +08:00
Max
307f70873a [fix] neo command parser bug 2023-05-14 01:28:13 +08:00
Max
5fbf84bf8e [fix] Neo api guard 2023-05-13 11:23:16 +08:00
Max
5e46dc74f5 [add] Neo prepare hook 2023-05-12 17:28:33 +08:00
Max
9a37b1c72b [add] Neo Get all commands api 2023-05-12 13:42:01 +08:00
Max
4bb5fca430 [add] Neo enter command mode by typing the /name 2023-05-12 13:20:09 +08:00
Max
6e17bdce71 [fix] neo command request bug 2023-05-10 20:24:09 +08:00
Max
522380511d [add] Neo studio api 2023-05-08 18:42:50 +08:00
Max
331a7defd8 [add] Neo (100%) 2023-05-06 00:13:23 +08:00
Max
0f70639292 [add] Neo Command ( 50% ) 2023-05-05 22:07:12 +08:00
Max
f620ddfc60 [add] Neo command prepare hook 2023-05-05 11:04:54 +08:00
Max
2a04074a82 [add] Neo Exit Command Mode & History API 2023-05-04 05:31:01 +08:00