Skip to content

CopilotChatClientOptions

NexusLabs.Needlr.Copilot

CopilotChatClientOptions Class

Configuration options for CopilotChatClient and related Copilot API types.

public sealed class CopilotChatClientOptions

Inheritance System.Object 🡒 CopilotChatClientOptions

Properties

CopilotChatClientOptions.CopilotApiBaseUrl Property

The Copilot API base URL. Defaults to https://api.githubcopilot.com.

public string CopilotApiBaseUrl { get; set; }

Property Value

System.String

CopilotChatClientOptions.DefaultModel Property

The default model to use when Microsoft.Extensions.AI.ChatOptions.ModelId is not specified by the caller. Defaults to claude-sonnet-4.

public string DefaultModel { get; set; }

Property Value

System.String

CopilotChatClientOptions.EditorVersion Property

Value sent in the Editor-Version header. Defaults to NexusLabs.Needlr/1.0.0.

public string EditorVersion { get; set; }

Property Value

System.String

CopilotChatClientOptions.GitHubApiBaseUrl Property

The GitHub API base URL for token exchange. Defaults to https://api.github.com.

public string GitHubApiBaseUrl { get; set; }

Property Value

System.String

CopilotChatClientOptions.GitHubToken Property

Optional explicit GitHub OAuth token. When set, takes precedence over TokenSource discovery.

public string? GitHubToken { get; set; }

Property Value

System.String

CopilotChatClientOptions.IntegrationId Property

Value sent in the Copilot-Integration-Id header. Defaults to needlr-copilot.

public string IntegrationId { get; set; }

Property Value

System.String

CopilotChatClientOptions.MaxRetries Property

Maximum number of retries on HTTP 429 (Too Many Requests) responses. Defaults to 3. Set to 0 to disable retries.

public int MaxRetries { get; set; }

Property Value

System.Int32

CopilotChatClientOptions.RetryBaseDelayMs Property

Initial delay in milliseconds before the first retry on 429. Subsequent retries use exponential backoff (delay × 2^attempt). If the response includes a Retry-After header, that value is used instead. Defaults to 1000ms.

public int RetryBaseDelayMs { get; set; }

Property Value

System.Int32

CopilotChatClientOptions.TokenRefreshBufferSeconds Property

How many seconds before the Copilot API token expires to trigger a refresh. Defaults to 60.

public int TokenRefreshBufferSeconds { get; set; }

Property Value

System.Int32

CopilotChatClientOptions.TokenSource Property

Controls where the GitHub OAuth token is sourced from. Defaults to Auto.

public NexusLabs.Needlr.Copilot.CopilotTokenSource TokenSource { get; set; }

Property Value

CopilotTokenSource