Bu hafta stajımda ağırlıklı olarak Bilgin uygulamasına üretken yapay zekâ özellikleri ekleme, güvenliği artırma ve sohbet deneyimini geliştirme üzerine çalıştım. İlk olarak Gemini için bir API key oluşturdum ve bunu uygulamaya entegre ettim. Güvenlik açısından API key’i doğrudan kodun içinde tutmak yerine .env dosyasında environment variable olarak sakladım.
Yapay zekâ entegrasyonu sırasında API isteklerinin daha sağlıklı çalışması için request header yapısı, veri aktarımı ve hata yönetimi tarafında çeşitli iyileştirmeler yaptım. Ayrıca AI ile iletişim kuran kodları arayüz kodlarından ayırmak için ayrı bir service layer yapısı oluşturdum. Bu sayede proje daha düzenli ve sürdürülebilir hale geldi. Cevapların ekranda daha doğal görünmesi için de streaming yaklaşımını kullandım; böylece AI cevapları tek seferde gelmek yerine kademeli olarak kullanıcıya gösterildi.
Güvenlik tarafında ise rooted cihazları tespit etmeye yönelik ek bir yapı ekledim. Bu özelliğin amacı, güvenlik riski oluşturabilecek cihazlarda kullanıcıyı uyarmak ve bazı işlemleri sınırlandırmaktı. Arayüz tarafında da çeşitli geliştirmeler yaptım. Örneğin “delete chat” özelliğini daha düzgün bir select-box yapısına dönüştürdüm, mesaj balonlarının tasarımını ve tipografisini iyileştirdim. Ayrıca AI cevaplarının daha okunabilir ve düzenli görünmesi için markdown desteği ekledim.
Bunun yanında, kullanıcı mesajları ile yapay zekâ mesajlarını daha net ayırabilmek için modüler bir chat bubble yapısı oluşturdum. Bu geliştirmeleri yaparken mümkün olduğunca React Native’in kendi özelliklerini ve projede zaten var olan yapıları kullandım. Yeni harici kütüphaneler eklemekten kaçınarak bağımlılıkları azaltmaya ve projeyi daha yönetilebilir tutmaya özen gösterdim.
Haftanın devamında chat bubble bileşenlerine Text-to-Speech, Copy, Share, Like ve Dislike özelliklerini ekledim. Son olarak, başka bir stajyer tarafından Mizan projesi için geliştirilen özel AI modeli de kendi mobil arayüzüme entegre ettim. Haftanın sonunda ise yaptığım tüm bu geliştirmeleri ve eklediğim özellikleri supervisor’ımıza sundum.
This week, during my internship, I primarily focused on adding generative AI features to the Bilgin application, enhancing security, and improving the chat experience. First, I created an API key for Gemini and integrated it into the application. For security reasons, instead of storing the API key directly in the code, I kept it as an environment variable in the .env file.
During the AI integration, I made various improvements to the request header structure, data transfer, and error handling to ensure healthier API requests. I also created a separate service layer structure to separate the code communicating with the AI from the interface code. This made the project more organized and sustainable. I also used a streaming approach to make the responses appear more natural on the screen; thus, instead of the AI responses appearing all at once, they were shown to the user gradually.
On the security side, I added an additional structure to detect rooted devices. The purpose of this feature was to warn the user about devices that might pose a security risk and to restrict certain operations. I also made various improvements to the interface. For example, I transformed the “delete chat” feature into a more streamlined select-box structure, improved the design and typography of message bubbles, and added markdown support to make AI responses more readable and organized.
In addition, I created a modular chat bubble structure to more clearly distinguish between user messages and AI messages. While making these improvements, I used React Native's own features and existing structures in the project as much as possible. I avoided adding new external libraries, focusing on reducing dependencies and keeping the project more manageable.
Later in the week, I added Text-to-Speech, Copy, Share, Like, and Dislike features to the chat bubble components. Finally, I integrated a custom AI model developed by another intern for the Mizan project into my mobile interface. At the end of the week, I presented all these improvements and added features to our supervisor.