Skip to content

Commit 307ab83

Browse files
evalstatebhosmer-ant
authored andcommitted
Include a discriminated LinkedResource for embedding Resources in Tool Results and Prompts
1 parent ace8816 commit 307ab83

File tree

2 files changed

+67
-35
lines changed

2 files changed

+67
-35
lines changed

schema/draft/schema.json

Lines changed: 38 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema/draft/schema.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ export type Role = "user" | "assistant";
634634
*/
635635
export interface PromptMessage {
636636
role: Role;
637-
content: TextContent | ImageContent | AudioContent | EmbeddedResource;
637+
content: ContentBlock;
638638
}
639639

640640
/**
@@ -653,6 +653,19 @@ export interface EmbeddedResource {
653653
annotations?: Annotations;
654654
}
655655

656+
/**
657+
*
658+
* A resource descriptor, embedded into a prompt or tool call result.
659+
*
660+
* It is up to the client how best to render linked resources for the benefit
661+
* of the LLM and/or the user.
662+
*
663+
*/
664+
export interface LinkedResource {
665+
type: "linkedresource";
666+
resource: Resource;
667+
}
668+
656669
/**
657670
* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
658671
*/
@@ -682,7 +695,7 @@ export interface CallToolResult extends Result {
682695
/**
683696
* A list of content objects that represent the unstructured result of the tool call.
684697
*/
685-
content: (TextContent | ImageContent | AudioContent | EmbeddedResource | ResourceReference)[];
698+
content: ContentBlock[];
686699

687700
/**
688701
* An optional JSON object that represents the structured result of the tool call.
@@ -953,6 +966,14 @@ export interface Annotations {
953966
priority?: number;
954967
}
955968

969+
/** */
970+
export type ContentBlock =
971+
| TextContent
972+
| ImageContent
973+
| AudioContent
974+
| EmbeddedResource
975+
| LinkedResource;
976+
956977
/**
957978
* Text provided to or from an LLM.
958979
*/
@@ -1291,7 +1312,7 @@ export interface EnumSchema {
12911312
title?: string;
12921313
description?: string;
12931314
enum: string[];
1294-
enumNames?: string[]; // Display names for enum values
1315+
enumNames?: string[]; // Display names for enum values
12951316
}
12961317

12971318
/**
@@ -1335,7 +1356,11 @@ export type ClientNotification =
13351356
| InitializedNotification
13361357
| RootsListChangedNotification;
13371358

1338-
export type ClientResult = EmptyResult | CreateMessageResult | ListRootsResult | ElicitResult;
1359+
export type ClientResult =
1360+
| EmptyResult
1361+
| CreateMessageResult
1362+
| ListRootsResult
1363+
| ElicitResult;
13391364

13401365
/* Server messages */
13411366
export type ServerRequest =

0 commit comments

Comments
 (0)