sublayerapp / sublayer

A model-agnostic Ruby Generative AI DSL and framework. Provides base classes for building Generators, Actions, Tasks, and Agents that can be used to build AI powered applications in Ruby.
https://docs.sublayer.com
MIT License
119 stars 2 forks source link

Add list of strings output adapter and update providers to handle the new attribute #47

Closed swerner closed 4 months ago

swerner commented 4 months ago

Added a new output adapter to support returning a list of strings from a prompt.

Needed to add handling for the items.type attribute to the 3 providers. That format_properties method is starting to get messy. I suspect the next few output adapters on the issues list will help us figure out a better way of handling those attributes on the providers end without having to add something new each time we create a new output adapter.

Also updated the Gemini provider to use function calling because the previous XML style function calling was looking like it would be too much work to support parsing arrays in its responses...but in doing so, it screwed up the other tests and now gemini won't call functions correctly for the single_string adapter 🤦

Going to think on what to do for a bit but wanted to get this up for now...may need to fix https://github.com/sublayerapp/sublayer/issues/43 to get gemini working reliably again...

AndrewBKang commented 4 months ago

one test but otherwise lgtm~

AndrewBKang commented 4 months ago

🔥 🚀

AndrewBKang commented 4 months ago

👍