feat: add support for copilot provider

This commit is contained in:
Son H. Nguyen 2025-02-13 22:53:37 +07:00
parent d918b089c6
commit e394d45513
9 changed files with 296 additions and 1 deletions

View file

@ -0,0 +1,25 @@
"""
Constants for Copilot integration
"""
import os
# Copilot API endpoints
GITHUB_COPILOT_API_BASE = "https://api.github.com/copilot/v1"
CHAT_COMPLETION_ENDPOINT = "/chat/completions"
# Model names
GITHUB_COPILOT_MODEL = "gpt-4o" # The model identifier for Copilot
# Request headers
DEFAULT_HEADERS = {
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": "litellm",
}
class GetDeviceCodeError(Exception): pass
class GetAccessTokenError(Exception): pass
class APIKeyExpiredError(Exception): pass
class RefreshAPIKeyError(Exception): pass
class GetAPIKeyError(Exception): pass