streamCopilot function
AssistantMessageEventStream
streamCopilot(
- Model model,
- Context context, [
- CopilotOptions? options,
- Client? client,
Streams an assistant message from GitHub Copilot.
client overrides the HTTP client (tests inject http.testing
mocks); when omitted the shared keep-alive client is used.
Implementation
AssistantMessageEventStream streamCopilot(
Model model,
Context context, [
CopilotOptions? options,
http.Client? client,
]) {
final events = AssistantMessageEventStream();
unawaited(
_runCopilotStream(
events,
model,
context,
options ?? const CopilotOptions(githubToken: ''),
client,
),
);
return events;
}