Skip to content

Conversation

@jspahrsummers
Copy link
Member

Resolves #2.

This technically breaks backwards compatibility (adds something new that the client MUST handle), but since no servers use this yet, I don't think we need to rev the protocol version. I did consider adding a capability to make this more optional, but:

  1. It's not really a server capability, since it's something the client needs to support
  2. ClientCapabilities is quite sparse, and adding a top-level key like prompts (so we could have, e.g., prompts.embeddedResources = true) sounds like "does the client support prompts at all?"—which would be an even bigger breaking change than this

@jspahrsummers jspahrsummers requested a review from dsp-ant November 4, 2024 15:39
Copy link
Member

@dsp-ant dsp-ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this.

Comment on lines +568 to +577
/**
* The contents of a resource, embedded into a prompt.
*
* It is up to the client how best to render embedded resources for the benefit
* of the LLM and/or the user.
*/
export interface PromptResourceContents extends ResourceContents {
type: "resource";
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So we are still referencing an actual resource. When you said "embedded" I originally thought you meant directly returning bytes/strings here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does directly return bytes/strings—that comes from extending ResourceContents. This is just a type tag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, this is a bit confusing. Follow-up: #36

@jspahrsummers jspahrsummers merged commit f1c1112 into main Nov 5, 2024
@jspahrsummers jspahrsummers deleted the justin/resources-in-messages branch November 5, 2024 14:25
jspahrsummers added a commit that referenced this pull request Mar 12, 2025
use httpx.AsyncClient for async http requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some way to substitute resources into prompts

3 participants