Skip to content

Commit f01c1e1

Browse files
authored
Merge pull request #170 from bjester/ca-schema-update
Update embed schemas for newly required fields
2 parents ebb6894 + 137512d commit f01c1e1

9 files changed

Lines changed: 216 additions & 67 deletions

js/EmbedContentRequest.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export const SCHEMA = {
8484
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
8585
"description": "The UUID of the content resource"
8686
},
87+
"channel_id": {
88+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
89+
"description": "The UUID of the channel that the content resource belongs to"
90+
},
8791
"title": {
8892
"type": "string",
8993
"description": "The title of the content resource"
@@ -94,7 +98,7 @@ export const SCHEMA = {
9498
},
9599
"text": {
96100
"type": "string",
97-
"description": "The cleaned up text extracted from the content resource (in markdown or plaintext format)"
101+
"description": "Optional textual content to include in the embedding"
98102
},
99103
"language": {
100104
"$ref": "#/definitions/language"
@@ -113,9 +117,9 @@ export const SCHEMA = {
113117
},
114118
"required": [
115119
"id",
120+
"channel_id",
116121
"title",
117122
"description",
118-
"text",
119123
"content_id"
120124
]
121125
}

js/EmbedTopicsRequest.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ export const SCHEMA = {
1010
"description": "Schema for embed topics requests received by RayServe",
1111
"additionalProperties": false,
1212
"definitions": {
13-
"id": {
14-
"type": "string",
15-
"description": "The ID of the topic content node on Studio"
16-
},
1713
"title": {
1814
"type": "string",
1915
"description": "The title of the topic"
@@ -37,7 +33,8 @@ export const SCHEMA = {
3733
"additionalProperties": false,
3834
"properties": {
3935
"id": {
40-
"$ref": "#/definitions/id"
36+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
37+
"description": "The ID of the topic content node on Studio"
4138
},
4239
"title": {
4340
"$ref": "#/definitions/title"
@@ -72,7 +69,12 @@ export const SCHEMA = {
7269
"additionalProperties": false,
7370
"properties": {
7471
"id": {
75-
"$ref": "#/definitions/id"
72+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
73+
"description": "The ID of the topic content node on Studio"
74+
},
75+
"channel_id": {
76+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
77+
"description": "The UUID of the channel that the topic belongs to"
7678
},
7779
"title": {
7880
"$ref": "#/definitions/title"
@@ -89,8 +91,10 @@ export const SCHEMA = {
8991
},
9092
"required": [
9193
"id",
94+
"channel_id",
9295
"title",
93-
"description"
96+
"description",
97+
"language"
9498
]
9599
}
96100
},

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
"scripts": {
2828
"test": "echo \"Error: no test specified\" && exit 1"
2929
},
30-
"version": "0.2.10"
30+
"version": "0.2.11"
3131
}

le_utils/constants/embed_content_request.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
8282
"description": "The UUID of the content resource",
8383
},
84+
"channel_id": {
85+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
86+
"description": "The UUID of the channel that the content resource belongs to",
87+
},
8488
"title": {
8589
"type": "string",
8690
"description": "The title of the content resource",
@@ -91,7 +95,7 @@
9195
},
9296
"text": {
9397
"type": "string",
94-
"description": "The cleaned up text extracted from the content resource (in markdown or plaintext format)",
98+
"description": "Optional textual content to include in the embedding",
9599
},
96100
"language": {"$ref": "#/definitions/language"},
97101
"files": {
@@ -104,7 +108,7 @@
104108
"description": "The UUID of the content resource(s)",
105109
},
106110
},
107-
"required": ["id", "title", "description", "text", "content_id"],
111+
"required": ["id", "channel_id", "title", "description", "content_id"],
108112
},
109113
},
110114
"properties": {

le_utils/constants/embed_topics_request.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
"description": "Schema for embed topics requests received by RayServe",
1717
"additionalProperties": False,
1818
"definitions": {
19-
"id": {
20-
"type": "string",
21-
"description": "The ID of the topic content node on Studio",
22-
},
2319
"title": {"type": "string", "description": "The title of the topic"},
2420
"description": {
2521
"type": "string",
@@ -39,7 +35,10 @@
3935
"description": "An ancestor in the tree structure",
4036
"additionalProperties": False,
4137
"properties": {
42-
"id": {"$ref": "#/definitions/id"},
38+
"id": {
39+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
40+
"description": "The ID of the topic content node on Studio",
41+
},
4342
"title": {"$ref": "#/definitions/title"},
4443
"description": {"$ref": "#/definitions/description"},
4544
"language": {"$ref": "#/definitions/language"},
@@ -57,13 +56,20 @@
5756
"description": "A topic in the tree structure",
5857
"additionalProperties": False,
5958
"properties": {
60-
"id": {"$ref": "#/definitions/id"},
59+
"id": {
60+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
61+
"description": "The ID of the topic content node on Studio",
62+
},
63+
"channel_id": {
64+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
65+
"description": "The UUID of the channel that the topic belongs to",
66+
},
6167
"title": {"$ref": "#/definitions/title"},
6268
"description": {"$ref": "#/definitions/description"},
6369
"language": {"$ref": "#/definitions/language"},
6470
"ancestors": {"$ref": "#/definitions/ancestors"},
6571
},
66-
"required": ["id", "title", "description"],
72+
"required": ["id", "channel_id", "title", "description", "language"],
6773
},
6874
},
6975
"properties": {

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
setup(
99
name="le-utils",
1010
packages=find_packages(),
11-
version="0.2.10",
11+
version="0.2.11",
1212
description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",

spec/schema-embed_content_request.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
8080
"description": "The UUID of the content resource"
8181
},
82+
"channel_id": {
83+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
84+
"description": "The UUID of the channel that the content resource belongs to"
85+
},
8286
"title": {
8387
"type": "string",
8488
"description": "The title of the content resource"
@@ -89,7 +93,7 @@
8993
},
9094
"text": {
9195
"type": "string",
92-
"description": "The cleaned up text extracted from the content resource (in markdown or plaintext format)"
96+
"description": "Optional textual content to include in the embedding"
9397
},
9498
"language": {
9599
"$ref": "#/definitions/language"
@@ -108,9 +112,9 @@
108112
},
109113
"required": [
110114
"id",
115+
"channel_id",
111116
"title",
112117
"description",
113-
"text",
114118
"content_id"
115119
]
116120
}

spec/schema-embed_topics_request.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"description": "Schema for embed topics requests received by RayServe",
66
"additionalProperties": false,
77
"definitions": {
8-
"id": {
9-
"type": "string",
10-
"description": "The ID of the topic content node on Studio"
11-
},
128
"title": {
139
"type": "string",
1410
"description": "The title of the topic"
@@ -32,7 +28,8 @@
3228
"additionalProperties": false,
3329
"properties": {
3430
"id": {
35-
"$ref": "#/definitions/id"
31+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
32+
"description": "The ID of the topic content node on Studio"
3633
},
3734
"title": {
3835
"$ref": "#/definitions/title"
@@ -67,7 +64,12 @@
6764
"additionalProperties": false,
6865
"properties": {
6966
"id": {
70-
"$ref": "#/definitions/id"
67+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
68+
"description": "The ID of the topic content node on Studio"
69+
},
70+
"channel_id": {
71+
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
72+
"description": "The UUID of the channel that the topic belongs to"
7173
},
7274
"title": {
7375
"$ref": "#/definitions/title"
@@ -84,8 +86,10 @@
8486
},
8587
"required": [
8688
"id",
89+
"channel_id",
8790
"title",
88-
"description"
91+
"description",
92+
"language"
8993
]
9094
}
9195
},

0 commit comments

Comments
 (0)