This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Commit 3e808f1
committed
Introduce v3 schema
Closes #38
v3 includes some backwards incompatible changes to the knowledge
schema format. Here is a diff against v2. The changes are:
- Q&A pairs now have an associated context blob from the knowledge
document.
- There is new `document_outline` field.
- drop `task_description`
```diff
--- src/instructlab/schema/v2/knowledge.json 2024-07-17 12:56:37
+++ src/instructlab/schema/v3/knowledge.json 2024-07-18 13:21:59
@@ -6,9 +6,9 @@
"required": [
"created_by",
"domain",
- "task_description",
"seed_examples",
- "document"
+ "document",
+ "document_outline"
],
"unevaluatedProperties": false,
"properties": {
@@ -27,15 +27,6 @@
"Pop culture"
]
},
- "task_description": {
- "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.",
- "type": "string",
- "minLength": 1,
- "examples": [
- "To teach a language model about softball history",
- "To teach a language model about tabby cats"
- ]
- },
"seed_examples": {
"description": "An array of seed examples for synthetic data generation.",
"type": "array",
@@ -44,20 +35,39 @@
"items": {
"type": "object",
"required": [
- "question",
- "answer"
+ "context",
+ "questions_and_answers"
],
"unevaluatedProperties": false,
"properties": {
- "question": {
- "description": "A question used for synthetic data generation.",
+ "context": {
+ "description": "Context from the document associated with this set of sample q&a pairs.",
"type": "string",
"minLength": 1
},
- "answer": {
- "description": "The desired response for the question.",
- "type": "string",
- "minLength": 1
+ "questions_and_answers": {
+ "type": "array",
+ "minItems": 3,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "required": [
+ "question",
+ "answer"
+ ],
+ "properties": {
+ "question": {
+ "description": "A question used for synthetic data generation.",
+ "type": "string",
+ "minLength": 1
+ },
+ "answer": {
+ "description": "The desired response for the question.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ }
}
}
}
@@ -104,6 +114,14 @@
}
}
}
+ },
+ "document_outline": {
+ "description": "A brief summary of the document.",
+ "type": "string",
+ "minLength": 1,
+ "examples": [
+ "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."
+ ]
}
}
}
```
Signed-off-by: Russell Bryant <[email protected]>1 parent 859cb72 commit 3e808f1
File tree
4 files changed
+202
-0
lines changed- src/instructlab/schema/v3
4 files changed
+202
-0
lines changedWhitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments