Expand description
§GitHub Copilot Client Library
This library provides a client for interacting with the GitHub Copilot API. It handles token management, model retrieval, chat completions, and embeddings requests. The client uses reqwest for HTTP requests and serde for JSON serialization/deserialization.
§Features
- Retrieve a GitHub token from the environment or configuration files.
- Fetch available Copilot models and agents.
- Send chat completion requests and receive responses.
- Request embeddings for provided input strings.
Structs§
- Agent
- Represents an agent returned by the GitHub Copilot API.
- Agents
Response - Response payload for retrieving agents.
- Chat
Choice - Represents a single choice in a chat completion response.
- Chat
Request - Request payload for a chat completion.
- Chat
Response - Response payload for a chat completion request.
- Copilot
Client - Client for interacting with the GitHub Copilot API.
- Copilot
Token Response - Response from the GitHub Copilot token endpoint.
- Embedding
- Represents an individual embedding.
- Embedding
Request - Request payload for an embeddings request.
- Embedding
Response - Response payload for an embeddings request.
- Message
- Represents a chat message.
- Model
- Represents a model available for GitHub Copilot.
- Models
Response - Response payload for retrieving models.
- Token
Usage - Information about token usage in a chat response.
Enums§
- Copilot
Error - Represents errors that can occur when interacting with the GitHub Copilot API.
Functions§
- get_
config_ path - Returns the user’s configuration directory.
- get_
github_ token - Retrieves the GitHub token from the
GITHUB_TOKEN
environment variable or from a configuration file.