Agent constructor
Agent({})
Creates an agent.
Implementation
Agent({
required this.model,
required this.tools,
this.system,
this.maxSteps = 8,
this.maxTokens,
this.onStep,
}) {
if (maxSteps <= 0) {
throw ArgumentError.value(maxSteps, 'maxSteps', 'must be positive');
}
final names = <String>{};
for (final tool in tools) {
if (!names.add(tool.name)) {
throw ArgumentError('two tools are both called "${tool.name}"');
}
}
}