Skip to content

Commit

Permalink
chore: update api
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Jul 24, 2024
1 parent cd6ecf1 commit 9f38ad9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions appflowy-local-ai/src/chat_ops.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Debug;
use anyhow::anyhow;
use appflowy_plugin::core::parser::{DefaultResponseParser, ResponseParser};
use appflowy_plugin::core::plugin::Plugin;
Expand Down Expand Up @@ -104,13 +105,13 @@ impl ChatPluginOperation {
}

#[instrument(level = "debug", skip(self), err)]
pub async fn complete_text(
pub async fn complete_text<T: Into<CompleteTextType> + Debug>(
&self,
message: &str,
complete_type: CompleteTextType,
complete_type: T,
) -> Result<ReceiverStream<Result<Bytes, PluginError>>, PluginError> {
let plugin = self.get_plugin()?;
let complete_type = complete_type as u8;
let complete_type = complete_type.into() as u8;
let params = json!({
"method": "complete_text",
"params": { "text": message, "type": complete_type }
Expand Down

0 comments on commit 9f38ad9

Please sign in to comment.