answersPlan static method
SyniAnswersPlan?
answersPlan({
- required String message,
- List<
SyniRuntimeMessage> messages = const [], - bool firstTurn = false,
What a chat turn needs fetched before it runs (runtime 0.8.0+). Pass the
person's message, the earlier messages of the conversation, and
whether this is the firstTurn. Needs no model. Returns null when the
runtime predates state answers; throws SyniRuntimeError for a request
the runtime refuses.
Implementation
static SyniAnswersPlan? answersPlan({
required String message,
List<SyniRuntimeMessage> messages = const [],
bool firstTurn = false,
}) {
final raw = SyniRuntimeFFI.answersPlanJson(jsonEncode({
'message': message,
if (messages.isNotEmpty)
'messages': messages.map((m) => m.toJson()).toList(),
'first_turn': firstTurn,
}));
return raw == null ? null : parseAnswersPlan(raw);
}