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.
Hello @chenmoneygithub @okhat
close #1803
Added two different translation adapters that we can use in our DSPy pipelines. Let me explain what each does:
The
TranslationAdapter
is your straightforward translator - it takes content and translates it directly to your target language. Think of it like Google Translate but with better context awareness and formatting rules. It's fast and efficient since it's doing a single hop translation.The
ChainedTranslationAdapter
is a bit more interesting - it does translation in three steps:Why two adapters? Well, they're good for different things.
Use the simple
TranslationAdapter
when:Go for
ChainedTranslationAdapter
when:Both adapters handle all the formatting, cultural adaptations, and technical terms properly. They also work nicely with the existing ChatAdapter for message handling.
I'm not pushing for one over the other - they both have their place depending on what you're building. Would love to get your thoughts on this approach and any improvements we could make.