addAiCommand method
void
addAiCommand({
- required AiConfig config,
- required Client httpClient,
- AgentStyle style = const AgentStyle(),
- void onModeChanged(
- AgentMode mode
- void onLanguageChanged(
- String? language
Registers a live :ai command using config and httpClient.
Implementation
void addAiCommand({
required AiConfig config,
required http.Client httpClient,
AgentStyle style = const AgentStyle(),
void Function(AgentMode mode)? onModeChanged,
void Function(String? language)? onLanguageChanged,
}) {
register(
AiCommand(
config: config,
provider: providerFor(config, httpClient),
shield: CommandShield(),
style: style,
onModeChanged: onModeChanged,
onLanguageChanged: onLanguageChanged,
),
);
}