diff --git a/tests/ai_test/chat_test.rs b/tests/ai_test/chat_test.rs index df21dc33..e9f5db04 100644 --- a/tests/ai_test/chat_test.rs +++ b/tests/ai_test/chat_test.rs @@ -294,54 +294,6 @@ async fn generate_chat_message_answer_test() { assert!(!answer.is_empty()); } -#[tokio::test] -async fn create_chat_context_test() { - if !ai_test_enabled() { - return; - } - let test_client = TestClient::new_user_without_ws_conn().await; - let workspace_id = test_client.workspace_id().await; - let chat_id = uuid::Uuid::new_v4().to_string(); - let params = CreateChatParams { - chat_id: chat_id.clone(), - name: "context chat".to_string(), - rag_ids: vec![], - }; - - test_client - .api_client - .create_chat(&workspace_id, params) - .await - .unwrap(); - - let content = "Lacus have lived in the US for five years".to_string(); - let metadata = ChatMessageMetadata { - data: ChatRAGData::from_text(content), - id: chat_id.clone(), - name: "".to_string(), - source: "appflowy".to_string(), - extra: None, - }; - - let params = CreateChatMessageParams::new_user("Where Lacus live?").with_metadata(metadata); - let question = test_client - .api_client - .create_question(&workspace_id, &chat_id, params) - .await - .unwrap(); - - let answer = test_client - .api_client - .get_answer(&workspace_id, &chat_id, question.message_id) - .await - .unwrap(); - println!("answer: {:?}", answer); - if answer.content.contains("United States") { - return; - } - assert!(answer.content.contains("US")); -} - // #[tokio::test] // async fn update_chat_message_test() { // if !ai_test_enabled() { diff --git a/tests/ai_test/chat_with_selected_doc_test.rs b/tests/ai_test/chat_with_selected_doc_test.rs index 690ef65f..db558c5e 100644 --- a/tests/ai_test/chat_with_selected_doc_test.rs +++ b/tests/ai_test/chat_with_selected_doc_test.rs @@ -106,10 +106,10 @@ async fn chat_with_multiple_selected_source_test() { &test_client, &workspace_id, &chat_id, - "When do we take off to Japan? Just tell me the date, and if you don't know, Just say you don’t know", + "When do we take off to Japan? Just tell me the date, and if you don't know, Just say you don’t know the date for the trip to Japan", ) .await; - let expected_unknown_japan_answer = r#"I don’t know"#; + let expected_unknown_japan_answer = r#"I don’t know the date for your trip to Japan"#; test_client .assert_similarity(&workspace_id, &answer, expected_unknown_japan_answer, 0.7) .await; @@ -168,7 +168,7 @@ async fn chat_with_multiple_selected_source_test() { &test_client, &workspace_id, &chat_id, - "When do we take off to Japan? Just tell me the date, and if you don't know, Just say you don’t know", + "When do we take off to Japan? Just tell me the date, and if you don't know, Just say you don’t know the date for the trip to Japan", ) .await; test_client