- Integrate jsonrepair library to improve JSON parsing resilience
- Replace manual JSON repair attempts with a more comprehensive repair method
- Update go.mod and go.sum to include jsonrepair dependency
- Simplify ParseJSON function with a single repair approach
- Update tool call prompts with more detailed schema and usage guidelines
- Add dynamic tool call examples based on available tools
- Modify message name generation to use assistant ID with underscores
- Improve system message formatting for tool calls
- Simplify tool call prompt generation logic
- Refactor tool call prompts with more detailed guidelines
- Improve message name handling for system and user messages
- Add robust JSON parsing utility with error recovery
- Update debug logging for request messages and tool calls
- Modify tool call extraction in HookDone method for better reliability
- Improve type safety when accessing Neo's assistant
- Use type assertion with ok check to handle potential nil or incorrect type
- Simplify assistant context retrieval in Xgen settings
- Include default assistant information in Xgen settings
- Retrieve assistant details from Neo when available
- Add agent configuration with assistant ID, name, avatar, and deleteable status
- Enhance Xgen settings to support assistant metadata
- Enhance chat API endpoints to include assistant information
- Add support for retrieving and displaying assistant details in chat responses
- Update database schema to store assistant_id in chat table
- Modify GetChats, GetChat, and SaveHistory methods to handle assistant metadata
- Improve test coverage for assistant-related chat functionality
- Completely restructure NewOpenAI method to handle different message types more robustly
- Add support for new ChatCompletionChunk type to parse streaming responses
- Improve error handling and message type detection
- Simplify message processing logic with more explicit type checking
- Remove commented-out legacy code and improve overall readability
- Add support for native tool call streaming with XML-like tags
- Implement stringHash for message name anonymization
- Add debug environment variable for printing request messages
- Remove unused function and arguments fields in message contents
- Modify message type handling for tool calls in streaming chat
- Replace deprecated model "text-davinci-003" with "gpt-3_5-turbo-instruct"
- Comment out deprecated Edits method in tests and implementation
- Enhance HTTP request headers with explicit Content-Type
- Add fallback for model configuration when not explicitly set
- Improve header handling for Azure and standard OpenAI authentication
- Implement Azure OpenAI authentication with `azure` flag in OpenAI struct
- Update HTTP request headers to support Azure API key authentication
- Enhance message parsing to handle additional edge cases in OpenAI responses
- Add debug logging for OpenAI messages when debug environment is set
- Improve error and usage detection in stream message processing
- Add user ID to input name when not explicitly set
- Update stream chat to mark final message as "think" type
- Modify history retrieval to add system prompts after fetching chat history
- Remove debug print statement in message data mapping
- Added `Hidden` flag to `Message` struct for controlling message visibility
- Modified `saveChatHistory` to conditionally save messages based on hidden status
- Simplified stream chat processing by removing debug print statements
- Restructured message output and next action handling in stream chat
- Commented out unused process action execution method
- Added default base URL "/v1" in NewMoapi method
- Supports flexible base URL configuration for OpenAI API client
- Complements previous work on API configuration and streaming improvements
- Implemented handling of reasoning_content in OpenAI message parsing
- Added support for tracking thinking state with `<think>` tags
- Updated message generation to handle delta messages and thinking states
- Modified OpenAI API to support flexible base URL configuration
- Enhanced token scanning and message processing for reasoning content
- Updated ScanTokens method to preserve and reuse existing message IDs
- Modified streaming chat to track and pass current message ID during token scanning
- Ensured consistent message ID generation when not explicitly provided
- Introduced UUID generation for message contents during token scanning
- Updated message and contents methods to support optional ID parameter
- Modified streaming chat processing to include message ID tracking
- Enhanced message parsing and appending with ID preservation
- Removed unnecessary breakpoint and token tracking variables
- Streamlined token scanning and message processing in assistant API
- Simplified text handling and token parsing in contents scanning
- Reduced complexity of stream chat message generation
- Implemented token scanning for 'think' and 'tool' types in stream chat
- Added support for delta message streaming with improved message chunking
- Updated contents handling to remove last empty data and track token states
- Refined message type processing and streaming logic in assistant API
- Modified message appending and type handling to support new streaming approach
- Implemented system prompts for tool calls when connector settings disable native tool handling
- Added JSON-formatted tool list and explicit rules for tool call processing
- Included guidelines for tool call response formatting and function usage
- Preserved existing tool prompts functionality
- Updated `DSL` struct to include `Connectors` with `assistant.ConnectorSetting` type
- Modified `initAssistant()` to set connector settings via `SetConnectorSettings()`
- Adjusted `load.go` and `types.go` to support new connector settings configuration
- Implemented connector-specific tool and vision handling in assistant methods
- Renamed `Functions` to `Tools` across multiple files
- Added `ConnectorSetting` to support vision and tools flags
- Updated loading and serialization logic for tools
- Modified message contents handling for better JSON parsing
- Adjusted test cases to reflect tool-related changes
- Enhanced error handling in OpenAI message processing
- Added colored console output for JSON parsing errors
- Updated Error struct to support flexible code type
- Improved message type and done state setting for various error scenarios
- Added support for parsing different error message formats
- Implemented `select` parameter parsing in `parseAssistantFilter`
- Added support for selecting fields via string, string array, or interface array
- Enhanced `neo/process.go` to handle flexible field selection
- Improved error handling in stream chat processing
- Fixed function message handling in message appending
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.