assertValid method

void assertValid()

Implementation

void assertValid() {
  if (finishReason == AgentFinishReason.blocked) {
    throw StateError(
      'Generation blocked${finishMessage != null ? ': $finishMessage' : ''}.',
    );
  }
  if (_raw.message == null) {
    throw StateError('Agent response has no message.');
  }
}