remote action for the Genkit endpoint, // specifying its URL and response type. final action = defineRemoteAction( url: 'https://your-genkit-endpoint.com/generateImage', fromResponse: (data) => MyOutput.fromJson(data), ); final input = MyInput(message: 'Hello Dart Genkit!', count: 10); try { // 2. Call the defined remote action. final output = await action(input: input); print('Flow Response: ${output.reply}, ${output.newCount}'); } catch (e) { print('Error calling flow: $e'); }