feat: Add Integration for translated's Lara model#2848
Merged
bogdankostic merged 17 commits intomainfrom Feb 24, 2026
Merged
Conversation
Member
|
@bogdankostic I'll help review this PR. Could you please create a GitHub issue using this template? This would help track the work needed for this new integration (in addition to this PR). |
anakin87
reviewed
Feb 24, 2026
Member
anakin87
left a comment
There was a problem hiding this comment.
Did a first pass. I left several comments but overall it's looking good.
Comment on lines
+264
to
+293
| @classmethod | ||
| def from_dict(cls, data: dict[str, Any]) -> "LaraDocumentTranslator": | ||
| """ | ||
| Deserializes a LaraDocumentTranslator from a dictionary. | ||
|
|
||
| :param data: Dictionary containing the LaraDocumentTranslator configuration. | ||
| :return: LaraDocumentTranslator instance. | ||
| """ | ||
| deserialize_secrets_inplace(data["init_parameters"], keys=["access_key_id", "access_key_secret"]) | ||
| return default_from_dict(cls, data) | ||
|
|
||
| def to_dict(self) -> dict[str, Any]: | ||
| """ | ||
| Serializes a LaraDocumentTranslator to a dictionary. | ||
|
|
||
| :return: Dictionary containing the LaraDocumentTranslator configuration. | ||
| """ | ||
| return default_to_dict( | ||
| self, | ||
| access_key_id=self.access_key_id.to_dict(), | ||
| access_key_secret=self.access_key_secret.to_dict(), | ||
| source_lang=self.source_lang, | ||
| target_lang=self.target_lang, | ||
| context=self.context, | ||
| instructions=self.instructions, | ||
| style=self.style, | ||
| adapt_to=self.adapt_to, | ||
| glossaries=self.glossaries, | ||
| reasoning=self.reasoning, | ||
| ) |
Member
There was a problem hiding this comment.
check if needed or already covered by new simplified serialization/deserialization defaults
Contributor
Author
|
Thanks for your feedback @anakin87! All of your comments should be addressed now |
Contributor
|
@anakin87 thanks for taking over this one 👍🏽 |
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.
Proposed Changes:
This PR adds the Lara integration for Haystack. Lara is an adaptive translation API (by translated) that combines LLM-style fluency with low hallucination and latency, and supports domain adaptation via context, instructions, translation memories, and glossaries.
Lara documentation: https://support.laratranslate.com/en
Lara SDK documentation: https://developers.laratranslate.com/docs/introduction
How did you test it?
I added unit tests and an integration test.
Notes for the reviewer
lara-haystackChecklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.