Skip to content

dependabit / detector/src / GitHubCopilotProvider

Class: GitHubCopilotProvider ​

Defined in: packages/detector/src/llm/copilot.ts:20

Contract that all LLM provider implementations must satisfy.

Remarks ​

The only method called by the Detector is analyze. getSupportedModels, getRateLimit, and validateConfig exist for diagnostic and health-check purposes.

Use When ​

You need to plug in a custom or self-hosted language model as the classification backend for the detector.

Avoid When ​

You only need programmatic heuristics — constructing a stub provider that always returns an empty dependencies array has a small overhead but is safe.

Never ​

  • Provider implementations must return valid JSON matching the LLMResponse shape. Returning plain text causes the detector to silently produce zero LLM-sourced results.
  • Do NOT cache the analyze response across different model values — classification schemes differ between model versions.

Implements ​

Constructors ​

Constructor ​

ts
new GitHubCopilotProvider(config?): GitHubCopilotProvider;

Defined in: packages/detector/src/llm/copilot.ts:24

Parameters ​

ParameterType
configLLMProviderConfig

Returns ​

GitHubCopilotProvider

Methods ​

analyze() ​

ts
analyze(content, prompt): Promise<LLMResponse>;

Defined in: packages/detector/src/llm/copilot.ts:40

Analyze content and detect external dependencies

Parameters ​

ParameterTypeDescription
contentstringText content to analyze (README, code, etc.)
promptstringDetection prompt template

Returns ​

Promise<LLMResponse>

LLM response with detected dependencies

Implementation of ​

LLMProvider.analyze


getRateLimit() ​

ts
getRateLimit(): Promise<RateLimitInfo>;

Defined in: packages/detector/src/llm/copilot.ts:129

Get current rate limit status

Returns ​

Promise<RateLimitInfo>

Implementation of ​

LLMProvider.getRateLimit


getSupportedModels() ​

ts
getSupportedModels(): string[];

Defined in: packages/detector/src/llm/copilot.ts:124

Get list of supported models for this provider

Returns ​

string[]

Implementation of ​

LLMProvider.getSupportedModels


validateConfig() ​

ts
validateConfig(): boolean;

Defined in: packages/detector/src/llm/copilot.ts:139

Validate provider configuration

Returns ​

boolean

Implementation of ​

LLMProvider.validateConfig

Released under the MIT License.