- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Added function support and action execution capabilities to Neo API assistant, improving its flexibility and robustness. Key updates include function management, enhanced message handling, and improved error validation.
- Introduced a new Function type to define assistant functions, enhancing the assistant's capabilities.
- Updated the Assistant struct to include a Functions field, allowing for dynamic function management.
- Refactored the streamChat method to handle tool calls, improving interaction with functions during chat streaming.
- Enhanced message handling in the NewOpenAI function to support tool call responses, ensuring proper message parsing.
- Implemented loading and saving of functions from a JSON file, streamlining function management within the assistant.
These changes improve the robustness and maintainability of the Neo API, paving the way for more flexible and powerful assistant functionalities.
- Introduced a new Execute method for handling next actions in the Assistant struct, allowing for dynamic execution of various actions such as "process" and "assistant".
- Improved error handling by validating payloads and providing meaningful error messages for missing or incorrect data.
- Streamlined the flow of next actions in the Execute method, enhancing the assistant's ability to manage complex interactions and responses.
- Updated the streamChat method to utilize the new Execute method, improving the handling of next actions during chat streaming.
These changes enhance the robustness and maintainability of the Neo API, paving the way for more flexible and powerful assistant functionalities.
- Commented out the message writing logic in the streamChat method to prevent unintended output when the message is marked as done.
- This change enhances the control over the response flow, allowing for better integration with the newly introduced hook methods for managing assistant interactions.
These modifications contribute to the overall robustness and maintainability of the Neo API, aligning with recent enhancements in assistant functionalities.
- Introduced HookDone and HookFail methods to manage completion and failure scenarios in assistant responses, improving error handling and output customization.
- Updated streamChat method to utilize these hooks, allowing for more flexible response management based on the assistant's output and error states.
- Enhanced ResHookDone and ResHookFail structs to include next action handling, input messages, and error information, providing better control over assistant interactions.
These changes improve the robustness and maintainability of the Neo API, paving the way for enhanced assistant functionalities and message management.
- Added message handling in the Execute method to support input messages from the response.
- Updated the handleChatStream method to pass the context to the streamChat method, improving context management during chat streaming.
- Introduced the HookStream method to handle streaming responses, allowing for custom output and next action handling based on the assistant's response.
- Enhanced the ResHookStream struct to include silent output control and next action management, providing better flexibility in assistant interactions.
These changes improve the robustness and maintainability of the Neo API, paving the way for enhanced assistant functionalities and message management.
- Updated the Answer method to utilize the new Execute method, simplifying the assistant interaction process.
- Introduced a new Execute method in the Assistant struct to encapsulate the chat execution logic, enhancing clarity and maintainability.
- Refactored the HookInit method to accept input messages and options, improving the initialization process for assistants.
- Enhanced the ResHookInit struct to include next action handling and input messages, providing better control over assistant responses.
- Removed obsolete chat handling methods, streamlining the codebase and improving overall structure.
These changes improve the robustness and maintainability of the Neo API, paving the way for future enhancements in assistant functionalities and message management.
- Updated the Answer method to utilize the new withHistory function, improving message retrieval and context management.
- Refactored the chat method to accept a slice of message.Message instead of a map, enhancing type safety and clarity.
- Introduced a new withHistory function to streamline the process of retrieving chat history and user messages, improving maintainability.
- Enhanced the HookInit method to accept a gin.Context, allowing for better context handling during assistant initialization.
- Updated the assistant API interface to reflect changes in message handling, ensuring consistency across the codebase.
These changes improve the robustness and maintainability of the Neo API, paving the way for future enhancements in assistant functionalities and message management.
- Updated the Answer method to improve assistant initialization by directly calling the new HookInit method, streamlining the process of selecting and initializing assistants based on context.
- Introduced ResHookInit struct to encapsulate the response from the assistant initialization hook, enhancing clarity and maintainability.
- Enhanced the context package by adding a Map method to facilitate easier mapping of context data, improving the overall structure of context management.
- Refactored the assistant interface to include the new HookInit method, ensuring a consistent approach to assistant interactions.
These changes improve the robustness and maintainability of the Neo API, paving the way for future enhancements in assistant functionalities and context management.
- Replaced the custom context creation functions with a new context package, enhancing consistency and maintainability across the API.
- Updated multiple methods in the DSL to utilize the new context package, ensuring a unified approach to context management.
- Removed the obsolete context.go file, streamlining the codebase and reducing redundancy.
These changes improve the overall structure and clarity of the Neo API, paving the way for future enhancements in context handling and assistant functionalities.
- Updated the TestUpload and TestUploadWithRAG functions to remove unnecessary parameters and improve clarity.
- Enhanced RAG handling by adding options for enabling/disabling RAG processing during file uploads.
- Improved test cases for RAG functionality, ensuring proper indexing behavior based on RAG settings.
- Refactored vision-related tests to include options for enabling/disabling vision processing, ensuring accurate responses based on the model capabilities.
- Streamlined the setup of test assistants to simplify the testing process.
These changes improve the maintainability and clarity of the attachment handling code, paving the way for better functionality in file uploads and processing.