You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use appflowy_ai_client::dto::{TagItem,TagRowData,TagRowParams};
2
+
use client_api_test::TestClient;
3
+
use serde_json::json;
4
+
use shared_entity::dto::ai_dto::{SummarizeRowData,SummarizeRowParams};
5
+
6
+
#[tokio::test]
7
+
asyncfnsummarize_row_test(){
8
+
let test_client = TestClient::new_user().await;
9
+
let workspace_id = test_client.workspace_id().await;
10
+
11
+
let params = SummarizeRowParams{
12
+
workspace_id: workspace_id.clone(),
13
+
data:SummarizeRowData::Content(
14
+
json!({"name":"Jack","age":25,"city":"New York"})
15
+
.as_object()
16
+
.unwrap()
17
+
.clone(),
18
+
),
19
+
};
20
+
21
+
let resp = test_client.api_client.summarize_row(params).await.unwrap();
22
+
assert!(!resp.text.is_empty());
23
+
}
24
+
#[tokio::test]
25
+
asyncfntag_row_test(){
26
+
let test_client = TestClient::new_user().await;
27
+
let workspace_id = test_client.workspace_id().await;
28
+
29
+
let params = TagRowParams{
30
+
workspace_id: workspace_id.clone(),
31
+
data:TagRowData{
32
+
existing_tags:vec![],
33
+
items:vec![TagItem{
34
+
title:"Atomic habits".to_string(),
35
+
content:"Atomic Habits by James Clear discusses how small, consistent changes in habits can lead to significant improvements over time. The book provides strategies for building good habits and breaking bad ones, emphasizing the importance of making tiny adjustments that compound into remarkable results. Clear introduces the concepts of habit stacking, the two-minute rule, and the four laws of behavior change: making habits obvious, attractive, easy, and satisfying".to_string(),
36
+
}],
37
+
num_tags:5,
38
+
},
39
+
};
40
+
41
+
let resp = test_client.api_client.tag_row(params).await.unwrap();
0 commit comments