Commit graph

6 commits

Author SHA1 Message Date
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
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
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
e7185aad10 Enhance Neo API assistant with function support and improved message handling
- 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.
2025-01-15 11:20:55 +08:00
Max
4530aeab2f Improve neo error messages 2023-05-15 19:59:35 +08:00
Max
7ee7de96c9 [add] Neo (70%) 2023-04-30 14:21:45 +08:00