File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
packages/cli/src/cli/localizer Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " lingo.dev " : patch
3+ ---
4+
5+ Include hints in payload to LLMs
Original file line number Diff line number Diff line change @@ -188,20 +188,41 @@ function createAiSdkLocalizer(params: {
188188 } ,
189189 } ,
190190 ] ,
191+ [
192+ {
193+ sourceLocale : "en" ,
194+ targetLocale : "es" ,
195+ data : {
196+ spring : "Spring" ,
197+ } ,
198+ hints : {
199+ spring : [ "A source of water" ] ,
200+ } ,
201+ } ,
202+ {
203+ sourceLocale : "en" ,
204+ targetLocale : "es" ,
205+ data : {
206+ spring : "Manantial" ,
207+ } ,
208+ } ,
209+ ] ,
191210 ] ;
192211
212+ const hasHints = input . hints && Object . keys ( input . hints ) . length > 0 ;
213+
193214 const payload = {
194215 sourceLocale : input . sourceLocale ,
195216 targetLocale : input . targetLocale ,
196217 data : input . processableData ,
218+ ...( hasHints && { hints : input . hints } ) ,
197219 } ;
198220
199221 const response = await generateText ( {
200222 model,
201223 ...params . settings ,
202224 messages : [
203225 { role : "system" , content : systemPrompt } ,
204- { role : "user" , content : "OK" } ,
205226 ...shots . flatMap (
206227 ( [ userShot , assistantShot ] ) =>
207228 [
You can’t perform that action at this time.
0 commit comments