openai_package 1.0.4 copy "openai_package: ^1.0.4" to clipboard
openai_package: ^1.0.4 copied to clipboard

Dart SDK for openAI Apis (Chat & Image & Transcription & Voice and Embeddings), integrate OpenAI products into your Flutter application.

example/openai_package_example.dart

// ignore_for_file: unused_local_variable

import 'package:openai_package/openai_package.dart';
import 'package:openai_package/src/openai/import/import.dart';

void main() async {
  // Create an instance of the OpenAI client
  OpenAI client = OpenAI(apiKey: 'YOUR_API_KEY', model: 'gpt-3.5-turbo');

  List<Message> message = [
    Message(role: '', content: ''),
  ];

  // Call the API to generate text
  String prompt = 'Once upon a time';
  int maxTokens = 100;
  String generatedText = await client.chat(messages: message);

  // Print the generated text
  print(generatedText);
}
3
likes
0
points
46
downloads

Publisher

verified publishermarijua.business

Weekly Downloads

Dart SDK for openAI Apis (Chat & Image & Transcription & Voice and Embeddings), integrate OpenAI products into your Flutter application.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

envied, http, http_parser, path

More

Packages that depend on openai_package