-
Notifications
You must be signed in to change notification settings - Fork 565
add LinkedResource to CallToolResult #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I would be happy to have and adopt this for VS Code 👍 |
I think there is a use case for returning a temporary resource that can be read via |
We'd be far better off including Resource as it also has the LLM Facing description. And then at the same time we could add |
@bhosmer-ant if in agreement we switch to Resource we should also add this to the Prompt primitive too. |
I agree I've noted this idea in #617 as well in relation to the idea of sending back resources as part of progress notifications. I think the original motivation of resource is to find long lived static resources that the server holds. However I think there are a set of use cases for short lived temporary resources associated with a specific request. This does open up the question of how long those resources are valid to avoid clogging up the server. I'm suggesting the idea of a keepAlive flag that tells the client how long it can expect the resource to be held by the server. |
@evalstate hey Shaun, yeah I think you and @jonathanhefner are totally right, Resource is better than ResourceReference here. (Going this way introduces ambiguity around whether
I'd like to leave
Yeah agreed. Actually I think it's worth factoring out
and using it from both
I mean, I'll take you up on it if you agree with the above, but also happy to do it if your offer has aged out! Just LMK (and 🙏 for the discussion either way) |
Perfect! I'll update first thing in the morning and agree on moving the subscribable discussion elsewhere. 👍 |
schema/draft/schema.ts
Outdated
* of the LLM and/or the user. | ||
* | ||
*/ | ||
export interface LinkedResource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been added for Type Discrimination within the content block.
@@ -646,7 +646,7 @@ export type Role = "user" | "assistant"; | |||
*/ | |||
export interface PromptMessage { | |||
role: Role; | |||
content: TextContent | ImageContent | AudioContent | EmbeddedResource; | |||
content: ContentBlock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a good time to merge turns this in to an Array similar to the existing ToolCallResult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick look at that discussion, seems well motivated to me but I think best to keep it a separate PR
lgtm 🙂 |
…l Results and Prompts
0096774
to
383772c
Compare
Enables tool calls to return
LinkedResource
s (in addition to fullEmbeddedResource
s) in results.Motivation and Context
Returning linked resources enables interaction flows where returning resource content inline is impractical.
LinkedResource
reuses theResource
structure unchanged, but adds a necessary type tag for disambiguation inContentBlock
arrays.How Has This Been Tested?
No testing yet.
Breaking Changes
Older clients will not be able to interpret the new content type.
Types of changes
Checklist
Additional context