sessionGetResponse method
Answers the pending turn.
Implementation
@override
Future<AiResponse> sessionGetResponse(
String sessionId, {
GenerationConfig? config,
}) async {
final s = _session(sessionId);
s.cancelled = false;
final text = await _reply(s);
if (s.cancelled) throw const OnDeviceAiCancelledException();
return AiResponse(
text: text,
tokenCount: estimateTokens(text),
generationTimeMs: 1,
);
}