Skip to main content

Module copilot

Module copilot 

Source
Expand description

GitHub Copilot provider.

Supports Chat Completions, Responses, and Embeddings against https://api.githubcopilot.com.

Client::completion_model(...) automatically routes Codex-class models through /responses and conversational models through /chat/completions.

§Example

use rig::client::{CompletionClient, ProviderClient};
use rig::providers::copilot;

let client = copilot::Client::from_env()?;
let model = client.completion_model(copilot::GPT_4O);

Re-exports§

pub use openai::EncodingFormat;

Structs§

ChatApiErrorResponse
ChatChoice
ChatCompletionResponse
CompletionModel
CopilotBuilder
CopilotExt
EmbeddingModel

Enums§

CopilotAuth
CopilotCompletionResponse
CopilotStreamingResponse

Constants§

CLAUDE_3_5_SONNET
claude-3.5-sonnet completion model (Anthropic, via Copilot)
CLAUDE_SONNET_4
claude-sonnet-4 completion model (Anthropic, via Copilot)
GEMINI_2_0_FLASH
gemini-2.0-flash-001 completion model (Google, via Copilot)
GPT_4
gpt-4
GPT_4O
gpt-4o
GPT_4O_MINI
gpt-4o-mini
GPT_4_1
gpt-4.1
GPT_4_1_MINI
gpt-4.1-mini
GPT_4_1_NANO
gpt-4.1-nano
GPT_5_1_CODEX
gpt-5.1-codex
GPT_5_3_CODEX
gpt-5.3-codex
O3_MINI
o3-mini reasoning model (OpenAI, via Copilot)
TEXT_EMBEDDING_3_LARGE
text-embedding-3-large
TEXT_EMBEDDING_3_SMALL
text-embedding-3-small
TEXT_EMBEDDING_ADA_002
text-embedding-ada-002

Type Aliases§

Client
ClientBuilder