ValidatingLlmCaller class

Decorator for LlmCaller that validates LLM responses against JSON schemas

Inheritance

Constructors

ValidatingLlmCaller({required LlmCaller delegate, required JsonSchema schema, bool fixMissing = false})
Creates a validating LLM caller that wraps another LLM caller delegate The underlying LLM caller to delegate to schema JSON schema for validating responses fixMissing Whether to fill missing properties with empty values

Properties

fixMissing bool
Whether to fix missing properties
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callLlm(String prompt) Future<LlmResponse>
Calls the LLM with the given prompt and returns a structured response
override
getInfo() Map<String, dynamic>
Gets information about the current LLM configuration
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
testConnection() Future<bool>
Tests the connection to the LLM service
override
toString() String
A string representation of this object.
inherited

Operators

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