createSession method
Future<void>
createSession({
- required int sessionId,
- required double temperature,
- required int topK,
- double? topP,
- int? maxOutputTokens,
- String? systemInstruction,
- List<
LocalAiTool> ? tools,
override
Implementation
@override
Future<void> createSession({
required int sessionId,
required double temperature,
required int topK,
double? topP,
int? maxOutputTokens,
String? systemInstruction,
List<LocalAiTool>? tools,
}) async {
calls.add('createSession');
final error = createSessionError;
if (error != null) throw error;
if (tools != null &&
tools.isNotEmpty &&
!capabilities.supportsToolCalling) {
throw LocalAiUnsupportedException(
'toolCalling',
'This fake backend was configured without tool calling.',
);
}
_tools.register(sessionId, tools);
sessions.add(
FakeLocalAiSession(
id: sessionId,
temperature: temperature,
topK: topK,
topP: topP,
maxOutputTokens: maxOutputTokens,
systemInstruction: systemInstruction,
tools: List.unmodifiable(tools ?? const <LocalAiTool>[]),
),
);
}