Skip to main content

analyze_issue

Function analyze_issue 

Source
pub async fn analyze_issue(
    provider: &dyn TokenProvider,
    issue: &IssueDetails,
    ai_config: &AiConfig,
) -> Result<AiResponse>
Expand description

Analyzes a GitHub issue and generates triage suggestions.

This function abstracts the credential resolution and API client creation, allowing platforms to provide credentials via TokenProvider implementations.

§Arguments

  • provider - Token provider for GitHub and AI provider credentials
  • issue - Issue details to analyze

§Returns

AI response with triage data and usage statistics.

§Errors

Returns an error if:

  • GitHub or AI provider token is not available from the provider
  • AI API call fails
  • Response parsing fails