Skip to content

Commit 3cc0f30

Browse files
authored
Add more notes to selectChatModels (microsoft#213867)
1 parent f1f91ad commit 3cc0f30

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/vscode-dts/vscode.d.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19042,7 +19042,7 @@ declare module 'vscode' {
1904219042
readonly id: string;
1904319043

1904419044
/**
19045-
* A well-know identifier of the vendor of the language model, a sample is `copilot`, but
19045+
* A well-known identifier of the vendor of the language model. An example is `copilot`, but
1904619046
* values are defined by extensions contributing chat models and need to be looked up with them.
1904719047
*/
1904819048
readonly vendor: string;
@@ -19195,12 +19195,11 @@ declare module 'vscode' {
1919519195
export const onDidChangeChatModels: Event<void>;
1919619196

1919719197
/**
19198-
* Select chat models by a {@link LanguageModelChatSelector selector}. This can yield in multiple or no chat models and
19198+
* Select chat models by a {@link LanguageModelChatSelector selector}. This can yield multiple or no chat models and
1919919199
* extensions must handle these cases, esp. when no chat model exists, gracefully.
1920019200
*
1920119201
* ```ts
19202-
*
19203-
* const models = await vscode.lm.selectChatModels({family: 'gpt-3.5-turbo'})!;
19202+
* const models = await vscode.lm.selectChatModels({ family: 'gpt-3.5-turbo' });
1920419203
* if (models.length > 0) {
1920519204
* const [first] = models;
1920619205
* const response = await first.sendRequest(...)
@@ -19210,7 +19209,11 @@ declare module 'vscode' {
1921019209
* }
1921119210
* ```
1921219211
*
19213-
* *Note* that extensions can hold-on to the results returned by this function and use them later. However, when the
19212+
* A selector can be written to broadly match all models of a given vendor or family, or it can narrowly select one model by ID.
19213+
* Keep in mind that the available set of models will change over time, but also that prompts may perform differently in
19214+
* different models.
19215+
*
19216+
* *Note* that extensions can hold on to the results returned by this function and use them later. However, when the
1921419217
* {@link onDidChangeChatModels}-event is fired the list of chat models might have changed and extensions should re-query.
1921519218
*
1921619219
* @param selector A chat model selector. When omitted all chat models are returned.

0 commit comments

Comments
 (0)