VanturaClient class

Client for interacting with the Vantura AI API.

Handles authentication, request building, and response parsing for chat completions.

Implemented types

Constructors

VanturaClient({required String apiKey, required String baseUrl, required String model, double? temperature, int? maxCompletionTokens, double? topP, bool? stream, String? reasoningEffort, dynamic stop, void onRetry(int attempt, Duration nextDelay, dynamic error)?, Client? httpClient})
Creates an VanturaClient with the specified configuration.

Properties

apiKey String
API key for authentication.
final
baseUrl String
Base URL of the API endpoint.
final
hashCode int
The hash code for this object.
no setterinherited
maxCompletionTokens int?
Default maximum completion tokens.
final
model String
Default model to use for requests.
final
onRetry → void Function(int attempt, Duration nextDelay, dynamic error)?
Callback emitted when a request is about to be retried. Provides the attempt number (1-based), next delay, and the error that triggered it.
final
reasoningEffort String?
Default reasoning effort.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stop → dynamic
Default stop sequences.
final
stream bool?
Default stream flag.
final
temperature double?
Default temperature for responses.
final
topP double?
Default top-p sampling parameter.
final

Methods

close() → void
Closes the shared HTTP client.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendChatRequest(List<Map<String, dynamic>> messages, List<Map<String, dynamic>>? tools, {double? temperature, int? maxCompletionTokens, double? topP, bool? stream, String? reasoningEffort, dynamic stop, CancellationToken? cancellationToken}) Future<Map<String, dynamic>>
Sends a chat request to the API.
override
sendStreamingChatRequest(List<Map<String, dynamic>> messages, List<Map<String, dynamic>>? tools, {double? temperature, int? maxCompletionTokens, double? topP, String? reasoningEffort, dynamic stop, CancellationToken? cancellationToken}) Stream<Map<String, dynamic>>
Sends a streaming chat request to the API.
override
toString() String
A string representation of this object.
inherited

Operators

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