-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Prompt files provider API V2 #286457
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?
Prompt files provider API V2 #286457
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I think we should stick with our resource (URI) based approach
|
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| // version: 1 | ||
|
|
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.
Having the headers specified in the vscode API is problematic and undesirable.
- vscode API needs to be backward compatible, so we can't easily remove or rename properties or their values (e.g. tool names)
- every addition needs to be discussed in a API call
So what providers provide should just be a string, no structure, that then will be parsed on the core side
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.
What do you think about providing something like this?
interface IPromptFileContent {
header: {
// for supported properties, see <link> (documentation will have a table showing what versions various properties were added)
[key: string]: unknown;
},
body: string;
}
// we can take in either a string as value, or something structured like the aboveHappy to discuss more; I think my main problem with the current contract is that anyone who is interested in adding dynamic content needs to get into the business of managing files as well as frontmatter formatting (and potentially parsing), which feels a bit wrong IMO for something quick and dirty.
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.
pushed changes above, also updated the URI handling so we can take a look tomorrow - thanks!
| } | ||
|
|
||
| // Decode the content from the query string | ||
| const content = decodeURIComponent(resource.query); |
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.
Putting resource content in the query is problematic and a misuse of a URI.
- the query is part of the resource identifier.
foo:///bar?helloandfoo:///bar?worldshould not represent two different resources, but the same one (identified e.g. by 'foo:///bar') - there's a limit on how long URIs can be typically
Maybe the better model s to create TextDocuments on the extension and share contents like that.
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.
I'll need to explore this a bit more, from playing around with it when I tried opening untitled documents they would sometimes appear in the windows tab unexpectedly for me.
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.
Basically, I see this entrypoint as our internal recommendation for how users should be implementing ephemeral resources since I think it is a valid use case (not everyone will want to care about managing prompt files, the end goal is to inject instructions, agents, etc.)
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
…into pawang/orgInstructions
…into pawang/providerV2
No description provided.