Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

crazycodeboy/openai_flutter

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
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

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.