Skip to content

chore: chat/v1/chat.proto#53

Merged
Junyi-99 merged 14 commits intomainfrom
pr-protobuf
Dec 17, 2025
Merged

chore: chat/v1/chat.proto#53
Junyi-99 merged 14 commits intomainfrom
pr-protobuf

Conversation

@Junyi-99
Copy link
Member

@Junyi-99 Junyi-99 commented Dec 16, 2025

Transformation from LanguageModel to modelSlug.

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.

Copilot AI review requested due to automatic review settings December 16, 2025 17:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_slug as a new optional field alongside the deprecated language_model enum in conversation-related messages
  • Updated the API to use oneof for model specification, allowing either enum or string-based model selection
  • Modified internal handlers to accept and propagate both modelSlug string and optional languageModel pointer
  • 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.

@Junyi-99 Junyi-99 changed the title chore: char/v1/chat.proto chore: chat/v1/chat.proto Dec 16, 2025
imwithye
imwithye previously approved these changes Dec 17, 2025
@Junyi-99 Junyi-99 merged commit 951f8c4 into main Dec 17, 2025
1 check passed
@Junyi-99 Junyi-99 deleted the pr-protobuf branch December 17, 2025 06:37
@Junyi-99 Junyi-99 moved this to QA / Testing in Project PaperDebugger Dec 17, 2025
@github-project-automation github-project-automation bot moved this from QA / Testing to Done in Project PaperDebugger Dec 17, 2025
@Junyi-99 Junyi-99 moved this from Done to QA / Testing in Project PaperDebugger Dec 17, 2025
@Junyi-99 Junyi-99 moved this from QA / Testing to Done in Project PaperDebugger Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants