incrementLlmCallCount method

void incrementLlmCallCount()

Implementation

void incrementLlmCallCount() {
  _numberOfLlmCalls += 1;
  final RunConfig? config = runConfig;
  if (config != null &&
      config.maxLlmCalls > 0 &&
      _numberOfLlmCalls > config.maxLlmCalls) {
    throw LlmCallsLimitExceededError(
      'Max number of llm calls `${config.maxLlmCalls}` exceeded',
    );
  }
}