Skip to content

Commit 15937c0

Browse files
authored
GSoC'25 Week 09 Update by Diwangshu Kakoty (#369)
* gsoc-week09 * fix: update image format and improve alt text in Week 09 update
1 parent ab8f2db commit 15937c0

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: "GSoC ’25 Week 09 Update by Diwangshu Kakoty"
3+
excerpt: "Reflection Learning Widget in Music Blocks"
4+
category: "DEVELOPER NEWS"
5+
date: "2025-08-10"
6+
slug: "2025-08-10-gsoc-25-diwangshu-week09"
7+
author: "@/constants/MarkdownFiles/authors/diwangshu-kakoty.md"
8+
tags: "gsoc25,sugarlabs,week09,AI"
9+
image: "assets/Images/GSOC.webp"
10+
---
11+
12+
<!-- markdownlint-disable -->
13+
14+
# Week 09 Progress Report by Diwangshu Kakoty
15+
16+
**Project:** [AI Tools for Reflection](https://github.com/Commanderk3/reflection_ai)
17+
**Mentors:** [Walter Bender](https://github.com/walterbender), [Sumit Srivastava](https://github.com/sum2it)
18+
**Assisting Mentors:** [Devin Ulibarri](https://github.com/pikurasa), [Ajeet Pratap Singh](https://github.com/apsinghdev)
19+
**Reporting Period:** 2025-07-28 - 2025-08-04
20+
21+
---
22+
23+
## Goals for This Week
24+
25+
- **Goal 1:** Fixed 'reflection' widget UI.
26+
- **Goal 2:** Improved chat interface.
27+
- **Goal 3:** Improved prompts for child-friendly language.
28+
- **Goal 4:** Automated algorithm generation.
29+
- **Goal 5:** Fixed a bug where the first message triggered twice.
30+
31+
---
32+
33+
## This Week’s Achievements
34+
35+
1. **Fixed 'reflection' widget UI**
36+
- The user interface design of the widget now aligns with other widgets. There is a sidebar with buttons like export and "generate a summary".
37+
38+
<a href="https://ibb.co/PZWZQDhN"><img src="https://i.ibb.co/gMWMV4T3/Screenshot-2025-08-10-195926.png" alt="chat interface" border="0"></a>
39+
40+
2. **Improved chat interface**
41+
- Every message bubble will now show its sender name on top of the text.
42+
43+
3. **Improved prompts for child-friendly language**
44+
- I was suggested by my mentor that the LLM's responses were not child friendly in terms of its complexity of sentences. So, I have added specific instructions regarding this.
45+
46+
4. **Automated algorithm generation**
47+
- Earlier, I had a "Start" button to initialize the conversation. When clicked, Music Blocks would send the project code to the backend, which then called the LLM to generate an algorithm for it and attempt to predict the code’s purpose. Now, there’s no button — simply opening the widget window triggers the entire process automatically. Implementing this change took some time, as I had to fix a tricky bug. I’ll explain more about that bug in the next point.
48+
49+
---
50+
51+
## Challenges & How I Overcame Them
52+
53+
- **Challenge 01:** The first message was triggered twice. As I mentioned, the bot automatically sends the first message containing the project code algorithm and asks the user to confirm if the guess is correct. However, the algorithm generation function ended up being triggered twice. I discovered that the widget’s initialization function runs twice. I don’t think this is a bug in itself, as the same behavior occurs with all other widgets.
54+
55+
**Solution :** The challenge was identifying the problem; the solution itself was straightforward. I initialized a boolean flag that is set to true only during the first call of the initialization function. This allows us to prevent subsequent calls by simply checking the flag’s value.
56+
57+
- **Challenge 02:** While integrating my `generateAnalysis()` function in a JavaScript class, I was passing `this.chatHistory` and `this.summary` as arguments. This caused a 422 error from the FastAPI backend because the arguments were evaluated before the function executed, leading to stale or incorrect values.
58+
59+
**Solution :** I removed the parameters from generateAnalysis() and accessed this.chatHistory and this.summary directly inside the method. This ensured the function always used the latest and correct state from the class instance at the time of execution, eliminating the backend validation error
60+
61+
---
62+
63+
## Key Learnings
64+
65+
- Always ensure method parameters match actual property names, and be mindful that passing arguments captures their value at that moment. Accessing properties directly from this inside the method guarantees using the latest, correct state, especially in asynchronous JavaScript flows.
66+
---
67+
68+
## Next Week’s Roadmap
69+
70+
- The widget is almost complete. Now I need to figure out deploying the FastAPI application in AWS.
71+
- I will also be testing Sugar-ai to see how it can beneficial for the reflection widget.
72+
73+
---
74+
75+
## Resources & References
76+
77+
- **Repository:** [reflection_streamlit](https://github.com/Commanderk3/reflection_streamlit)
78+
- **Streamlit App:** [Reflection App](https://reflectionapp-2yoxtvn6sknvktme2zorvq.streamlit.app/)
79+
80+
---
81+
82+
## Acknowledgments
83+
84+
Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support.
85+
86+
---

0 commit comments

Comments
 (0)