LLMProvider class abstract
Abstract interface for any large-language-model back-end.
Implementing a custom provider
class MyProvider implements LLMProvider {
@override
String get name => 'my-llm';
@override
Future<LLMResponse> complete(LLMRequest request) async {
// call your model
}
}
- Implementers
Constructors
- LLMProvider()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Human-readable name of this provider/model.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsStreaming → bool
-
Whether this provider supports streaming.
no setter
Methods
-
complete(
LLMRequest request) → Future< LLMResponse> -
Sends
requestto the LLM and returns its response. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
stream(
LLMRequest request) → Stream< String> - Stream of tokens (only valid when supportsStreaming is true).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited