Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit fb82e0d

Browse files
authored
Merge pull request #39 from russellb/v3
Introduce v3 schema
2 parents b0269d3 + 6acb4aa commit fb82e0d

File tree

5 files changed

+207
-0
lines changed

5 files changed

+207
-0
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ disable = [
6969
[tool.pylint.reports]
7070
reports = true
7171
score = true
72+
73+
[tool.check-wheel-contents]
74+
ignore = [
75+
"W002", # ignore duplicate files
76+
]

src/instructlab/schema/v3/__init__.py

Whitespace-only changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"title": "Compositional Skill",
3+
"description": "A compositional skill.",
4+
"type": "object",
5+
"$ref": "./version.json",
6+
"required": [
7+
"created_by",
8+
"task_description",
9+
"seed_examples"
10+
],
11+
"unevaluatedProperties": false,
12+
"properties": {
13+
"created_by": {
14+
"description": "The GitHub username of the contributor.",
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"task_description": {
19+
"description": "A description of the task which is used in prompts to the teacher model during synthetic data generation. The description should be detailed and prescriptive to improve the teacher model's responses.",
20+
"type": "string",
21+
"minLength": 1,
22+
"examples": [
23+
"Extracting content from a financial report and providing it in bulleted format",
24+
"Providing engaging explanations for common questions across diverse topics at a primary school level",
25+
"Assume the roles of historical figures and provide engaging explanations for common questions across diverse topics"
26+
]
27+
},
28+
"seed_examples": {
29+
"description": "An array of seed examples for synthetic data generation.",
30+
"type": "array",
31+
"minItems": 5,
32+
"uniqueItems": true,
33+
"items": {
34+
"type": "object",
35+
"required": [
36+
"question",
37+
"answer"
38+
],
39+
"unevaluatedProperties": false,
40+
"properties": {
41+
"context": {
42+
"description": "Information that the teacher model is expected to take into account during processing. This is different from knowledge, where the model is expected to gain facts and background knowledge from the tuning process.",
43+
"type": "string",
44+
"minLength": 1
45+
},
46+
"question": {
47+
"description": "A question used for synthetic data generation.",
48+
"type": "string",
49+
"minLength": 1
50+
},
51+
"answer": {
52+
"description": "The desired response for the question.",
53+
"type": "string",
54+
"minLength": 1
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"title": "Knowledge",
3+
"description": "A knowledge skill.",
4+
"type": "object",
5+
"$ref": "./version.json",
6+
"required": [
7+
"created_by",
8+
"domain",
9+
"seed_examples",
10+
"document",
11+
"document_outline"
12+
],
13+
"unevaluatedProperties": false,
14+
"properties": {
15+
"created_by": {
16+
"description": "The GitHub username of the contributor.",
17+
"type": "string",
18+
"minLength": 1
19+
},
20+
"domain": {
21+
"description": "The knowledge domain which is used in prompts to the teacher model during synthetic data generation. The domain should be brief such as the title to a textbook chapter or section.",
22+
"type": "string",
23+
"minLength": 1,
24+
"examples": [
25+
"Chemistry",
26+
"History",
27+
"Pop culture"
28+
]
29+
},
30+
"seed_examples": {
31+
"description": "An array of seed examples for synthetic data generation.",
32+
"type": "array",
33+
"minItems": 5,
34+
"uniqueItems": true,
35+
"items": {
36+
"type": "object",
37+
"required": [
38+
"context",
39+
"questions_and_answers"
40+
],
41+
"unevaluatedProperties": false,
42+
"properties": {
43+
"context": {
44+
"description": "Context from the document associated with this set of sample q&a pairs.",
45+
"type": "string",
46+
"minLength": 1
47+
},
48+
"questions_and_answers": {
49+
"type": "array",
50+
"minItems": 3,
51+
"uniqueItems": true,
52+
"items": {
53+
"type": "object",
54+
"required": [
55+
"question",
56+
"answer"
57+
],
58+
"properties": {
59+
"question": {
60+
"description": "A question used for synthetic data generation.",
61+
"type": "string",
62+
"minLength": 1
63+
},
64+
"answer": {
65+
"description": "The desired response for the question.",
66+
"type": "string",
67+
"minLength": 1
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}
74+
},
75+
"document": {
76+
"description": "The knowledge documents.",
77+
"type": "object",
78+
"required": [
79+
"repo",
80+
"commit",
81+
"patterns"
82+
],
83+
"unevaluatedProperties": false,
84+
"properties": {
85+
"repo": {
86+
"description": "The URL to a Git repository holding the knowledge documents.",
87+
"type": "string",
88+
"minLength": 1,
89+
"examples": [
90+
"https://github.com/instructlab/instructlab.git"
91+
]
92+
},
93+
"commit": {
94+
"description": "The commit in the Git repository containing the knowledge documents.",
95+
"type": "string",
96+
"minLength": 1,
97+
"examples": [
98+
"951999afdc59c46d325493568193b40bd5439c9e"
99+
]
100+
},
101+
"patterns": {
102+
"description": "An array of glob patterns of the knowledge documents in the Git repository.",
103+
"type": "array",
104+
"minItems": 1,
105+
"uniqueItems": true,
106+
"items": {
107+
"type": "string",
108+
"minLength": 1,
109+
"examples": [
110+
"*.md",
111+
"folder/*.md",
112+
"folder/knowledge_doc.md"
113+
]
114+
}
115+
}
116+
}
117+
},
118+
"document_outline": {
119+
"description": "A brief summary of the document.",
120+
"type": "string",
121+
"minLength": 1,
122+
"examples": [
123+
"Overview of Human tonsils, describing their types, locations, structure, function, and clinical significance, with a specific focus on their role in the immune system and related health issues."
124+
]
125+
}
126+
}
127+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"title": "Taxonomy Document Schema Version",
3+
"type": "object",
4+
"required": [
5+
"version"
6+
],
7+
"properties": {
8+
"version": {
9+
"description": "The schema version of the taxonomy document.",
10+
"type": "integer",
11+
"$comment": "This value must match the number in the containing folder.",
12+
"const": 3
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)