Getting structured outputs from LLMs
ctx.llm.structured()
call.
input
field.
input
field.
Schema
The schema is a JSON schema that describes the structure of the output you want. Or in TypeScript, a Zod schema.
Instructions
Sometimes, you may want to provide additional instructions to the LLM to help it understand the structure of the output you want.
You can do this by providing the instructions
field.
ctx.llm.structured
will use the Claude Sonnet 3.5 model provided by Inferable.
However, this is intended for testing only. You can specify your own LLM provider details when calling ctx.llm.structured
.
ctx.llm.structured()
will throw an error.