google / langfun

OO for LLMs
Apache License 2.0
100 stars 17 forks source link

`lf.query`: multi-modal support in fewshot scenarios. #232

Closed copybara-service[bot] closed 1 month ago

copybara-service[bot] commented 1 month ago

lf.query: multi-modal support in fewshot scenarios.

Users could use objects of lf.Template or its subclasses as a mix of multi-modal objects.

Example:

lf.query(
   'What is this {{image}}?', image=lf.Image(...), lm=...,
   examples=[
     lf.MappingExample(
       input=lf.Template(
         'What is {{image}}?', image=lf.Image(...)),
       output='dog'
     )
   ]
)