Commit graph

2140 commits

Author SHA1 Message Date
Max
13bc93fe0b
Merge pull request #862 from trheyi/main
Improve tool call parsing and formatting
2025-02-10 11:24:02 +08:00
Max
617893a579 Improve tool call parsing and formatting
- Refine tool call text extraction in HookDone method
- Add URL decoding for JSON-encoded tool call arguments
- Enhance error handling for tool call parsing
- Modify tool call tag handling in streaming chat
2025-02-10 11:13:59 +08:00
Max
12e15e6bc8
Merge pull request #861 from trheyi/main
Fix assistant context switching and ID handling
2025-02-09 18:35:32 +08:00
Max
8f57c38b26 Refactor assistant type assertion in Xgen processing
- 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
2025-02-09 18:26:51 +08:00
Max
dc6967805e Fix assistant context switching and ID handling
- Prevent switching to an empty assistant ID
- Update context assistant ID during execution
- Ensure proper assistant context management in chat flow
2025-02-09 18:25:09 +08:00
Max
b841dbc24f
Merge pull request #860 from trheyi/main
Add default assistant details to Xgen settings
2025-02-09 17:58:50 +08:00
Max
ccb1c54927 Add default assistant details to 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
2025-02-09 17:58:23 +08:00
Max
e4375ea33a
Merge pull request #859 from trheyi/main
Add assistant details to chat API responses
2025-02-09 16:54:52 +08:00
Max
4ba27390d8 Add assistant details to chat API responses
- 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
2025-02-09 16:54:20 +08:00
Max
1556f3c790
Merge pull request #858 from trheyi/main
Remove debug print statement in OpenAI message parsing
2025-02-09 10:09:45 +08:00
Max
5be65d91cd Remove debug print statement in OpenAI message parsing
- Remove unnecessary debug print of arguments and finish reason
- Maintain clean and concise message processing logic
- Align with previous refactoring efforts to simplify code
2025-02-09 10:08:51 +08:00
Max
dafb18109a
Merge pull request #857 from trheyi/main
Refactor OpenAI message parsing for improved streaming support
2025-02-09 09:47:37 +08:00
Max
38ee806cff Refactor OpenAI message parsing for improved streaming support
- 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
2025-02-09 09:46:41 +08:00
Max
c575bd9d9d
Merge pull request #856 from trheyi/main
Enhance tool call handling and message processing
2025-02-08 18:11:29 +08:00
Max
142b07b0ce Enhance tool call handling and message processing
- 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
2025-02-08 18:09:26 +08:00
Max
ed4553f155
Merge pull request #855 from trheyi/main
Update OpenAI test and API configuration
2025-02-08 16:01:12 +08:00
Max
a278c4c63a Update OpenAI test and API configuration
- 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
2025-02-08 15:59:46 +08:00
Max
321f1c22e1
Merge pull request #854 from trheyi/main
Add Azure OpenAI support and improve message parsing
2025-02-08 11:18:57 +08:00
Max
a7a05fbec8 Add Azure OpenAI support and improve message parsing
- 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
2025-02-08 11:18:06 +08:00
Max
b77a0d31b7
Merge pull request #853 from trheyi/main
Enhance message processing and user identification
2025-02-07 10:31:04 +08:00
Max
b19c5d63ff Enhance message processing and user identification
- 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
2025-02-07 10:30:12 +08:00
Max
c338086a6f
Merge pull request #852 from trheyi/main
Refactor chat history and message processing
2025-02-06 16:40:47 +08:00
Max
dabba1a744 Refactor chat history and message processing
- 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
2025-02-06 16:39:31 +08:00
Max
47ea370410
Merge pull request #851 from trheyi/main
Refactor streaming chat and message processing
2025-02-06 14:22:31 +08:00
Max
d69370551a Refactor streaming chat and message processing
- Updated NextAction execution to send loading message and create new contents
- Disabled stream hook temporarily to simplify message handling
- Modified HookDone to filter and parse tool call messages
- Removed debug print statements and simplified message generation
- Improved message content processing during stream chat
2025-02-06 14:21:29 +08:00
Max
3507963ed3
Merge pull request #850 from trheyi/main
Configure base URL for OpenAI API initialization
2025-02-06 09:26:28 +08:00
Max
9c0ab4e0e1 Configure base URL for OpenAI API initialization
- 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
2025-02-06 09:19:10 +08:00
Max
f349019cb3
Merge pull request #849 from trheyi/main
Add support for reasoning content and thinking state in OpenAI streaming
2025-02-05 16:55:42 +08:00
Max
96f4b5e55a Add support for reasoning content and thinking state in OpenAI streaming
- 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
2025-02-05 16:55:09 +08:00
Max
01c39e6bbc
Merge pull request #848 from trheyi/main
Streaming Chat Processing Improvements
2025-02-04 19:24:53 +08:00
Max
5a38cf77c1 Improve message ID tracking in streaming chat processing
- 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
2025-02-04 19:22:45 +08:00
Max
75d55ae13b Add unique ID tracking for message contents and streaming
- 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
2025-02-04 17:17:24 +08:00
Max
991c884d78 Simplify token scanning and streaming logic in chat processing
- 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
2025-02-03 19:24:52 +08:00
Max
b19a6b953a Enhance streaming chat processing with token parsing and delta message handling
- 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
2025-02-03 15:46:25 +08:00
Max
03f7fd6ca2
Merge pull request #847 from trheyi/main
Refine tool call system prompt formatting and connector settings hand…
2025-02-02 16:04:22 +08:00
Max
941593b6ef Refine tool call system prompt formatting and connector settings handling
- Improved tool call system prompt with more precise formatting guidelines
- Simplified connector settings check logic in tool call processing
- Enhanced readability and specificity of tool call response rules
- Maintained existing functionality while clarifying prompt instructions
2025-02-02 16:03:43 +08:00
Max
44b77fdacf
Merge pull request #846 from trheyi/main
Add tool call system prompts for connectors without native tool support
2025-02-01 19:09:05 +08:00
Max
a12259429c Add tool call system prompts for connectors without native tool support
- 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
2025-02-01 19:05:49 +08:00
Max
2e8a13033e
Merge pull request #845 from trheyi/main
Add connector settings support in DSL and assistant initialization
2025-02-01 17:45:44 +08:00
Max
741a650517 Add connector settings support in DSL and assistant initialization
- 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
2025-02-01 17:45:01 +08:00
Max
465a3fcb36
Merge pull request #844 from trheyi/main
Refactor assistant types and tools support
2025-02-01 17:05:39 +08:00
Max
455e39fa54 Refactor assistant types and tools support
- 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
2025-02-01 17:04:45 +08:00
Max
6ac0406ad4 Improve OpenAI message parsing and error handling
- 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
2025-02-01 11:26:11 +08:00
Max
c5a9d8e018
Merge pull request #843 from trheyi/main
Add support for field selection in assistant filtering
2025-01-31 11:03:11 +08:00
Max
54e946c61d Add support for field selection in assistant filtering
- 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
2025-01-31 11:02:31 +08:00
Max
eb814dab05
Merge pull request #842 from trheyi/main
Update Go module dependencies and clean up go.mod and go.sum
2025-01-30 16:26:14 +08:00
Max
88250e5f77 Update Go module dependencies and clean up go.mod and go.sum
- Added github.com/spf13/cast as an explicit dependency
- Removed redundant indirect comment for spf13/cast
- Added github.com/frankban/quicktest to go.sum
- Updated kr/text dependency references
2025-01-30 16:25:50 +08:00
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