AIManager class

Produces AiGuidance by querying a local Ollama LLM or falling back to deterministic recommendations derived from the architecture graph.

Prefers http://localhost:11434/api/generate (Ollama); falls back when the endpoint is unreachable, times out, or returns an invalid response.

Constructors

AIManager({Client? client, String ollamaEndpoint = 'http://localhost:11434/api/generate', String model = 'llama3.1', Duration requestTimeout = const Duration(seconds: 4)})
Creates an AIManager.

Properties

hashCode int
The hash code for this object.
no setterinherited
model String
Name of the Ollama model to use, e.g. 'llama3.1'.
final
ollamaEndpoint String
Ollama-compatible API endpoint used for LLM completions.
final
requestTimeout Duration
Maximum time to wait for a single LLM response before falling back.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildArchitectureGuidance({required ArchitectureGraph graph, required List<ArchitectureSmell> smells, required List<GovernanceViolation> violations}) Future<List<AiGuidance>>
Produces one AiGuidance per smell and per governance violation in the graph.
dispose() → void
Closes the underlying HTTP client when this manager owns it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refactorMethodBody({required String className, required List<String> stateFields, required String methodName, required String methodBody, NotifierType notifierType = NotifierType.stateNotifier}) Future<AiGuidance>
Returns AiGuidance for refactoring a single method body.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited