-
Notifications
You must be signed in to change notification settings - Fork 8
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
feature: implement copilot provider #52
Comments
So the linked repo is the LSP for copilot, which exposes a fairly different interface than magenta uses currently. Specifically, there's no way to provide a system prompt or define tools, or to force a tool invocation. As such this will likely be quite challenging to implement, as one would have to roll their own tool specification and parsing. I'll leave this issue open though, so we can track copilot and whether they ever get around to exposing more of a direct API (though I doubt they will since I'm not sure what would differentiate their API from the underlying foundation models they use). |
Copilot did lunch agent mode recently, which should use a similar sort of API as magenta does. I wonder if that code is open-source? It would be useful to see how the vscode extension integrates with the copilot api. |
There are a few projects that implement a generic AI LSP. Maybe it’s worth considering how it could be useful. |
Copilot now does support tools. It works using an openai compatible api (to an extent, I'm not sure what is all supported, but tools are). Using the One caveat to the above is that copilot does not support the text options 'auto' and 'required' for the 'tool_choice' field as far as I can tell. It does however work if you pass in an object indicating what function it must use to force a tool. (Also detailed on the api spec). Tool forcing unfortunately seems to ONLY work for gpt as a backend. Claude, and gemini will call tools, but the tool_choice field doesn't seem to do anything in my tests. However, using a different model just requires changing the 'model' key on the api call, so anytime I tool needs to be forced you could just use gpt as the backing model, and let the users specify whatever model they want for anything else. As for the system prompt you should be able to supply a message with the role system to achieve that. Here is an example of what a request forcing a tool might look like {
"messages": [
{
"role": "system",
"content": "My system prompts"
},
{
"role": "user",
"content": "Can you tell me the weather in Seattle in the US?"
},
],
"model": "gpt-4o",
"max_tokens": 4096,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current temperature for a given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. Bogotá, Colombia",
}
},
}
}
}
],
"tool_choice": {
"type": "function",
"function": {
"name": "get_weather"
}
}
} |
Did you check the docs?
Is your feature request related to a problem? Please describe.
Copilot support would be nice since it support multiple models and doesn't have limit usage on non-free plan.
Describe the solution you'd like
Add support for copilot provider
Describe alternatives you've considered
Avante, copilotchat
Additional context
Copilot just drop an SDK on npm: https://www.npmjs.com/package/@github/copilot-language-server
The text was updated successfully, but these errors were encountered: