Skip to content

Commit f74a289

Browse files
committed
Split out ModelHintSchema for better typing and docs
1 parent f7f0ccf commit f74a289

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/types.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,15 +791,25 @@ export const LoggingMessageNotificationSchema = NotificationSchema.extend({
791791
});
792792

793793
/* Sampling */
794+
/**
795+
* Hints to use for model selection.
796+
*/
797+
export const ModelHintSchema = z.object({
798+
/**
799+
* A hint for a model name.
800+
*/
801+
name: z.string().optional(),
802+
}).passthrough();
803+
794804
/**
795805
* The server's preferences for model selection, requested of the client during sampling.
796806
*/
797807
export const ModelPreferencesSchema = z
798808
.object({
799809
/**
800-
* Optional string hints to use for model selection.
810+
* Optional hints to use for model selection.
801811
*/
802-
hints: z.optional(z.array(z.record(z.string()))),
812+
hints: z.optional(z.array(ModelHintSchema)),
803813
/**
804814
* How much to prioritize cost when selecting a model.
805815
*/

0 commit comments

Comments
 (0)