Skip to content

Commit fc51389

Browse files
authored
Added sample json_schema for tag generation (#34)
1 parent d5c6dcd commit fc51389

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "message_with_tags",
3+
"description": "An AI message with optional metadata and a list of machine-readable tags (e.g., for routing or confidence).",
4+
"schema": {
5+
"type": "object",
6+
"properties": {
7+
"output": {
8+
"type": "string",
9+
"minLength": 1,
10+
"description": "The message text to display to the user."
11+
},
12+
"metadata": {
13+
"type": "object",
14+
"description": "Optional metadata about the generation (e.g., model, latency).",
15+
"additionalProperties": true
16+
},
17+
"tags": {
18+
"type": "array",
19+
"description": "Labels describing attributes of the response. Use a 'confidence' tag to express certainty (e.g., 'confidence=0.82' or {\"name\":\"confidence\",\"value\":\"high\"}).",
20+
"items": {
21+
"anyOf": [
22+
{
23+
"type": "string",
24+
"minLength": 1,
25+
"description": "Inline tag in 'key:value' or 'key=value' form (e.g., 'topic:recursion', 'confidence=0.82')."
26+
},
27+
{
28+
"type": "object",
29+
"description": "Structured tag.",
30+
"properties": {
31+
"name": {
32+
"type": "string",
33+
"minLength": 1,
34+
"description": "Tag key (e.g., 'topic', 'confidence')."
35+
},
36+
"value": {
37+
"type": ["string", "number", "boolean"],
38+
"description": "Tag value (e.g., 'recursion', 0.82, true)."
39+
}
40+
},
41+
"required": ["name", "value"],
42+
"additionalProperties": false
43+
}
44+
]
45+
}
46+
}
47+
},
48+
"required": ["output", "tags"],
49+
"additionalProperties": false
50+
}
51+
}

0 commit comments

Comments
 (0)