VS Code Extensions Can Now Use Copilot APIs
Monday, 12 August 2024

Microsoft has announced two new APIs for using the language models of GitHub Copilot in VS Code: a chat API and a language model API. The extensions mean developers can add extensions that use the APIs for Copilot to build custom chat participants that users can interact with in the GitHub Copilot Chat view in VS Code.

Copilot is GitHub's AI-powered "pair programmer" which suggests code and entire functions in real-time from your editor.

copilotbanner

A chat extension is a VS Code extension that uses the Chat extension API by contributing a Chat participant.Chat participants are domain experts that can answer user queries within a specific domain. Participants use several approaches to process a user query, including using AI to interpret the request and generate a response; forwarding the user request to a backend service; and using procedural logic and local resources.

 With the latest release, developers can now build their own chat participant for their VS Code extensions, allowing them to provide domain knowledge to Copilot that would be relevant to their users.

The extensions let developers create a chat participant with the Chat API, and use the Language Model API to process natural language and formulate a response to the user query.

The Language Model API lets developers directly access and make use of LLMs (large language models) contributed by GitHub Copilot in their own extensions by specifying prompts, relevant context, and how requests should be sent to the model. Microsoft says developers can use this API to enhance developer experiences beyond the Copilot Chat view.

The suggested examples include AI-powered rename suggestions, that allow you to dynamically rename symbols in your C++ code. These will automatically invoke suggestions when you go to rename a symbol in VS code when you have the Copilot Chat extension installed.

The VS Code team says several related features are expected later this year, including a Variable Resolving API that will ket extensions contribute chat variables, which provide context from the extension's domain; and a Tools API that converts natural language into tool calling with arguments, allowing extensions to register tools that can be called by other participants.

GitHub Copilot extensions for VS Code are available now.

 

 

vscodeicon

More Information

VS Code Copilot repo

Microsoft Build

Copilot Website

Build session on the new extensibility

Related Articles

Microsoft And GitHub Announce Copilot Extensions At Build 2024

Microsoft Launches Copilot Pro

Copilot Chat Improves Confidence and Enjoyment

GitHub Announces AI-Powered Changes

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Copilot Improves Code Quality
27/11/2024

Findings from GitHub show that code authored with Copilot has increased functionality and improved readability, is of better quality, and receives higher approval rates than code authored without it.

 [ ... ]



Rust 1.83 Improves Const Context Code Handling
12/12/2024

Rust 1.83 has been released with improvements to the handling of code running in const contexts.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info