-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ai settings page * chore: intergate client api * chore: replace open ai calls * chore: disable gen image from ai * chore: clippy * chore: remove learn about ai * chore: fix wanrings * chore: fix restart button title * chore: remove await * chore: remove loading indicator --------- Co-authored-by: nathan <[email protected]> Co-authored-by: Lucas.Xu <[email protected]>
- Loading branch information
1 parent
40312f4
commit 54c9d12
Showing
78 changed files
with
1,383 additions
and
499 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
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
32 changes: 32 additions & 0 deletions
32
...wy_flutter/lib/plugins/document/presentation/editor_plugins/openai/service/ai_client.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/error.dart'; | ||
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/text_completion.dart'; | ||
import 'package:appflowy_backend/protobuf/flowy-chat/entities.pb.dart'; | ||
import 'package:appflowy_result/appflowy_result.dart'; | ||
|
||
abstract class AIRepository { | ||
Future<void> getStreamedCompletions({ | ||
required String prompt, | ||
required Future<void> Function() onStart, | ||
required Future<void> Function(TextCompletionResponse response) onProcess, | ||
required Future<void> Function() onEnd, | ||
required void Function(AIError error) onError, | ||
String? suffix, | ||
int maxTokens = 2048, | ||
double temperature = 0.3, | ||
bool useAction = false, | ||
}); | ||
|
||
Future<void> streamCompletion({ | ||
required String text, | ||
required CompletionTypePB completionType, | ||
required Future<void> Function() onStart, | ||
required Future<void> Function(String text) onProcess, | ||
required Future<void> Function() onEnd, | ||
required void Function(AIError error) onError, | ||
}); | ||
|
||
Future<FlowyResult<List<String>, AIError>> generateImage({ | ||
required String prompt, | ||
int n = 1, | ||
}); | ||
} |
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
Oops, something went wrong.