text` with the fine-tuned encoder at `url` (chalk-encoder:// or chalk-encoder+grpc[s]://): `label_index` indexes `labels` (a JSON array of the model's label names) and `probability` is that label's probability renormalized over `labels`. A row is null where `text` is null; `error` is set on every row of a failed call. `url` and `labels` must be literals.questions (noul/choice/score) about `state` and returns the answers as a JSON string alongside usage statistics.SELECT openai_complete('Classify this card transaction memo into exactly one category from [groceries, dining, travel, utilities, other]. Reply with the category only, lowercase. Memo: UBER *TRIP SAN FRANCISCO CA', model => 'gpt-4o-mini', temperature => 0.0, max_tokens => 5).completion AS memo_category;
| memo_category |
| ------------- |
| travel |SELECT openai_complete('Rate the urgency of this support ticket from 1 (low) to 5 (critical) and name its topic in one word. Ticket: Our checkout page has returned 500 errors for every customer since 9am.', model => 'gpt-4o-mini', temperature => 0.0, response_format => '{"type": "json_schema", "json_schema": {"name": "ticket", "strict": true, "schema": {"type": "object", "properties": {"urgency": {"type": "integer"}, "topic": {"type": "string"}}, "required": ["urgency", "topic"], "additionalProperties": false}}}').completion AS ticket_triage;
| ticket_triage |
| -------------------------------- |
| {"topic":"Checkout","urgency":5} |SELECT json_extract_scalar(openai_complete_raw('Classify this card transaction memo into one category (groceries, travel, dining, utilities). Reply with only the category: UBER *TRIP SAN FRANCISCO', model => 'gpt-4o-mini', temperature => 0.0), '$.choices[0].message.content') AS memo_category;
| memo_category |
| ------------- |
| travel |SELECT json_extract_scalar(openai_complete_raw('Summarize this support ticket in one sentence: My order #4821 arrived with a cracked screen and I need a replacement before Friday.', model => 'gpt-4o-mini', max_tokens => 5, temperature => 0.0), '$.choices[0].finish_reason') AS finish_reason;
| finish_reason |
| ------------- |
| length |SELECT round(cosine_similarity_vector(openai_embed('Wireless noise-cancelling headphones', model => 'text-embedding-3-small').embedding, openai_embed('Bluetooth over-ear headset with ANC', model => 'text-embedding-3-small').embedding), 1) AS title_similarity;
| title_similarity |
| ---------------- |
| 0.6 |SELECT cardinality(openai_embed('Wireless noise-cancelling headphones', model => 'text-embedding-3-small', dimensions => 256).embedding) AS embedding_dims;
| embedding_dims |
| -------------- |
| 256 |questions (noul/choice/score) about `state` and returns the answers as a JSON string alongside usage statistics.