Closed
Conversation
Co-authored-by: Yiwei Gong <imwithye@gmail.com>
Junyi-99
commented
Dec 15, 2025
Junyi-99
commented
Dec 15, 2025
Junyi-99
commented
Dec 15, 2025
internal/services/chat.go
Outdated
| ProjectID: projectID, | ||
| Title: DefaultConversationTitle, | ||
| LanguageModel: languageModel, | ||
| ModelSlug: modelSlug, |
Junyi-99
commented
Dec 15, 2025
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
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 a significant refactor to how language models are referenced and handled across the codebase, moving from a legacy enum-based approach to a more flexible string-based "model slug" system. It also upgrades the OpenAI client library to v3 and updates configuration to use a new inference service. Additionally, several new models are now supported, and the handling of conversation history has been modernized for better compatibility and extensibility.
Key changes include:
Model Handling and API Changes:
Replaced the use of the deprecated
LanguageModelenum throughout the API with a newmodelSlugstring field, updating all relevant function signatures and data structures to use the new approach. This includes fallback logic for backward compatibility. (internal/api/chat/create_conversation_message_stream.go,internal/api/chat/create_conversation_message_stream_helper.go,internal/models/conversation.go,internal/api/mapper/conversation.go) [1] F51da0ccL99, F51da0ccL165, F51da0ccL208, F51da0ccL236, [2] [3]Upgraded the OpenAI client from v2 to v3 and refactored all usages and data types accordingly, including the way chat history is stored and sent. (
go.mod,internal/api/chat/create_conversation_message_stream_helper.go,internal/models/conversation.go,internal/api/chat/list_supported_models.go) [1] [2] [3] F51da0ccL53, F51da0ccL70, F51da0ccL114, F51da0ccL154, [4] [5] [6] [7]Supported Models Expansion:
openai/gpt-4o). (internal/api/chat/list_supported_models.go)Configuration Refactor:
OpenAIBaseURL,OpenAIAPIKey) to more generic inference service fields (PDInferenceBaseURL,PDInferenceAPIKey) throughout the codebase and tests. (internal/libs/cfg/cfg.go,internal/libs/cfg/cfg_test.go) [1] F5f06866L19, F5f06866L29, [2]Codebase Cleanup:
CreateConversationMessagemethod and its supporting code, consolidating all conversation message creation through the streaming API. (internal/api/chat/create_conversation_message_stream_helper.go)These changes modernize the model selection process, improve extensibility for future models and providers, and align the codebase with the latest OpenAI client and internal infrastructure.