Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini detect language to translate pr #42

Merged

Conversation

duong2417
Copy link
Contributor

@duong2417 duong2417 commented Jan 26, 2025

BACKEND:
Gemini translates the message and simultaneously detects the language of the message. Then, I check if the detected language doesn't exist in languages retrieved from Firebase; it is added to Firebase.

When the list of languages has no data, Gemini returns null as the value of the "translation" field, and the detected language is still added to Firebase.

I don't use function calling because Gemini's output is unstable, or maybe I haven't configured it correctly (that configuration I commented in code). Sometimes it returns correctly, and sometimes it only returns the functionCall without the translation.

FRONTEND:
Retrieve the locale language from the map response. Each message has only ONE translation instead of multiple.

Video demo:
https://github.com/user-attachments/assets/80afd9ad-6794-4ed4-962c-2d12a5853eb4

Data structure:
Ảnh chụp màn hình (390)
data structure

@duong2417 duong2417 requested a review from suesitran as a code owner January 26, 2025 05:17
@suesitran suesitran merged commit d58d463 into suesitran:main Feb 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants