Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR transitions the chat API from using an enum-based LanguageModel to a string-based modelSlug field for model identification. The existing LanguageModel enum is deprecated but retained for backward compatibility, while the new model_slug field provides more flexibility for specifying AI models.
Key changes:
- Added
model_slugas a new optional field alongside the deprecatedlanguage_modelenum in conversation-related messages - Updated the API to use
oneoffor model specification, allowing either enum or string-based model selection - Modified internal handlers to accept and propagate both
modelSlugstring and optionallanguageModelpointer - Regenerated protobuf code with updated protoc-gen-es (v2.10.2) and protoc-gen-go (v1.36.11) versions
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/chat/v1/chat.proto | Added model_slug field to Conversation, CreateConversationMessageRequest, StreamInitialization, and CreateConversationMessageStreamRequest; converted model specification to oneof type |
| pkg/gen/api/chat/v1/chat.pb.go | Regenerated Go protobuf code with oneof wrappers for model selection |
| webapp/_webapp/src/pkg/gen/apiclient/chat/v1/chat_pb.ts | Regenerated TypeScript protobuf code with oneof model types |
| internal/services/toolkit/handler/stream.go | Updated StreamHandler to accept both modelSlug string and optional languageModel pointer |
| internal/services/toolkit/client/utils.go | Refactored getDefaultParams to use modelSlug strings instead of LanguageModel enum |
| internal/services/toolkit/client/completion.go | Updated ChatCompletion and ChatCompletionStream signatures to accept modelSlug |
| internal/api/chat/create_conversation_message.go | Modified prepare and createConversation to handle both model formats with backward compatibility |
| internal/models/conversation.go | Added ModelSlug field to Conversation struct |
| internal/services/chat.go | Updated InsertConversationToDB to accept and store modelSlug |
| go.mod | Added github.com/openai/openai-go/v3 v3.12.0 dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
imwithye
reviewed
Dec 17, 2025
imwithye
reviewed
Dec 17, 2025
imwithye
previously approved these changes
Dec 17, 2025
imwithye
approved these changes
Dec 17, 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.
Transformation from
LanguageModeltomodelSlug.At this stage, both LanguageModel and modelSlug are allowed to appear simultaneously.
For older versions of the plugin, send the LanguageModel parameter.
For newer versions of the plugin, send the modelSlug parameter.
In the future, we will gradually remove the LanguageModel field.