1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! GitHub Copilot integration for the Aither framework.
//!
//! This crate provides a `Copilot` client that implements the `LanguageModel` trait,
//! allowing you to use GitHub Copilot's chat API through the unified aither interface.
//!
//! GitHub Copilot uses OAuth device flow for authentication. The typical flow is:
//!
//! 1. Call [`auth::request_device_code`] to get a device code and verification URL
//! 2. Direct the user to the verification URL to enter the code
//! 3. Call [`auth::poll_for_token`] to wait for the user to complete authentication
//! 4. Use the token to create a [`Copilot`] client
//!
//! ```no_run
//! use aither_copilot::{Copilot, auth};
//! use aither_core::LanguageModel;
//!
//! # async fn demo() -> Result<(), Box<dyn std::error::Error>> {
//! // Request device code
//! let device_code = auth::request_device_code().await?;
//! println!("Visit {} and enter code: {}", device_code.verification_uri, device_code.user_code);
//!
//! // Poll for token
//! let token = auth::poll_for_token(&device_code.device_code, device_code.interval).await?;
//!
//! // Create client
//! let copilot = Copilot::new(token.access_token);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use *;
pub use CopilotError;
pub use CopilotProvider;