feat: support switch model (#5575)

* 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 <nathan@appflowy.io>
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Mathias Mogensen 2024-06-25 01:59:38 +02:00 committed by GitHub
parent 40312f4260
commit 54c9d12171
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 1383 additions and 499 deletions

View file

@ -205,3 +205,32 @@ impl From<RepeatedRelatedQuestion> for RepeatedRelatedQuestionPB {
}
}
}
#[derive(Default, ProtoBuf, Clone, Debug)]
pub struct CompleteTextPB {
#[pb(index = 1)]
pub text: String,
#[pb(index = 2)]
pub completion_type: CompletionTypePB,
#[pb(index = 3)]
pub stream_port: i64,
}
#[derive(Default, ProtoBuf, Clone, Debug)]
pub struct CompleteTextTaskPB {
#[pb(index = 1)]
pub task_id: String,
}
#[derive(Clone, Debug, ProtoBuf_Enum, Default)]
pub enum CompletionTypePB {
UnknownCompletionType = 0,
#[default]
ImproveWriting = 1,
SpellingAndGrammar = 2,
MakeShorter = 3,
MakeLonger = 4,
ContinueWriting = 5,
}