Skip to content

Commit c9d33ad

Browse files
committed
Split out a ModelHint type for clarity
1 parent 07ddc80 commit c9d33ad

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

schema/schema.ts

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -806,27 +806,15 @@ export interface ImageContent {
806806
*/
807807
export interface ModelPreferences {
808808
/**
809-
* Optional string hints to use for model selection. How these hints are
810-
* interpreted depends on the key(s) in each record:
811-
*
812-
* - If the record contains a `name` key:
813-
* - The client SHOULD treat this as a substring of a model name; for example:
814-
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
815-
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
816-
* - `claude` should match any Claude model
817-
* - The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
818-
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
819-
*
820-
* All other keys are currently left unspecified by the spec and are up to the
821-
* client to interpret.
809+
* Optional hints to use for model selection.
822810
*
823811
* If multiple hints are specified, the client MUST evaluate them in order
824812
* (such that the first match is taken).
825813
*
826814
* The client SHOULD prioritize these hints over the numeric priorities, but
827815
* MAY still use the priorities to select from ambiguous matches.
828816
*/
829-
hints?: Record<"name" | string, string>[];
817+
hints?: ModelHint[];
830818

831819
/**
832820
* How much to prioritize cost when selecting a model. A value of 0 means cost
@@ -862,6 +850,35 @@ export interface ModelPreferences {
862850
intelligencePriority?: number;
863851
}
864852

853+
/**
854+
* Hints to use for model selection.
855+
*
856+
* - If the record contains a `name` key:
857+
* - The client SHOULD treat this as a substring of a model name; for example:
858+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
859+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
860+
* - `claude` should match any Claude model
861+
* - The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
862+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
863+
*
864+
* Keys not declared here are currently left unspecified by the spec and are up
865+
* to the client to interpret.
866+
*/
867+
export interface ModelHint {
868+
/**
869+
* A hint for a model name.
870+
*
871+
* The client SHOULD treat this as a substring of a model name; for example:
872+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
873+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
874+
* - `claude` should match any Claude model
875+
*
876+
* The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
877+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
878+
*/
879+
name?: string;
880+
}
881+
865882
/* Autocomplete */
866883
/**
867884
* A request from the client to the server, to ask for completion options.

0 commit comments

Comments
 (0)