extract(), check(), summarize(), and text() that handle prompting, parsing, and validation for you.
In the ADK, Zai is available via adk.zai. It automatically uses your agent’s configured zai model from defaultModels in agent.config.ts.
What you can do
| Method | What it does | Page |
|---|---|---|
extract() | Pull structured data from unstructured text | Extract structured data |
check() | Verify a Boolean condition | Classify, validate and filter |
label() | Categorize content with multiple labels | Classify, validate and filter |
filter() | Filter an array by a condition | Classify, validate and filter |
sort() | Sort items using natural language criteria | Classify, validate and filter |
rate() | Rate items on a 1-5 scale | Classify, validate and filter |
group() | Group items into categories | Classify, validate and filter |
text() | Generate text from a prompt | Generate text and summaries |
rewrite() | Transform text based on instructions | Generate text and summaries |
summarize() | Summarize long content | Generate text and summaries |
answer() | Answer questions with citations | Generate text and summaries |
patch() | Make surgical edits to files | Generate text and summaries |
Quick example
Model configuration
Zai uses thezai model from defaultModels in agent.config.ts:
Method categories
Extract structured data
Pull typed data from unstructured text.
Generate text and summaries
Generate, rewrite, summarize, and answer with citations.
Classify, validate and filter
Check conditions, label content, filter, sort, rate, and group.