Hi @masci
I saw banks allows for entering the model name e.g. {% completion model="gpt-4o" %} but no direct support for structured outputs. One approach I'd see is to use litellm, from their docs:
messages = [{"role": "user", "content": "List 5 important events in the XIX century"}]
class CalendarEvent(BaseModel):
name: str
date: str
participants: list[str]
class EventsList(BaseModel):
events: list[CalendarEvent]
resp = completion(
model="gpt-4o-2024-08-06",
messages=messages,
response_format=EventsList
)
using banks I guess this would be changed with
response = completion(
model="gpt-4o-2024-08-06",
messages=registry.get(name="xix_events"),
response_format=EventsList
)
and I guess this would work, but is this the intended use? Is there a recommended way to handle structured outputs directly with banks / wo relying on litellm?
I'd imagine something like
response = prompt.text(data = {"some_required_param": "some_value"}, response_format = EventsList)
Hi @masci
I saw banks allows for entering the model name e.g.
{% completion model="gpt-4o" %}but no direct support for structured outputs. One approach I'd see is to uselitellm, from their docs:using
banksI guess this would be changed withand I guess this would work, but is this the intended use? Is there a recommended way to handle structured outputs directly with banks / wo relying on
litellm?I'd imagine something like