mapFlutterGemmaSkillResult function

OmnixAgentToolOutput mapFlutterGemmaSkillResult(
  1. SkillResult result
)

Maps one Flutter Gemma skill result into a headless Omnix value.

Implementation

OmnixAgentToolOutput mapFlutterGemmaSkillResult(agent.SkillResult result) =>
    switch (result) {
      agent.TextResult(:final text) => OmnixAgentTextOutput(text),
      agent.ImageResult(:final bytes) => OmnixAgentImageOutput(bytes),
      agent.WebviewResult(:final url, :final iframe) => _mapWebOutput(
        url,
        iframe: iframe,
      ),
      agent.ErrorResult(:final message) => OmnixAgentErrorOutput(message),
      agent.WidgetResult(:final widget) => OmnixAgentUnavailableOutput(
        kind: 'native-view',
        description: widget.runtimeType.toString(),
      ),
    };