Skip to main content

Module copilot

Module copilot 

Source
Expand description

GitHub Copilot provider implementation.

Copilot uses a two-step authentication flow:

  1. Exchange a GitHub OAuth/PAT token for a short-lived Copilot session token via https://api.github.com/copilot_internal/v2/token.
  2. Use the session token to make OpenAI-compatible chat completion requests to the Copilot proxy endpoint.

The session token is cached and automatically refreshed when it expires. GitHub Enterprise Server is supported via a configurable base URL.

Structsยง

CopilotProvider
GitHub Copilot provider that wraps OpenAI-compatible streaming.