Skip to content

feat:Combine Translation and Language Detection in Gemini API Response #52

@hemanth5055

Description

@hemanth5055

Is your feature request related to a problem? Please describe.
Currently, we make a separate API call to detect the source language before translating text. This adds extra overhead and slows down the workflow. It’s frustrating to make multiple calls when the translation API already has the capability to detect the language.

Describe the solution you'd like
Modify Gemini to return a JSON response that includes both the translated text and the detected source language, for example:

{
  "translation": "",
  "source_language": ""
}

This will eliminate the need for a separate language detection API call.

Describe alternatives you've considered
The alternative is to continue using a separate API call solely for language detection, but this is less efficient and increases latency.

Additional context
This change would streamline the translation workflow, reduce API usage, and improve performance.

Note: Please add the Hacktoberfest label to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature requesthacktoberfestreviewissue/bug require reviewed by owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions