-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystemone.schema.json
More file actions
161 lines (161 loc) · 5.64 KB
/
Copy pathsystemone.schema.json
File metadata and controls
161 lines (161 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/compass/api/systemone.schema.json",
"title": "Compass /v1/systemone",
"description": "Request and response contract for Compass. Wire-compatible with TypeSafe's public POST /v1/systemone format, which is what JevBench's `typesafe` adapter sends and reads. Semantic checks the schema cannot express (a choice must name one of its own options; probabilities must sum to 1; score levels are keyed \"0\"..\"k\") are enforced in compass/contract.py.",
"$defs": {
"text": {
"description": "A string, or JSON structure that is serialised deterministically before the model reads it.",
"anyOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]
},
"choiceQuestion": {
"type": "object",
"required": ["type", "instructions", "criteria"],
"additionalProperties": false,
"properties": {
"type": {"const": "choice"},
"instructions": {"$ref": "#/$defs/text"},
"criteria": {
"description": "Option key -> description. Key order never changes the answer.",
"type": "object",
"minProperties": 2,
"maxProperties": 64,
"propertyNames": {"minLength": 1},
"additionalProperties": {"$ref": "#/$defs/text"}
}
}
},
"scoreQuestion": {
"type": "object",
"required": ["type", "instructions", "criteria"],
"additionalProperties": false,
"properties": {
"type": {"const": "score"},
"instructions": {"$ref": "#/$defs/text"},
"criteria": {
"description": "Ordered level descriptions; index i describes level i.",
"type": "array",
"minItems": 2,
"maxItems": 64,
"items": {"$ref": "#/$defs/text"}
}
}
},
"noulQuestion": {
"type": "object",
"required": ["type", "instructions"],
"additionalProperties": false,
"properties": {
"type": {"const": "noul"},
"instructions": {"$ref": "#/$defs/text"},
"criteria": {
"type": "object",
"additionalProperties": false,
"properties": {
"true": {"$ref": "#/$defs/text"},
"false": {"$ref": "#/$defs/text"}
}
}
}
},
"probabilities": {
"type": "object",
"additionalProperties": {"type": "number", "minimum": 0, "maximum": 1}
},
"choiceAnswer": {
"type": "object",
"required": ["type", "choice", "confidence", "probabilities"],
"additionalProperties": false,
"properties": {
"type": {"const": "choice"},
"choice": {"type": "string"},
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
"probabilities": {"$ref": "#/$defs/probabilities"}
}
},
"scoreAnswer": {
"type": "object",
"required": ["type", "score", "confidence", "legend", "probabilities"],
"additionalProperties": false,
"properties": {
"type": {"const": "score"},
"score": {"type": "number", "minimum": 0, "description": "Probability-weighted level."},
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
"legend": {"type": "object", "additionalProperties": {"type": "string"}},
"probabilities": {"$ref": "#/$defs/probabilities"}
}
},
"noulAnswer": {
"type": "object",
"required": ["type", "noul"],
"additionalProperties": false,
"properties": {
"type": {"const": "noul"},
"noul": {"type": "number", "minimum": 0, "maximum": 1, "description": "P(yes)."}
}
},
"request": {
"type": "object",
"required": ["state", "questions"],
"additionalProperties": false,
"properties": {
"model": {"type": "string", "description": "compass-latest or a pinned compass-X.Y.Z; omitted means latest."},
"state": {"$ref": "#/$defs/text"},
"questions": {
"type": "object",
"minProperties": 1,
"maxProperties": 100,
"propertyNames": {"minLength": 1},
"additionalProperties": {
"oneOf": [
{"$ref": "#/$defs/choiceQuestion"},
{"$ref": "#/$defs/scoreQuestion"},
{"$ref": "#/$defs/noulQuestion"}
]
}
}
}
},
"response": {
"type": "object",
"required": ["model", "answers", "usage"],
"additionalProperties": false,
"properties": {
"model": {"type": "string", "description": "The pinned id that answered."},
"answers": {
"type": "object",
"additionalProperties": {
"oneOf": [
{"$ref": "#/$defs/choiceAnswer"},
{"$ref": "#/$defs/scoreAnswer"},
{"$ref": "#/$defs/noulAnswer"}
]
}
},
"usage": {
"type": "object",
"required": ["input_tokens", "output_tokens"],
"additionalProperties": false,
"properties": {
"input_tokens": {"type": "integer", "minimum": 0, "description": "Every token the backbone processed: the state once plus each question's rubric."},
"output_tokens": {"type": "integer", "const": 0, "description": "Compass never generates tokens."}
}
}
}
},
"error": {
"type": "object",
"required": ["error"],
"properties": {
"error": {
"type": "object",
"required": ["type", "message"],
"properties": {
"type": {"enum": ["invalid_json", "invalid_request", "unknown_model", "model_error"]},
"message": {"type": "string"}
}
}
}
}
}
}