chore: fix ai client test (#589)
This commit is contained in:
parent
128e978016
commit
9b4bfce616
|
|
@ -576,6 +576,7 @@ dependencies = [
|
|||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ serde_repr = { version = "0.1", optional = true }
|
|||
[dev-dependencies]
|
||||
tokio = { version = "1.37.0", features = ["macros", "test-util"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["registry", "env-filter", "ansi", "json"] }
|
||||
uuid = { version = "1.6", features = ["v4"] }
|
||||
|
||||
[features]
|
||||
default = ["client-api"]
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ use crate::appflowy_ai_client;
|
|||
async fn qa_test() {
|
||||
let client = appflowy_ai_client();
|
||||
client.health_check().await.unwrap();
|
||||
let chat_id = uuid::Uuid::new_v4().to_string();
|
||||
let resp = client
|
||||
.send_question("fake_chat_id", "I feel hungry")
|
||||
.send_question(&chat_id, "I feel hungry")
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(!resp.content.is_empty());
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ async fn spawn_control_group(
|
|||
.await
|
||||
{
|
||||
if let Some(handles) = weak_handles.upgrade() {
|
||||
if messages.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
trace!("[History] received {} control messages", messages.len());
|
||||
for message in &messages {
|
||||
if let Ok(event) = CollabControlEvent::decode(&message.data) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue