Commit graph

2093 commits

Author SHA1 Message Date
Max
b50a2d4268
Merge pull request #841 from trheyi/main
Enhance error handling and message processing in Neo API assistant
2025-01-30 16:13:10 +08:00
Max
24b1d11528 Enhance error handling and message processing in Neo API assistant
- Added support for parsing and handling pending and error messages in stream processing
- Improved error message extraction and writing for better error visibility
- Updated message type handling to capture and process raw error messages
- Introduced more flexible input parsing in withHistory and execute methods
- Added environment variable support for connector configuration in assistant loading

This change improves the robustness of error handling and message processing in the Neo API assistant, providing more comprehensive error reporting and input flexibility.
2025-01-30 16:11:29 +08:00
Max
86b88387a0
Merge pull request #840 from trheyi/main
Improve message filtering in Neo API assistant stream processing
2025-01-29 16:45:36 +08:00
Max
bc662d95fa Improve message filtering in Neo API assistant stream processing
- Added filtering for 'function' type messages in requestMessages method
- Removed debug print statement in streamChat method
- Enhanced message handling to ignore function call messages during processing

This change refines the message filtering logic in the Neo API assistant, improving the clarity and efficiency of message stream processing.
2025-01-29 16:14:43 +08:00
Max
4911aa5a5f
Merge pull request #839 from trheyi/main
Enhance Neo API assistant with improved message handling and hook sup…
2025-01-29 16:14:37 +08:00
Max
63807e1944 Enhance Neo API assistant with improved message handling and hook support
- Updated HookCreate to support extended timeout and input message parsing
- Modified CreateResponse to include optional input messages
- Refactored assistant hooks to improve context and message handling
- Added support for more flexible streaming and done hook processing
- Adjusted timeout contexts and method signatures for better error management

This change improves the Neo API assistant's flexibility and robustness in handling complex message interactions and hook scenarios.
2025-01-29 16:05:36 +08:00
Max
364d2fbde3
Merge pull request #838 from trheyi/main
Add support for filtering assistants by multiple IDs and enhance test…
2025-01-29 10:58:07 +08:00
Max
4164f082e9 Add support for filtering assistants by multiple IDs and enhance test coverage
- Added `AssistantIDs` field to `AssistantFilter` to support filtering by multiple assistant IDs
- Updated `GetAssistants` and `DeleteAssistants` methods to handle multiple assistant ID filtering
- Expanded test cases to verify multi-ID filtering, selection, and deletion functionality
- Simplified and improved test data generation and cleanup processes

This change provides more flexible assistant retrieval and management capabilities in the Neo API.
2025-01-29 10:57:29 +08:00
Max
73d6f6994e
Merge pull request #837 from trheyi/main
Add assistant match functionality with RAG and store support
2025-01-27 11:55:21 +08:00
Max
f14120c446 Add assistant match functionality with RAG and store support
- Implemented `processAssistantMatch` method to handle assistant matching requests
- Added support for limit parameter with default and maximum values
- Introduced `forceStore` flag to control matching method (RAG or store)
- Created placeholder methods `assistantMatchRAG` and `assistantMatchStore`
- Enhanced OpenAI message handling to parse error responses
- Updated message type handling to include error messages

This change adds flexible assistant matching capabilities with initial infrastructure for RAG and store-based matching.
2025-01-27 11:54:39 +08:00
Max
68d0f264fd
Merge pull request #836 from YaoApp/revert-835-revert-834-main
Revert "Revert "Add RAG and Version support to Assistant context and …
2025-01-26 17:06:12 +08:00
Max
069105d7bd
Revert "Revert "Add RAG and Version support to Assistant context and options"" 2025-01-26 17:05:10 +08:00
Max
bec72b2f51
Merge pull request #835 from YaoApp/revert-834-main
Revert "Add RAG and Version support to Assistant context and options"
2025-01-26 17:03:41 +08:00
Max
b9c89127b6
Revert "Add RAG and Version support to Assistant context and options" 2025-01-26 17:03:06 +08:00
Max
5033b7599e
Merge pull request #834 from trheyi/main
Add RAG and Version support to Assistant context and options
2025-01-26 17:02:23 +08:00
Max
3c38e968f8 Add RAG and Version support to Assistant context and options
- Introduced Version and RAG flags in the Context struct to support advanced assistant features
- Updated Execute method to set RAG and Version context properties
- Enhanced withOptions method to conditionally add custom options and tools
- Modified HookInit to pass options parameter, improving hook flexibility

This change improves the Assistant's configurability and supports more dynamic assistant interactions.
2025-01-26 17:01:03 +08:00
Max
826c728a02
Merge pull request #833 from trheyi/main
Refactor Neo initialization methods to use global Neo instance
2025-01-26 16:43:04 +08:00
Max
86d4ea71cc Refactor Neo initialization methods to use global Neo instance
- Converted initialization methods from receiver methods to package-level functions
- Simplified method calls by directly using the global Neo instance
- Removed redundant method receiver references in initialization logic
- Improved code readability and reduced unnecessary method complexity

This change streamlines the Neo initialization process and makes the code more straightforward and maintainable.
2025-01-26 16:42:31 +08:00
Max
2f230b007a
Merge pull request #832 from trheyi/main
Enhance tag parsing flexibility in Assistant loading
2025-01-26 15:55:35 +08:00
Max
d8b070338f Enhance tag parsing flexibility in Assistant loading
- Improved tag handling in loadMap to support multiple input types
- Added support for parsing tags from []interface{}, string, and other JSON-compatible formats
- Utilized jsoniter for robust type conversion and marshaling
- Increased robustness of tag loading process for diverse input scenarios

This change enhances the flexibility of tag parsing during Assistant initialization, allowing more versatile data input methods.
2025-01-26 15:55:10 +08:00
Max
445f4eb9ee
Merge pull request #831 from trheyi/main
Add latest chat retrieval endpoint to Neo API
2025-01-25 15:43:13 +08:00
Max
2a5ccb0e2d Add latest chat retrieval endpoint to Neo API
- Implemented a new `/chats/latest` endpoint to fetch the most recent chat or generate a placeholder
- Added `handleChatLatest` method in the DSL to support retrieving the latest chat for a given session
- Introduced `GetPlaceholder()` method in the Assistant interface to support placeholder generation
- Enhanced API flexibility by allowing optional assistant ID specification for placeholder retrieval

This change improves the chat retrieval capabilities of the Neo API, providing a convenient way to access the most recent chat or generate a starting point for new conversations.
2025-01-25 15:42:51 +08:00
Max
ee09cfeb23
Merge pull request #830 from trheyi/main
Add Placeholder support for Assistants in Neo API
2025-01-25 14:04:20 +08:00
Max
f75e5a5fbe Add Placeholder support for Assistants in Neo API
- Introduced a new Placeholder struct to provide additional metadata for assistants
- Updated Assistant struct to include an optional Placeholder field
- Modified loading and mapping methods to handle Placeholder data
- Extended database schema and test cases to support Placeholder functionality

This enhancement provides a flexible way to add descriptive metadata to assistants, improving their discoverability and configuration.
2025-01-25 14:03:45 +08:00
Max
f4c9071f42
Merge pull request #829 from trheyi/main
Update message handling to ignore 'action' messages in Neo API assistant
2025-01-23 18:18:22 +08:00
Max
b679771232 Update message handling to ignore 'action' messages in Neo API assistant
- Modified the message handling logic to include 'action' messages in the ignore list alongside 'loading' and 'error' messages, improving the clarity of message processing.
- This change enhances the robustness of the Neo API assistant by ensuring that irrelevant message types are not processed, streamlining the overall message handling workflow.
2025-01-23 18:15:26 +08:00
Max
eec3a8a285
Merge pull request #828 from trheyi/main
Implement assistant call functionality in Neo API
2025-01-23 16:38:43 +08:00
Max
1f9810c26c Implement assistant call functionality in Neo API
- Added a new endpoint for executing assistant calls via POST request, enhancing the API's capabilities.
- Introduced the handleAssistantCall method to process incoming requests, validate parameters, and execute the assistant's script.
- Updated the Assistant interface to include the Call method, allowing for dynamic method invocation based on the provided payload.
- Enhanced error handling for missing parameters and invalid requests, improving the robustness of the assistant's API interactions.

These changes significantly improve the Neo API assistant's functionality, enabling more interactive and dynamic assistant capabilities.
2025-01-23 16:38:13 +08:00
Max
7137ed4e2c
Merge pull request #827 from trheyi/main
Enhance chat retrieval and update functionality in Xun
2025-01-22 16:53:43 +08:00
Max
979d27b741 Enhance chat retrieval and update functionality in Xun
- Added 'updated_at' field to the chat selection query to include the last modified timestamp in chat responses.
- Updated the ordering of chat results to prioritize 'updated_at' over 'created_at', improving the relevance of displayed chats.
- Modified the handling of chat creation timestamps to fall back on 'created_at' if 'updated_at' is not available, ensuring consistent date representation.
- Implemented an update mechanism for the 'updated_at' field when saving chat history, enhancing data integrity and tracking.

These changes improve the chat management capabilities of the Neo API assistant, ensuring more accurate and relevant chat data retrieval.
2025-01-22 16:52:37 +08:00
Max
a8b82248a2
Merge pull request #826 from trheyi/main
Refactor Neo API assistant message handling and content processing
2025-01-22 16:10:06 +08:00
Max
1404c549a7 Refactor Neo API assistant message handling and content processing
- Enhanced message generation by introducing NewHistory and NewContent methods for improved handling of message content and history.
- Updated the withHistory method to utilize the new NewHistory method, streamlining the addition of historical messages.
- Improved the call method to conditionally save message history based on input parameters, enhancing flexibility in message management.
- Refactored the String method in the Message struct to better represent message types and properties, improving serialization consistency.

These changes enhance the maintainability and robustness of the Neo API assistant, paving the way for improved message handling and content processing.
2025-01-22 16:09:01 +08:00
Max
839f3bb439
Merge pull request #825 from trheyi/main
Enhance Neo API assistant with improved content handling and hook int…
2025-01-22 11:39:27 +08:00
Max
1eba627e38 Enhance Neo API assistant with improved content handling and hook integration
- Updated the Assistant methods to include a new Contents parameter in HookInit, HookStream, HookDone, and HookFail, improving message context management.
- Refactored handleChatStream to utilize the new Contents structure, enhancing the clarity and efficiency of chat interactions.
- Introduced new methods in the Contents struct for better type management and properties handling, streamlining message processing.
- Updated the Message struct to support new content types and properties, improving the overall message structure and serialization.

These changes enhance the maintainability and robustness of the Neo API assistant, paving the way for improved message handling and assistant functionalities.
2025-01-22 11:38:37 +08:00
Max
e54333a2fc
Merge pull request #824 from trheyi/main
Update Message struct to improve JSON serialization
2025-01-21 16:49:01 +08:00
Max
e3285923e6 Update Message struct to improve JSON serialization
- Renamed the 'is_new' field to 'new' in the Message struct for better clarity and consistency in JSON output.
- This change enhances the maintainability of the Neo API assistant by streamlining the message structure and improving data representation.
2025-01-21 15:11:09 +08:00
Max
8ee8429997
Merge pull request #823 from trheyi/main
Refactor Neo API assistant message handling and content structure
2025-01-19 15:25:49 +08:00
Max
830bbf7a0e Refactor Neo API assistant message handling and data structures
- Updated message appending methods to use AppendTo for improved clarity and consistency.
- Changed output types in HookStream and HookDone methods from string to []message.Data, enhancing data handling capabilities.
- Introduced a new Map method in the Data struct for better representation of message data.
- Streamlined JSON marshaling in the Data struct to ensure accurate data serialization.

These changes enhance the maintainability and robustness of the Neo API assistant, paving the way for improved message handling and data processing.
2025-01-19 15:19:08 +08:00
Max
5d5fa4c270 Refactor Neo API assistant message handling and content structure
- Replaced the Content struct with a new Contents struct to improve message handling and organization.
- Updated methods across the Assistant and Message structs to utilize the new Contents structure, enhancing the clarity and efficiency of message processing.
- Improved error handling by ensuring proper message appending and content management during chat streaming.
- Removed the deprecated Content struct, streamlining the codebase and reducing complexity.

These changes enhance the maintainability and robustness of the Neo API assistant, paving the way for improved message handling and assistant functionalities.
2025-01-19 12:23:23 +08:00
Max
1d9d9b2aa8
Merge pull request #822 from trheyi/main
Refactor call method in Assistant to streamline context handling
2025-01-18 15:30:41 +08:00
Max
5b30ef5fde Refactor call method in Assistant to streamline context handling
- Removed the asynchronous execution of method calls, allowing for direct invocation within the current thread.
- Simplified cancellation handling by eliminating the done channel, improving clarity and reducing complexity in the call method.
- Enhanced error handling by ensuring the script context is checked before method invocation.

These changes improve the maintainability and robustness of the Neo API assistant, paving the way for more efficient method execution and context management.
2025-01-18 15:30:08 +08:00
Max
50faf7ed77 Refactor context handling in Assistant's call method
- Removed the forced closure of the script context upon context cancellation in the call method, improving the handling of script execution and cancellation scenarios.
- This change enhances the robustness of the Neo API assistant by preventing potential issues related to premature context termination, paving the way for more reliable assistant functionalities.
2025-01-18 15:14:27 +08:00
Max
883dd07fb0
Merge pull request #821 from trheyi/main
Enhance Neo API assistant with improved error handling and message st…
2025-01-18 15:02:30 +08:00
Max
e874e8dfb4 Enhance Neo API assistant with improved error handling and message structure
- Added nil check for script context in the call method to prevent potential nil pointer dereference.
- Updated the String method in the Content struct to include additional properties (text and props) for better message representation.

These changes improve the robustness and maintainability of the Neo API, paving the way for enhanced message handling and assistant functionalities.
2025-01-18 15:01:44 +08:00
Max
2726753f54
Merge pull request #820 from trheyi/main
Enhance Neo API assistant message storage and structure
2025-01-18 11:22:52 +08:00
Max
228e8cf482 Enhance Neo API assistant message handling and response structure
- Added nil checks for response objects in the Execute method to prevent potential nil pointer dereferences.
- Updated the streamChat method to include assistant identification details (ID, name, avatar) in the message structure, improving context for messages.
- Introduced a new field in the Message struct to mark messages as new, enhancing message tracking capabilities.

These changes improve the robustness and maintainability of the Neo API, paving the way for better message handling and assistant functionalities.
2025-01-18 11:20:55 +08:00
Max
d43b7b8927 Enhance Neo API assistant message storage and structure
- Removed unused utility imports and streamlined the saveChatHistory method to improve message storage efficiency.
- Updated the Message struct to include new fields for assistant identification and mentions, enhancing message context and traceability.
- Modified the history table structure to accommodate new assistant-related fields and mentions, ensuring comprehensive data storage.
- Improved the SaveHistory method to process and store mentions alongside messages, providing better context for user interactions.

These changes enhance the robustness and maintainability of the Neo API, paving the way for improved message handling and assistant functionalities.
2025-01-18 10:19:17 +08:00
Max
a77cc6cf87
Merge pull request #819 from trheyi/main
# Neo API: Enhance Message Handling and Vision Support
2025-01-17 15:24:18 +08:00
Max
17c18e7d56 Refactor Neo API assistant to enhance vision support and message handling
- Updated the Assistant struct to include a vision capability flag and an init hook indicator, allowing for better management of vision-enabled functionalities.
- Refactored message handling throughout the assistant methods to utilize the chatMessage package, improving consistency and type safety.
- Enhanced the handleVision method to support dynamic vision processing options, including improved handling of image descriptions and uploads.
- Streamlined the requestMessages and withAttachments methods to better accommodate vision capabilities, ensuring proper integration with image handling.
- Improved the initialize method to check for vision support based on the model, enhancing the assistant's adaptability.

These changes improve the robustness and maintainability of the Neo API, paving the way for enhanced assistant functionalities and better integration of vision capabilities.
2025-01-17 15:16:26 +08:00
Max
5e5524293f Refactor Neo API assistant message handling and function integration
- Updated streamChat method to utilize content.Type for function handling, enhancing the interaction with function calls.
- Improved the String method in Content struct to handle function arguments more robustly, including JSON unmarshalling for completed content.
- Set default message type to "text" in NewOpenAI function, ensuring consistent message processing.

These changes enhance the flexibility and maintainability of the Neo API, paving the way for improved assistant functionalities and message management.
2025-01-15 16:35:58 +08:00