azure 0.0.2 copy "azure: ^0.0.2" to clipboard
azure: ^0.0.2 copied to clipboard

Azure dart package

example/azure_example.dart

// ignore_for_file: avoid_print

import 'package:azure/api_client.dart';
import 'package:azure/azure.dart'; 

void main() async {
  final apiClient = ApiClient(
    apiKey: 'INSERT API KEY HERE',
    endpoint: 'INSERT ENDPOINT HERE',
  );

  final completions = Completions(apiClient);

  final request = CompletionsRequest(
    deploymentId: 'gpt-4o-mini',
    prompt: 'Write a tagline for an ice cream shop.',
    maxTokens: 10,
  );

  try {
    final response = await completions.create(request);
    print('Generated tagline: ${response.choices[0].text}');
  } catch (e) {
    print('Error: $e');
  }
}
0
likes
150
points
57
downloads

Publisher

unverified uploader

Weekly Downloads

Azure dart package

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on azure