-
Notifications
You must be signed in to change notification settings - Fork 63
feat: gpt-5.2, refactored streaming, improved md rendering, basic tools #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduced a new modelConfig struct to encapsulate model details including API key requirements. - Expanded the list of supported models with various configurations, including pricing and context limits. - Updated ListSupportedModels method to dynamically generate model responses based on user API key availability, marking models as disabled when necessary. - Added disabled and disabled_reason fields to the SupportedModel message in proto definitions for better client handling.
- Added HandleAssistantPartBegin to ensure the frontend prepares for assistant messages before receiving content, addressing models that send reasoning before content. - Updated HandleTextDoneItem to include reasoning content when sending the final message. - Introduced HandleReasoningDelta to manage reasoning chunks separately during streaming.
- Introduced a new rule for @typescript-eslint/no-unused-vars to enforce error reporting on unused variables, allowing exceptions for variables and arguments that start with an underscore.
- Added new styles for chat message components and tool cards. - Integrated Streamdown for enhanced markdown rendering, replacing the previous Markdown component. - Improved responsiveness and visual consistency across message boxes and actions.
…feature - Implemented auto-collapse functionality for reasoning content based on message state. - Updated GeneralToolCard to support external collapse state and auto-scroll behavior. - Refactored ErrorToolCard to utilize GeneralToolCard for consistent error display. - Improved message rendering logic for better user experience.
- Updated MessageCard component to utilize the new DisplayMessage type for improved message handling. - Refactored useSendMessageStream hook to streamline message streaming logic and reduce dependencies. - Introduced a unified message store to consolidate message state management, enhancing the overall architecture. - Added message converters for bidirectional transformation between API and internal message types. - Removed deprecated streaming message store and related handlers to simplify the codebase. - Enhanced chat components to leverage the new message store and improve rendering efficiency.
- Moved the @typescript-eslint/no-unused-vars rule to a new position in the ESLint configuration for better organization. - Maintained the existing settings that allow exceptions for variables and arguments starting with an underscore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to model selection, streaming response handling, and tool registration in the chat system, along with prompt updates and minor bug fixes. The most important changes are grouped below by theme:
Model Selection and Configuration:
ListSupportedModelsto use a unifiedmodelConfigstruct and a single source of truth (allModels), supporting more models and dynamic disabling based on user API key presence. Models requiring a user-provided API key are now marked as disabled if the user hasn’t configured one. (internal/api/chat/list_supported_models_v2.go)Streaming Response Handling:
StreamPartBeginis sent before any assistant content (including reasoning), and enhanced reasoning content handling for models that may send it before regular content. The handler now supports bothreasoning_contentandreasoningfields, and passes both answer and reasoning to the text done handler. (internal/services/toolkit/client/completion_v2.go) [1] [2] [3]Tool Registration and Toolkit Initialization:
internal/services/toolkit/client/utils_v2.go)Prompt and Instruction Updates:
<PaperDebugger>tag for revised text and stricter separation of explanations. (internal/services/system_prompt_debug.tmpl,internal/services/system_prompt_default.tmpl) [1] [2]Bug Fixes and Minor Improvements:
internal/services/toolkit/client/utils.go,internal/services/toolkit/client/utils_v2.go,internal/services/toolkit/handler/stream.go) [1] [2] [3] [4]internal/api/chat/create_conversation_message_stream_v2.go) [1] [2] [3]