File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
extension/conversation/vscode-node Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
129
129
130
130
const sanitizedModelName = endpoint . name . replace ( / \( P r e v i e w \) / g, '' ) . trim ( ) ;
131
131
let modelDescription : string | undefined ;
132
- if ( endpoint . model === AutoChatEndpoint . id ) {
132
+ if ( endpoint . degradationReason ) {
133
+ modelDescription = endpoint . degradationReason ;
134
+ } else if ( endpoint . model === AutoChatEndpoint . id ) {
133
135
if ( this . _authenticationService . copilotToken ?. isNoAuthUser ) {
134
136
modelDescription = localize ( 'languageModel.autoTooltipNoAuth' , 'Auto selects the best model for your request based on capacity and performance.' ) ;
135
137
} else {
@@ -178,6 +180,7 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
178
180
tooltip : modelDescription ,
179
181
detail : modelDetail ,
180
182
category : modelCategory ,
183
+ statusIcon : endpoint . degradationReason ? new vscode . ThemeIcon ( 'warning' ) : undefined ,
181
184
version : endpoint . version ,
182
185
maxInputTokens : endpoint . modelMaxPromptTokens - baseCount - BaseTokensPerCompletion ,
183
186
maxOutputTokens : endpoint . maxOutputTokens ,
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ export interface IModelAPIResponse {
81
81
is_chat_default : boolean ;
82
82
is_chat_fallback : boolean ;
83
83
version : string ;
84
+ warning_message ?: string ;
84
85
billing ?: { is_premium : boolean ; multiplier : number ; restricted_to ?: string [ ] } ;
85
86
capabilities : IChatModelCapabilities | ICompletionModelCapabilities | IEmbeddingModelCapabilities ;
86
87
supported_endpoints ?: ModelSupportedEndpoint [ ] ;
Original file line number Diff line number Diff line change @@ -223,6 +223,10 @@ export class ChatEndpoint implements IChatEndpoint {
223
223
return ! ! ( enableResponsesApi && this . _modelMetadata . supported_endpoints ?. includes ( ModelSupportedEndpoint . Responses ) ) ;
224
224
}
225
225
226
+ public get degradationReason ( ) : string | undefined {
227
+ return this . _modelMetadata . warning_message ;
228
+ }
229
+
226
230
public get policy ( ) : 'enabled' | { terms : string } {
227
231
if ( ! this . _policyDetails ) {
228
232
return 'enabled' ;
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ export interface IChatEndpoint extends IEndpoint {
164
164
readonly supportedEditTools ?: readonly EndpointEditToolName [ ] ;
165
165
readonly showInModelPicker : boolean ;
166
166
readonly isPremium ?: boolean ;
167
+ readonly degradationReason ?: string ;
167
168
readonly multiplier ?: number ;
168
169
readonly restrictedToSkus ?: string [ ] ;
169
170
readonly isDefault : boolean ;
You can’t perform that action at this time.
0 commit comments