Skip to content

Commit cb98b95

Browse files
Update schema to use explicit property lists rather than the "bag of properties" (#323)
1 parent 23dbd72 commit cb98b95

File tree

8 files changed

+940
-962
lines changed

8 files changed

+940
-962
lines changed

packages/spikes/gulf_genkit_eval/GEMINI.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This document outlines the validation rules that should be implemented in the `v
44

55
Each message corresponds to one of the four message schemas: `stream_header.json`, `component_update.json`, `data_model_update.json`, or `begin_rendering.json`.
66

7+
## `StreamHeader` Message Rules
8+
9+
* **Required**: Must have a `version` property.
10+
* No other properties are allowed.
11+
712
## `ComponentUpdate` Message Rules
813

914
### 1. Component ID Integrity
@@ -13,39 +18,54 @@ Each message corresponds to one of the four message schemas: `stream_header.json
1318

1419
### 2. Component-Specific Property Rules
1520

16-
For each component in the `components` array, the following rules apply based on its `type`:
21+
For each component in the `components` array, the following rules apply:
1722

1823
* **General**:
19-
* A component must have an `id` and a `type`.
20-
21-
* **Value Components** (`Heading`, `Text`, `Image`, `Video`, `AudioPlayer`, `TextField`, `CheckBox`, `DateTimeInput`, `MultipleChoice`, `Slider`):
24+
* A component must have an `id` and a `componentProperties` object.
25+
* The `componentProperties` object must contain exactly one key, which defines the component's type (e.g., "Heading", "Text").
26+
27+
* **Heading**:
28+
* **Required**: Must have a `text` property.
29+
* **Text**:
30+
* **Required**: Must have a `text` property.
31+
* **Image**:
32+
* **Required**: Must have a `url` property.
33+
* **Video**:
34+
* **Required**: Must have a `url` property.
35+
* **AudioPlayer**:
36+
* **Required**: Must have a `url` property.
37+
* **TextField**:
38+
* **Required**: Must have a `label` property.
39+
* **DateTimeInput**:
40+
* **Required**: Must have a `value` property.
41+
* **MultipleChoice**:
42+
* **Required**: Must have a `selections` property.
43+
* **Slider**:
2244
* **Required**: Must have a `value` property.
23-
2445
* **Container Components** (`Row`, `Column`, `List`):
2546
* **Required**: Must have a `children` property.
2647
* The `children` object must contain *either* `explicitList` *or* `template`, but not both.
27-
2848
* **Card**:
2949
* **Required**: Must have a `child` property.
30-
3150
* **Tabs**:
3251
* **Required**: Must have a `tabItems` property, which must be an array.
3352
* Each item in `tabItems` must have a `title` and a `child`.
34-
3553
* **Modal**:
3654
* **Required**: Must have both `entryPointChild` and `contentChild` properties.
37-
3855
* **Button**:
3956
* **Required**: Must have `label` and `action` properties.
40-
4157
* **CheckBox**:
4258
* **Required**: Must have `label` and `value` properties.
59+
* **Divider**:
60+
* No required properties.
4361

4462
## `DataModelUpdate` Message Rules
4563

46-
* **Path and Contents**: A `DataModelUpdate` message must have a `contents` property. The `path` property is optional.
64+
* **Required**: A `DataModelUpdate` message must have a `contents` property.
65+
* The `path` property is optional.
4766
* If `path` is not present, the `contents` object will replace the entire data model.
4867
* If `path` is present, the `contents` will be set at that location in the data model.
68+
* No other properties besides `path` and `contents` are allowed.
4969

5070
## `BeginRendering` Message Rules
5171

0 commit comments

Comments
 (0)