Skip to content

A openai library for flutter,it works on iOS,Android,Web,macOS and Windows.

License

Notifications You must be signed in to change notification settings

crazycodeboy/openai_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pub package PRs Welcome openai_flutter release

A openai library for flutter,it works on iOS,Android,Web,macOS and Windows.

How to use

Step1:init config

AIConfigBuilder.init('your apiKey');

Step2: to get a completion

try {
  var response = await AICompletion().create(prompt: '讲个故事', maxTokens: 1000);
  var choices = response.choices?.first;
  print('result:${choices?.text}');
  expect(choices, isNotNaN);
} catch (e) {
  print(e);
}

Enjoy!

About

A openai library for flutter,it works on iOS,Android,Web,macOS and Windows.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages