BasetenClient constructor
BasetenClient({})
Implementation
BasetenClient({String? apiUrl, String? apiKey, String? model, super.delay, super.logger})
: _dio = Dio(),
_model = model ?? 'meta-llama/Llama-4-Maverick-17B-128E-Instruct',
_apiUrl = apiUrl ?? 'https://inference.baseten.co/v1',
_apiKey = apiKey ?? Platform.environment['BASETEN_API_KEY'] ?? '' {
if (_apiKey.isEmpty) {
throw Exception('BASETEN_API_KEY not found in environment variables.');
}
_dio.options.baseUrl = _apiUrl;
_dio.options.headers['Authorization'] = 'Api-Key $_apiKey';
_dio.options.headers['Content-Type'] = 'application/json';
}