From 4ac9891a4fb08746699316ec9865929d0cd86d7c Mon Sep 17 00:00:00 2001 From: ThiruvarankanM Date: Tue, 30 Sep 2025 09:01:47 +0530 Subject: [PATCH 1/5] Adds comprehensive test coverage for the `chat_with_ai` walker Adds 4 comprehensive tests for `chat_with_ai` walker covering basic functionality, conversation context, edge cases, and multi-user scenarios. --- littleX_BE/littleX.test.jac | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/littleX_BE/littleX.test.jac b/littleX_BE/littleX.test.jac index 930e80f..03c3676 100644 --- a/littleX_BE/littleX.test.jac +++ b/littleX_BE/littleX.test.jac @@ -102,4 +102,62 @@ test load_feed { test test_load_user_profiles { load_user_walker = root spawn load_user_profiles(); check load_user_walker.profiles; +} + +test chat_with_ai_basic { + root spawn create_tweet(content="AI is amazing!"); + root spawn create_tweet(content="Learning Jac language today"); + + result = root spawn chat_with_ai( + message="What topics are people discussing?", + chat_history=[] + ); + + check result.response; + check len(result.chat_history) == 2; + check result.chat_history[0]["role"] == "user"; + check result.chat_history[1]["role"] == "assistant"; +} + +test chat_with_ai_context { + first_result = root spawn chat_with_ai( + message="Summarize the tweets", + chat_history=[] + ); + + second_result = root spawn chat_with_ai( + message="Tell me more about that", + chat_history=first_result.chat_history + ); + + check second_result.response; + check len(second_result.chat_history) == 4; +} + +test chat_with_ai_no_tweets { + empty_result = root spawn chat_with_ai( + message="What's happening?", + chat_history=[] + ); + + check empty_result.response; + check "no tweets" in empty_result.response.lower() or empty_result.response; +} + +test chat_with_ai_multiple_users { + profile1 = Profile("Thiru"); + profile1 spawn follow_request(); + profile1 spawn create_tweet("Working on my project"); + + profile2 = Profile("Thami"); + profile2 spawn follow_request(); + profile2 spawn create_tweet("Great weather today"); + + result = root spawn chat_with_ai( + message="Who is talking about what?", + chat_history=[] + ); + + check result.response; + check "Thiru" in result.response.lower() or "Thami" in result.response.lower(); } \ No newline at end of file From c935c66023987959960cb38306fb959bec3b4fa2 Mon Sep 17 00:00:00 2001 From: ThiruvarankanM Date: Wed, 1 Oct 2025 20:06:49 +0530 Subject: [PATCH 2/5] ai_testclass_udpated --- littleX_BE/littleX.test.jac | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/littleX_BE/littleX.test.jac b/littleX_BE/littleX.test.jac index 03c3676..3a2c396 100644 --- a/littleX_BE/littleX.test.jac +++ b/littleX_BE/littleX.test.jac @@ -105,6 +105,7 @@ test test_load_user_profiles { } test chat_with_ai_basic { +<<<<<<< Updated upstream root spawn create_tweet(content="AI is amazing!"); root spawn create_tweet(content="Learning Jac language today"); @@ -142,12 +143,38 @@ test chat_with_ai_no_tweets { check empty_result.response; check "no tweets" in empty_result.response.lower() or empty_result.response; +======= + root spawn create_tweet( + content = "AI is amazing!", + ); + root spawn create_tweet( + content = "Learning Jac language today", + ); + result = root spawn chat_with_ai( + message = "What topics are people discussing?", + ); + check result.response; + check len(result.chat_history) == 2; +} + +test chat_with_ai_context { + first = root spawn chat_with_ai( + message = "Summarize the tweets", + ); + second = root spawn chat_with_ai( + message = "Tell me more", + chat_history = first.chat_history, + ); + check second.response; + check len(second.chat_history) == 4; +>>>>>>> Stashed changes } test chat_with_ai_multiple_users { profile1 = Profile("Thiru"); profile1 spawn follow_request(); profile1 spawn create_tweet("Working on my project"); +<<<<<<< Updated upstream profile2 = Profile("Thami"); profile2 spawn follow_request(); @@ -160,4 +187,13 @@ test chat_with_ai_multiple_users { check result.response; check "Thiru" in result.response.lower() or "Thami" in result.response.lower(); +======= + profile2 = Profile("Thami"); + profile2 spawn follow_request(); + profile2 spawn create_tweet("Great weather today"); + result = root spawn chat_with_ai( + message = "Who is talking about what?", + ); + check result.response; +>>>>>>> Stashed changes } \ No newline at end of file From 6fa8652512c40992c440566377176bc22868369e Mon Sep 17 00:00:00 2001 From: ThiruvarankanM Date: Wed, 1 Oct 2025 20:17:32 +0530 Subject: [PATCH 3/5] ai_testclass_udpated_2 --- .DS_Store | Bin 0 -> 6148 bytes littleX_BE/.DS_Store | Bin 0 -> 6148 bytes littleX_BE/littleX.test.jac | 55 ------------------------------------ 3 files changed, 55 deletions(-) create mode 100644 .DS_Store create mode 100644 littleX_BE/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5ae4ff804fa06a4c9a1b4400cc69d7603f7f5c73 GIT binary patch literal 6148 zcmeHK&ubGw6n@i2H``Lk!O~s|171UHpanxO+cgn9c~Y_h#mOyUdr&%nlK;aFTY3T13=@D{O2a++u26`HHRC z9uLU$GtMX@K^4VtXHEg9z`w45TDx1+CrKlk(9QLmqffjj_wf zpn`I&^$M8LTN+YGgC)-QyKs_ed2Zixm7EuOS?%xtU~B7*2M;~Z_cpx`(Puf0s<@hz zVLX1PTCb!mlIuK9Ugz0#*n0F#iYm@UHr9kZ%~10GO)gS74dq0nrRGLv!1tT}u(dOr zb)O!#dGBD}=Cj^Gx6Kc`z4_d4Za;o zP?^1AFhfT_w{?NV+MuBmvzHHM-^}a{h3U8B`COM13k2s2^fV_H135oH}bc{3BeMs;doZ3W7b3b)t^qUAQ)kag_iAi?u=Y Qz}$y`mca$5z+YA1H#@wM#{d8T literal 0 HcmV?d00001 diff --git a/littleX_BE/.DS_Store b/littleX_BE/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..edb3523d349d4d19ff7ab19edce95453871a32cd GIT binary patch literal 6148 zcmeHKK~BRk5FD2xrEtlS3sOEnBz_R8^uU1&JOF4@pdxJqvW{b(Vc*lC7XP@Z&JsvQ_E2igVHR)tq$A45n z_AbITZt;u>8v8dct1-vq#W&J?zrcr?s`6EZ7C z!n;R`cg{UWDeue=-yLu82e`zDE6H&|OvxzP48O{c#wug3ZHgzXIFCeg`T|S5kiEnk zmK%Ioag)zWGgH76Fa>s00oH7>=upvGQ@|831=b44_aUJRW&vwO|LI`kj{w9zyS*`% zUq<010keR$B1dRWsYIo^aKvy*XMYm%vVgUs(&574!-bh$IH5Q{JMW+Pbhu2>T2sIj zXe+R%m$B6U(eLN~Hp#9`0aIY76mb3gDj)KZLT&9loYdNcenS_NyjpQhVc<(KbEOm? b(Y>)hk${*5tQFZqvmXI3gEgkWpDOSTugq3q literal 0 HcmV?d00001 diff --git a/littleX_BE/littleX.test.jac b/littleX_BE/littleX.test.jac index 3a2c396..829160a 100644 --- a/littleX_BE/littleX.test.jac +++ b/littleX_BE/littleX.test.jac @@ -105,45 +105,6 @@ test test_load_user_profiles { } test chat_with_ai_basic { -<<<<<<< Updated upstream - root spawn create_tweet(content="AI is amazing!"); - root spawn create_tweet(content="Learning Jac language today"); - - result = root spawn chat_with_ai( - message="What topics are people discussing?", - chat_history=[] - ); - - check result.response; - check len(result.chat_history) == 2; - check result.chat_history[0]["role"] == "user"; - check result.chat_history[1]["role"] == "assistant"; -} - -test chat_with_ai_context { - first_result = root spawn chat_with_ai( - message="Summarize the tweets", - chat_history=[] - ); - - second_result = root spawn chat_with_ai( - message="Tell me more about that", - chat_history=first_result.chat_history - ); - - check second_result.response; - check len(second_result.chat_history) == 4; -} - -test chat_with_ai_no_tweets { - empty_result = root spawn chat_with_ai( - message="What's happening?", - chat_history=[] - ); - - check empty_result.response; - check "no tweets" in empty_result.response.lower() or empty_result.response; -======= root spawn create_tweet( content = "AI is amazing!", ); @@ -167,27 +128,12 @@ test chat_with_ai_context { ); check second.response; check len(second.chat_history) == 4; ->>>>>>> Stashed changes } test chat_with_ai_multiple_users { profile1 = Profile("Thiru"); profile1 spawn follow_request(); profile1 spawn create_tweet("Working on my project"); -<<<<<<< Updated upstream - - profile2 = Profile("Thami"); - profile2 spawn follow_request(); - profile2 spawn create_tweet("Great weather today"); - - result = root spawn chat_with_ai( - message="Who is talking about what?", - chat_history=[] - ); - - check result.response; - check "Thiru" in result.response.lower() or "Thami" in result.response.lower(); -======= profile2 = Profile("Thami"); profile2 spawn follow_request(); profile2 spawn create_tweet("Great weather today"); @@ -195,5 +141,4 @@ test chat_with_ai_multiple_users { message = "Who is talking about what?", ); check result.response; ->>>>>>> Stashed changes } \ No newline at end of file From a27438ebaf0d6eb23b76d965802d3d89003b833b Mon Sep 17 00:00:00 2001 From: ThiruvarankanM Date: Wed, 1 Oct 2025 20:34:11 +0530 Subject: [PATCH 4/5] error_1 --- littleX_BE/littleX.test.jac | 39 ------------------------------------- 1 file changed, 39 deletions(-) diff --git a/littleX_BE/littleX.test.jac b/littleX_BE/littleX.test.jac index 829160a..ca2c2a7 100644 --- a/littleX_BE/littleX.test.jac +++ b/littleX_BE/littleX.test.jac @@ -103,42 +103,3 @@ test test_load_user_profiles { load_user_walker = root spawn load_user_profiles(); check load_user_walker.profiles; } - -test chat_with_ai_basic { - root spawn create_tweet( - content = "AI is amazing!", - ); - root spawn create_tweet( - content = "Learning Jac language today", - ); - result = root spawn chat_with_ai( - message = "What topics are people discussing?", - ); - check result.response; - check len(result.chat_history) == 2; -} - -test chat_with_ai_context { - first = root spawn chat_with_ai( - message = "Summarize the tweets", - ); - second = root spawn chat_with_ai( - message = "Tell me more", - chat_history = first.chat_history, - ); - check second.response; - check len(second.chat_history) == 4; -} - -test chat_with_ai_multiple_users { - profile1 = Profile("Thiru"); - profile1 spawn follow_request(); - profile1 spawn create_tweet("Working on my project"); - profile2 = Profile("Thami"); - profile2 spawn follow_request(); - profile2 spawn create_tweet("Great weather today"); - result = root spawn chat_with_ai( - message = "Who is talking about what?", - ); - check result.response; -} \ No newline at end of file From 4a3483f24e446a15ae81bb95f4e4dbb38c4eba84 Mon Sep 17 00:00:00 2001 From: ThiruvarankanM Date: Wed, 1 Oct 2025 20:34:46 +0530 Subject: [PATCH 5/5] ai-testclass-updated-final --- littleX_BE/littleX.test.jac | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/littleX_BE/littleX.test.jac b/littleX_BE/littleX.test.jac index ca2c2a7..829160a 100644 --- a/littleX_BE/littleX.test.jac +++ b/littleX_BE/littleX.test.jac @@ -103,3 +103,42 @@ test test_load_user_profiles { load_user_walker = root spawn load_user_profiles(); check load_user_walker.profiles; } + +test chat_with_ai_basic { + root spawn create_tweet( + content = "AI is amazing!", + ); + root spawn create_tweet( + content = "Learning Jac language today", + ); + result = root spawn chat_with_ai( + message = "What topics are people discussing?", + ); + check result.response; + check len(result.chat_history) == 2; +} + +test chat_with_ai_context { + first = root spawn chat_with_ai( + message = "Summarize the tweets", + ); + second = root spawn chat_with_ai( + message = "Tell me more", + chat_history = first.chat_history, + ); + check second.response; + check len(second.chat_history) == 4; +} + +test chat_with_ai_multiple_users { + profile1 = Profile("Thiru"); + profile1 spawn follow_request(); + profile1 spawn create_tweet("Working on my project"); + profile2 = Profile("Thami"); + profile2 spawn follow_request(); + profile2 spawn create_tweet("Great weather today"); + result = root spawn chat_with_ai( + message = "Who is talking about what?", + ); + check result.response; +} \ No newline at end of file