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.
Pitfalls
- Provider implementations must return valid JSON matching the
LLMResponseshape. Returning plain text causes the detector to silently produce zero LLM-sourced results. - Do NOT cache the
analyzeresponse across differentmodelvalues — classification schemes differ between model versions.
Implements
Constructors
Constructor
new GitHubCopilotProvider(config?): GitHubCopilotProvider;Defined in: packages/detector/src/llm/copilot.ts:24
Parameters
| Parameter | Type |
|---|---|
config | LLMProviderConfig |
Returns
GitHubCopilotProvider
Methods
analyze()
analyze(content, prompt): Promise<LLMResponse>;Defined in: packages/detector/src/llm/copilot.ts:40
Analyze content and detect external dependencies
Parameters
| Parameter | Type | Description |
|---|---|---|
content | string | Text content to analyze (README, code, etc.) |
prompt | string | Detection prompt template |
Returns
Promise<LLMResponse>
LLM response with detected dependencies
Implementation of
getRateLimit()
getRateLimit(): Promise<RateLimitInfo>;Defined in: packages/detector/src/llm/copilot.ts:129
Get current rate limit status
Returns
Promise<RateLimitInfo>
Implementation of
getSupportedModels()
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()
validateConfig(): boolean;Defined in: packages/detector/src/llm/copilot.ts:139
Validate provider configuration
Returns
boolean