Skip to content

Commit 6cf7d7f

Browse files
authored
Add optional model description to ModelInfo (#105)
Signed-off-by: Ben Brandt <benjamin.j.brandt@gmail.com>
1 parent 423e2cd commit 6cf7d7f

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

docs/protocol/schema.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,9 @@ Information about a selectable model.
17141714
<ResponseField name="_meta" type={"object"}>
17151715
Extension point for implementations
17161716
</ResponseField>
1717+
<ResponseField name="description" type={"string | null"}>
1718+
Optional description of the model.
1719+
</ResponseField>
17171720
<ResponseField name="modelId" type={<a href="#modelid">ModelId</a>} required>
17181721
Unique identifier for the model.
17191722
</ResponseField>

rust/agent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ pub struct ModelInfo {
590590
pub model_id: ModelId,
591591
/// Human-readable name of the model.
592592
pub name: String,
593+
/// Optional description of the model.
594+
#[serde(default, skip_serializing_if = "Option::is_none")]
595+
pub description: Option<String>,
593596
/// Extension point for implementations
594597
#[serde(skip_serializing_if = "Option::is_none", rename = "_meta")]
595598
pub meta: Option<serde_json::Value>,

schema/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,10 @@
10361036
"_meta": {
10371037
"description": "Extension point for implementations"
10381038
},
1039+
"description": {
1040+
"description": "Optional description of the model.",
1041+
"type": ["string", "null"]
1042+
},
10391043
"modelId": {
10401044
"$ref": "#/$defs/ModelId",
10411045
"description": "Unique identifier for the model."

typescript/schema.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,10 @@ export interface ModelInfo {
13691369
_meta?: {
13701370
[k: string]: unknown;
13711371
};
1372+
/**
1373+
* Optional description of the model.
1374+
*/
1375+
description?: string | null;
13721376
/**
13731377
* Unique identifier for the model.
13741378
*/
@@ -2135,6 +2139,7 @@ export const promptCapabilitiesSchema = z.object({
21352139
/** @internal */
21362140
export const modelInfoSchema = z.object({
21372141
_meta: z.record(z.unknown()).optional(),
2142+
description: z.string().optional().nullable(),
21382143
modelId: z.string(),
21392144
name: z.string(),
21402145
});

0 commit comments

Comments
 (0)