stream method
Future<Stream<StreamingMessage> >
stream(
- List<
LLMMessage> messages, { - List<
Tool> ? tools, - ToolChoice? toolChoice,
- required ModelConfig modelConfig,
- bool? jsonOutput,
- CancelToken? cancelToken,
override
Implementation
@override
Future<Stream<StreamingMessage>> stream(
List<LLMMessage> messages, {
List<Tool>? tools,
ToolChoice? toolChoice,
required ModelConfig modelConfig,
bool? jsonOutput,
CancelToken? cancelToken,
}) async {
await rateLimitGate.acquire(estimatedTokens: modelConfig.maxTokens ?? 0);
// NOTE: stream recording is deferred. Streamed runs that need
// replay should use generate() in eval mode.
return inner.stream(
messages,
tools: tools,
toolChoice: toolChoice,
modelConfig: modelConfig,
jsonOutput: jsonOutput,
cancelToken: cancelToken,
);
}