forked from babakcode/flutter_gemini
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Babak
committed
Dec 15, 2023
1 parent
906c7df
commit c03a168
Showing
9 changed files
with
141 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,3 @@ migrate_working_dir/ | |
.dart_tool/ | ||
.packages | ||
build/ | ||
/test/env.dart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## 0.0.1 | ||
## 0.0.1-dev-1 | ||
|
||
* TODO: Describe initial release. | ||
* first publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
library flutter_gemini; | ||
|
||
export 'src/init.dart'; | ||
export 'src/models/gemini_response/gemini_response.dart'; | ||
export 'src/models/gemini_safety/gemini_safety.dart'; | ||
export 'src/models/gemini_safety/gemini_safety_category.dart'; | ||
export 'src/models/gemini_safety/gemini_safety_threshold.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import 'dart:developer'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:flutter_gemini/flutter_gemini.dart'; | ||
import 'env.dart' as env; | ||
|
||
void main() { | ||
Gemini.init(apiKey: env.geminiKey, enableDebugging: true); | ||
Gemini.init(apiKey: '--- Your Gemini Api Key ---', enableDebugging: true); | ||
|
||
test('check gemini to generate simple text', () async { | ||
final gemini = Gemini.instance; | ||
|
||
gemini.textInput("Write a story about a magic backpack.") | ||
.then((value) => value?.content?.parts?.last.text) | ||
.catchError((e) => print(e)); | ||
gemini | ||
.textInput("Write a story about a magic backpack.") | ||
.then((value) => log(value?.content?.parts?.last.text ?? '')) | ||
.catchError((e) => log('text input exception', error: e)); | ||
}); | ||
} |