lamini-ai / lamini

Apache License 2.0
2.5k stars 155 forks source link

Structured Outputs options #73

Closed jjovalle99 closed 2 weeks ago

jjovalle99 commented 2 weeks ago

Hi Lamini team,

I did not find the information on available options for the JSON output. I know that it allows "str", " bool", "float", and "int"; but I am not sure if it handles arrays (i.e. List[str]) or similar. The following code did not work:

schema: dict = {"capital": List[str]} # or {"capital": "List[str]"}
response: str = await llm.async_generate(prompt=format_llama3_prompt(user_message=user_message), output_type=schema)

Can you please point me to the relevant information on this?

edamamez commented 2 weeks ago

Hi there, thank you for reaching out!

We have updated our documentation -- we currently support str, int, float, and boolean types. We do not support arrays at this time.

edamamez commented 1 week ago

Hello! Just wanted to update you that we support lists as enums! You can learn more here: https://lamini-ai.github.io/inference/json_output/#values-other-than-strings