FlintAi class
Main facade for Flint's AI runtime.
Constructors
- FlintAi({AiProviderRegistry? providers, AiToolRegistry? tools, AiWorkflowRegistry? workflows, AiMemoryStore? memoryStore, AiRepository? repository, AiPlanner? planner, AiExecutor? executor, AiToolPolicy? toolPolicy})
- Creates a new AI runtime with sensible defaults for development.
- FlintAi.production({AiProviderRegistry? providers, AiToolRegistry? tools, AiWorkflowRegistry? workflows, AiMemoryStore? memoryStore, AiRepository? repository, AiPlanner? planner, AiExecutor? executor, AiToolPolicy? toolPolicy})
-
Creates an AI runtime configured for production-oriented defaults.
factory
Properties
- executor → AiExecutor
-
Executor used to run a plan.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- memoryStore → AiMemoryStore
-
Run and thread memory storage.
final
- planner → AiPlanner
-
Planner used to convert goals into execution steps.
final
- providers → AiProviderRegistry
-
Registered chat, image, and embedding providers.
final
- repository → AiRepository
-
Durable repository for runs, traces, threads, and artifacts.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolPolicy ↔ AiToolPolicy
-
Policy used to authorize tool execution.
getter/setter pair
- tools → AiToolRegistry
-
Registered executable AI tools.
final
- usesAutoMemoryStore → bool
-
Indicates whether the default auto-configured memory store is in use.
final
- workflows → AiWorkflowRegistry
-
Registered named workflows.
final
Methods
-
chat(
{required String providerId, required ChatRequest request}) → Future< ChatResult> - Sends a non-streaming chat request through the named provider.
-
loadRunEvents(
String runId) → Future< List< Map< >String, dynamic> > - Loads persisted or in-memory events for a run.
-
loadThreadMessages(
String threadId) → Future< List< Map< >String, dynamic> > - Loads persisted or in-memory messages for a thread.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerChatProvider(
ChatProvider provider) → void - Registers a chat provider implementation.
-
registerEmbeddingProvider(
EmbeddingProvider provider) → void - Registers an embedding provider implementation.
-
registerImageProvider(
ImageProvider provider) → void - Registers an image generation provider implementation.
-
registerTool(
AiTool tool) → void - Registers a tool that agents can invoke during execution.
-
registerWorkflow(
AiWorkflow workflow) → void - Registers a named workflow.
-
run(
{required AiAgent agent, required AiGoal goal, String? userId, String? tenantId, String? threadId, Context? context}) → Future< AiRunResult> -
Executes an agent run for the supplied
goal. -
runWorkflow(
String workflowName, {String? userId, String? tenantId, String? threadId, Map< String, dynamic> input = const {}, Context? context, Map<String, dynamic> metadata = const {}, bool isBackground = false}) → Future<AiWorkflowRunResult> - Executes a registered workflow by name.
-
saveThreadMessage(
String threadId, Map< String, dynamic> message) → Future<void> - Saves a thread message into the configured memory store.
-
streamChat(
{required String providerId, required ChatRequest request}) → Stream< ChatEvent> - Streams chat events from the named provider.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited