Skip to content

Commit

Permalink
Chat: rename the 'OpenAI o1' model to 'OpenAI o1-preview
Browse files Browse the repository at this point in the history
fix: update model selection to only allow available models
- Only update the model ID if the new model is available to the user
- Rename the 'OpenAI o1' model to 'OpenAI o1-preview' to better indicate it is a preview model
  • Loading branch information
abeatrix committed Sep 12, 2024
1 parent 162162d commit be45fbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/shared/src/models/dotcom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const DEFAULT_DOT_COM_MODELS = [
// Preview / Early Access
// --------------------------------
{
title: 'OpenAI o1',
title: 'OpenAI o1-preview',
id: 'openai/cody-chat-preview-001',
provider: 'OpenAI',
usage: [ModelUsage.Chat, ModelUsage.Edit],
Expand Down
7 changes: 5 additions & 2 deletions vscode/src/chat/chat-view/ChatModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ export class ChatModel {
}

public updateModel(newModelID: string) {
this.modelID = newModelID
this.contextWindow = modelsService.instance!.getContextWindowByID(this.modelID)
// Only update the model if it is available to the user.
if (modelsService.instance!.isModelAvailable(newModelID)) {
this.modelID = newModelID
this.contextWindow = modelsService.instance!.getContextWindowByID(this.modelID)
}
}

public isEmpty(): boolean {
Expand Down

0 comments on commit be45fbf

Please sign in to comment.