diff --git a/services/appflowy-collaborate/src/collab/queue_redis_ops.rs b/services/appflowy-collaborate/src/collab/queue_redis_ops.rs index e214768c..59c4c544 100644 --- a/services/appflowy-collaborate/src/collab/queue_redis_ops.rs +++ b/services/appflowy-collaborate/src/collab/queue_redis_ops.rs @@ -184,7 +184,7 @@ impl RedisSortedSet { } } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct PendingWrite { pub object_id: String, pub seq: i64, @@ -201,7 +201,7 @@ impl PendingWrite { } } -#[derive(Clone, Serialize_repr, Deserialize_repr)] +#[derive(Clone, Serialize_repr, Deserialize_repr, Debug)] #[repr(u8)] pub enum WritePriority { High = 0, diff --git a/services/appflowy-collaborate/src/config.rs b/services/appflowy-collaborate/src/config.rs index da527322..ebd7acf4 100644 --- a/services/appflowy-collaborate/src/config.rs +++ b/services/appflowy-collaborate/src/config.rs @@ -115,7 +115,7 @@ pub fn get_configuration() -> Result { ) .parse()?, edit_state_max_count: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_COUNT", "100").parse()?, - edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "360").parse()?, + edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "60").parse()?, }, redis_uri: get_env_var("APPFLOWY_REDIS_URI", "redis://localhost:6379").into(), }; diff --git a/src/biz/search/ops.rs b/src/biz/search/ops.rs index 4fa9c35f..239a4216 100644 --- a/src/biz/search/ops.rs +++ b/src/biz/search/ops.rs @@ -4,23 +4,25 @@ use appflowy_ai_client::client::AppFlowyAIClient; use appflowy_ai_client::dto::{ EmbeddingEncodingFormat, EmbeddingInput, EmbeddingOutput, EmbeddingRequest, EmbeddingsModel, }; + use database::index::{search_documents, SearchDocumentParams}; use shared_entity::dto::search_dto::{ SearchContentType, SearchDocumentRequest, SearchDocumentResponseItem, }; use shared_entity::response::AppResponseError; use sqlx::PgPool; + use uuid::Uuid; pub async fn search_document( pg_pool: &PgPool, - openai: &AppFlowyAIClient, + ai_client: &AppFlowyAIClient, uid: i64, workspace_id: Uuid, request: SearchDocumentRequest, metrics: &RequestMetrics, ) -> Result, AppResponseError> { - let embeddings = openai + let embeddings = ai_client .embeddings(EmbeddingRequest { input: EmbeddingInput::String(request.query.clone()), model: EmbeddingsModel::TextEmbedding3Small.to_string(), diff --git a/src/config/config.rs b/src/config/config.rs index 5ca92c12..c0ad3fc1 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -192,7 +192,7 @@ pub fn get_configuration() -> Result { ) .parse()?, edit_state_max_count: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_COUNT", "100").parse()?, - edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "360").parse()?, + edit_state_max_secs: get_env_var("APPFLOWY_COLLAB_EDIT_STATE_MAX_SECS", "60").parse()?, }, mailer: MailerSetting { smtp_host: get_env_var("APPFLOWY_MAILER_SMTP_HOST", "smtp.gmail.com"),