AIFlow API Documentation
    Preparing search index...

    Class OpenAiService

    OpenAI API service for generating commit message and branch name

    Index

    Constructors

    • Parameters

      • apiKey: string
      • apiUrl: string
      • model: string
      • reasoning: boolean | ReasoningConfig = false

      Returns OpenAiService

    Methods

    • Generate commit message, branch name and MR description. Supports batch processing for large diffs that exceed context limits.

      Parameters

      • diff: string

        The git diff content to analyze

      • language: string = 'en'

        Language code for generated content (default: 'en')

      Returns Promise<CommitGenerationResult>

      Promise resolving to commit generation result

    • Get aggregated throughput statistics from history

      Returns
          | null
          | {
              averageResponseTime: number;
              averageThroughput: number;
              bestPerformance: null
              | ThroughputStats;
              performanceTrend:
                  | "improving"
                  | "declining"
                  | "stable"
                  | "insufficient_data";
              totalCompletionTokens: number;
              totalPromptTokens: number;
              totalRequests: number;
              totalTokens: number;
              worstPerformance: null
              | ThroughputStats;
          }

      Aggregated statistics or null if no history exists

    • Get the latest throughput statistics from the most recent API call

      Returns null | ThroughputStats

      The latest throughput stats or null if no calls have been made

    • Get throughput statistics history (up to last 10 requests)

      Returns ThroughputStats[]

      Array of throughput statistics, ordered from oldest to newest