Repository navigation
Description
We have finalized the Language Model and Chat Participant API 🚀
Thus, you can now publish your extensions to the VS Marketplace. This API is finalized in VS Code Insiders, and will be finalized in VS Code Stable in July. In your package.json, you should set
"engines": {
"vscode": "^1.90.0"
},
and VS Code Stable will gracefully handle your extensions and ignore your usage of Language Model and Chat API until the API gets finalized in Stable in July. Full docs https://code.visualstudio.com/api/extension-guides/chat
We are excited to see what you build ✨
-- Proposal dts: https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.chatParticipant.d.ts
- Sample: https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample
- Docs: https://code.visualstudio.com/api/extension-guides/chat
Extension authors can subscribe to this issue to get updates about the proposed chat agent API. There may still be breaking changes coming, and I will post here whenever a breaking change is made.
I'm also interested in feedback about how you might use this API.
Current TODOs
- Need to enable agents to identify sessions uniquely and store state, including across a window reload
- Should be able to use
shouldRepopulatefor agents- Maybe this should be the default behavior for agents
-
ChatAgentReplyFollowupshould parameterize the agent and slash command names, don't require the agent to include them in the prompt as text- Maybe this goes for variables too, but variables like
#fileare complex
- Maybe this goes for variables too, but variables like
- Enable references and progress messages from chat variable resolvers #204539
- ChatAgentContentReference needs to support https URIs #203822
- Change the history context shape to be a flat list of messages, instead of request/response pairs
- Understand how duplicate agent IDs should be handled
-
Enable agents to resolve a variable value on-demand, instead of resolving all variables before invoking the agent
- Add a
persistflag toChatAgentProgressMessagefor it to stay visible with a ✔️ even when more content has been added.- This would be useful when you want the progress message to remain and show what happened, eg in representing a function call. I've seen multiple extension authors add their own version of this just with text.
- Better support for /help with chat agents #197081
-
ChatAgentCommandFollowupshould become a progress message instead of a followup - In history, agents have to parse agent names and slash commands from the raw
ChatMessage. They shouldn't have to understand the input syntax- the type in history should be related to the request and progress/result types that we already have. - Add generic type parameter for the type of the result, which can include custom properties
- 'variables' proposal is referenced from chatAgents2, need to merge it in
- Merge ChatAgentTask and ChatAgentProgressMessage #200598
Activity
roblourens commentedon Dec 3, 2023
November additions
ChatAgentProgressMessageto show progress steps on your response.@workspaceuses this.vscode/src/vscode-dts/vscode.proposed.chatAgents2.d.ts
Lines 261 to 266 in e4cb2cf
ChatAgentCompletionItemProviderfor variables to show up that are only for this agent. Other chat variables are global.vscode/src/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts
Lines 58 to 60 in e4cb2cf
bionicles commentedon Dec 7, 2023
ntindle commentedon Dec 9, 2023
Has any research been done into the agent protocol for this?
InTheCloudDan commentedon Dec 10, 2023
Do you have any example use cases of
ChatAgentCompletionItemProvider?pelikhan commentedon Dec 11, 2023
access.makeRequest?roblourens commentedon Dec 13, 2023
bion howard (@bionicles) I wouldn't rely on Copilot Chat for legal advice, talking to a lawyer may be a good idea.
Nicholas Tindle (@ntindle) I think that's a different use of the term "agent" than how we're using it here, where it's just a UX paradigm for an extension that can execute a chat query. That might continue to be a point of confusion as people work more on AI agents that plan and use tools to accomplish a task in multiple steps.
Dan O'Brien (@InTheCloudDan) Not a good example, sorry, I'll try to add one to the API sample this month. The API might need a little more polish.
Peli de Halleux (@pelikhan) The current concept is that those options could be used differently by different chat providers. The
copilotchat provider takes a numeric optionn.Re:
MappedEditsProvider- I think this is sort of in an experimental state, there is one that is implemented by the Copilot Chat extension and just tries to fix the indentation of pasted codeblocks based on the indentation inChatAgentUsedContext.ntindle commentedon Dec 13, 2023
How would you feel about calling it one of the following then sidekick, partner, assistant, or tool?
The name confusion I can see continuing
bionicles commentedon Dec 19, 2023
roblourens duh
roblourens commentedon Jan 12, 2024
Breaking change in the next Insiders:
Renamed
ChatVariableContext#messagetopromptvscode/src/vscode-dts/vscode.proposed.chatAgents2.d.ts
Lines 420 to 425 in b8baf8e
234 remaining items
isidorn commentedon May 17, 2024
Dan O'Brien (@InTheCloudDan) good catch. I just fixed it. Thanks
isidorn commentedon May 17, 2024
As Rob said we have finalized the Language Model and Chat Participant API
Thus, you can now publish your extensions to the VS Marketplace. This API is finalized in VS Code Insiders, and will be finalized in VS Code Stable in July. Thus we suggest that you use an engines: ^1.90.0 property in your package.json, and VS Code Stable will gracefully handle your extensions and ignore your usage of Language Model and Chat API until the API gets finalized in Stable in July.
Full docs https://code.visualstudio.com/api/extension-guides/chat
We are excited to see what you build ✨
Thus I am going ahead and closing this issue. We will create follow-up issues for API that is still in proposed state. Here's the issue for Variables #212995
roblourens commentedon May 23, 2024
Two more issues to follow for API updates. I'm very interested to hear what you would want to use custom chat variables or tools for, so please let me know!
undesicimo commentedon May 23, 2024
Congratulations! been watching this for months so thrilled
jasonwang82 commentedon May 23, 2024
isidorn commentedon May 23, 2024
jasonwang82 yes. But, this is unrelated to chat participant API.
matv-stripe commentedon May 23, 2024
Is it possible to stream results in our Markdown that include a dropdown?
We want to add a "References" collapsable section that is closed by default, similar to how Copilot shows "Used 1 reference >" here
I dont seem to see that option in the code here
vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
Line 594 in 101ea2a
roblourens commentedon May 23, 2024
You can call
referenceon the response stream to add to that list, but you can't add your own.isidorn commentedon May 24, 2024
We just did a breakout session at Microsoft build on Chat Participant API.
Make sure to check it out https://www.youtube.com/watch?v=YI7kjWzIiTM
amitjoshi438 commentedon Jun 17, 2024
Hi roblourens is there any tracking link for this?
#199908 (comment)
roblourens commentedon Jun 18, 2024
#214379