Open
Conversation
… into ai-assistant-refactoring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Translation Feedback
New endpoint:
/api/app/ai-assistant/feedbackPayload:
id_segment(required)id_client(required)source_language(required) - the source language of the stringtarget_language(required) - the target language of the stringtext(required) - the source stringtranslation(required) - the translation to be evaluatedstyle(required) - one of [faithful,fluid,creative]Example:
{ "id_client": "123", "localized_source": "Italian (Italy)", "localized_target": "English (USA)", "text": "Ciao papà", "translation": "Hey dad what's up?", "style": "creative", "id_segment": "123" }Canal SSE channel type:
ai_assistant_feedbackResponse:
arrayA typical excellent feedback:
[ "category" => "Excellent", "comment" => "The translation takes artistic liberties appropriate to the "Creative" style. By expanding "Ciao papà" to "Hey dad what's up?", it captures a casual, engaging tone while staying true to the spirit of the original greeting. Great job!" ]A bad feedback:
[ 'category' => 'Does Not Match Source', 'comment' => 'The translation "Hey Superman" doesn\'t capture the spirit or any recognizable aspect of the original text "Ciao papà." Even with the creative style allowing for adaptation, it diverges significantly, lacking a connection to the original meaning. A rewrite is necessary to reflect the original sentiment creatively.', ]Alternative translations
New endpoint:
/api/app/ai-assistant/alternative-translationsPayload:
id_segment(required)id_client(required)source_language(required) - the source language of the stringtarget_language(required) - the target language of the stringsource_sentence(required) - the source stringsource_context_sentences_string(required) - the source contexts (the previous and the next source phrases splitted by a new line.)target_sentence(required) - the source stringtarget_context_sentences_string(required) - the target contexts (the previous and the next target phrases splitted by a new line.)excerpt(required) - target excerpt to be replacedstyle_instructions(required) - one of [faithful,fluid,creative]Canal SSE channel type:
ai_assistant_alternative_translationsPossible responses:
NULL- if Gemini doesn't find any valid alternative, or the sentence/excerpt doesn't make sensestring- in some cases Gemini client responds with a string error (example: the response is too slow)array- up to 4 elements. Example: `[ { "alternative":"Lavable a máquina", "context":"Indica que el producto se puede lavar en máquina.", } ]Related PR: https://github.com/matecat/matecat_docker_build/pull/15