JSON Object generation
JSON object generation and data extraction
You can use AI agents to generate structured JSON objects and extract structured data from unstructured data.
This is useful for building smart, context-driven applications with LLM-generated data or for data extraction where you generate structured JSON from unstructured data.
Features
- Multimodal inputs: Extract structured data from various data sources (text, audio files, images, websites).
- Validated output: The generated JSON output is validated against a zod schema you provide.
- Tries: In case of generation failure, Scoopika retries generating a valid JSON object, sending the errors back to the LLM to avoid repeating them. You can control the number of tries.
Usage
We can use AI agents to both output generative JSON objects or do some data extraction, let’s see examples for both.
JSON object generation
Data extraction
Conversational-context
For example, if you have a conversation between your AI assistant and a user in session s_123
, and you want to generate JSON data based on the conversation to decide the next steps, you can pass the session ID to the run options as you do for text generation, and the generation will be driven by the conversation context:
You can even use a different AI agent with a different prompt and task, possibly using another LLM provider.
Was this page helpful?