La documentazione per sviluppatori è in inglese.
Tipo di scheda
snippet
A joke, fun fact, quote, affirmation or life hack.
Version 1 · schema snippet.v1.schema.json
Layouts
Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.
Fields
The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.
| Field | Type | Required | Notes |
|---|---|---|---|
kind | enum | yes | joke · fun_fact · quote · affirmation · life_hack |
text | string | yes | |
punchline | string | null | yes | Jokes only: shown after the set-up. |
attribution | null | object | yes | |
attribution.name | string | yes | |
attribution.detail | string | null | yes |
Example
A recorded answer to “Tell me a joke”. Open it in the Answer Lab to see every layout and style.
{
"v": 2,
"id": "ans_0g6a4c3h0ntghfnm",
"matched": true,
"locale": "en",
"skill": "joke",
"confidence": 0.9,
"text": "How can you tell the difference between a monster and a banana? Try picking it up. If you can’t, it’s either a monster or a giant banana.",
"speech": "How can you tell the difference between a monster and a banana? … Try picking it up. If you can’t, it’s either a monster or a giant banana.",
"card": {
"type": "snippet",
"version": 1,
"data": {
"kind": "joke",
"text": "How can you tell the difference between a monster and a banana?",
"punchline": "Try picking it up. If you can’t, it’s either a monster or a giant banana.",
"attribution": null
}
},
"sources": [
{
"name": "WebKnox joke collection",
"url": null,
"license": null
}
],
"follow_ups": [],
"actions": [],
"usage": {
"billable": true
}
}