Skip to content

Commit ee2e665

Browse files
committed
chore: minor logic simplification in byok compatibility
1 parent 6457e57 commit ee2e665

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

internal/services/toolkit/client/completion_v2.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ func (a *AIClientV2) ChatCompletionStreamV2(ctx context.Context, callbackStream
5757
openaiChatHistory := messages
5858
inappChatHistory := AppChatHistory{}
5959

60+
// Strip model prefix if using custom provider
61+
modelSlug = stripModelPrefix(modelSlug, llmProvider)
62+
6063
streamHandler := handler.NewStreamHandlerV2(callbackStream, conversationId, modelSlug)
6164

6265
streamHandler.SendInitialization()

internal/services/toolkit/client/get_conversation_title_v2.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ func (a *AIClientV2) GetConversationTitleV2(ctx context.Context, inappChatHistor
2929
message := strings.Join(messages, "\n")
3030
message = fmt.Sprintf("%s\nBased on above conversation, generate a short, clear, and descriptive title that summarizes the main topic or purpose of the discussion. The title should be concise, specific, and use natural language. Avoid vague or generic titles. Use abbreviation and short words if possible. Use 3-5 words if possible. Give me the title only, no other text including any other words.", message)
3131

32-
// Strip model prefix if using custom provider
33-
modelSlug := "openai/gpt-5-nano"
34-
modelSlug = stripModelPrefix(modelSlug, llmProvider)
35-
36-
_, resp, err := a.ChatCompletionV2(ctx, modelSlug, OpenAIChatHistory{
32+
_, resp, err := a.ChatCompletionV2(ctx, "openai/gpt-5-nano", OpenAIChatHistory{
3733
openai.SystemMessage("You are a helpful assistant that generates a title for a conversation."),
3834
openai.UserMessage(message),
3935
}, llmProvider)

0 commit comments

Comments
 (0)