ccproxy.plugins.copilot.adapter¶
ccproxy.plugins.copilot.adapter
¶
CopilotAdapter
¶
CopilotAdapter(
config,
auth_manager,
detection_service,
http_pool_manager,
oauth_provider=None,
**kwargs,
)
Bases: BaseHTTPAdapter
Simplified Copilot adapter.
Source code in ccproxy/plugins/copilot/adapter.py
process_provider_response
async
¶
Process provider response with format conversion support.
Source code in ccproxy/plugins/copilot/adapter.py
handle_request_gh_api
async
¶
Forward request to GitHub API with proper authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
API path (e.g., '/copilot_internal/user') |
required | |
mode
|
API mode - 'api' for GitHub API with OAuth token, 'copilot' for Copilot API with Copilot token |
required | |
method
|
HTTP method |
required | |
body
|
Request body |
required | |
extra_headers
|
Additional headers |
required |
Source code in ccproxy/plugins/copilot/adapter.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | |