[03-Developer] #260 in-app tool calling (Gemma 4 multi-turn)
ADR-0005 in-process tool runtime — 6 tools (catalog 2 + tracker 2 + habit 2), ToolDispatcher with JSON-schema validation + modal ConfirmGate for destructive ops, multi-turn LlmChatSession abstraction wired to flutter_gemma 0.16.5 (ToolChoice.auto), ChatSessionController with MAX_TURNS=4 safety + 8-turn history hint, ChatScreen entry behind AI opt-in. R3/R7/R8 enforced inside handlers. 41 new tests (envelope, catalog/tracker/habit tools, dispatcher, controller loop) — 151 total passing. Refs #260
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'ai/tools/tool_definition.dart' as tools;
|
||||
import 'data/ai/gemma_llm_service.dart';
|
||||
import 'data/ai/llm_service.dart';
|
||||
import 'data/ai/model_lifecycle.dart';
|
||||
@@ -77,6 +78,12 @@ class _LazyLlmService implements LlmService {
|
||||
Map<String, dynamic> schema,
|
||||
) async =>
|
||||
(await _resolve()).generateStructured(prompt, schema);
|
||||
|
||||
@override
|
||||
Future<LlmChatSession> startChat({
|
||||
required List<tools.ToolDefinition> tools,
|
||||
}) async =>
|
||||
(await _resolve()).startChat(tools: tools);
|
||||
}
|
||||
|
||||
class LifeHelperApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user