-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils_test.py
More file actions
49 lines (47 loc) · 1.34 KB
/
utils_test.py
File metadata and controls
49 lines (47 loc) · 1.34 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
from utils import create_pydantic_model_from_dict
schema = {
"type": "json_schema",
"json_schema": {
"name": "CodeChanges",
"schema": {
"type": "object",
"required": [
"changed_files",
"additional_message"
],
"properties": {
"changed_files": {
"type": "array",
"items": {
"type": "object",
"required": [
"file_path",
"content"
],
"properties": {
"content": {
"type": "string",
"description": "The new content of the file with the code changes"
},
"file_path": {
"type": "string",
"description": "The path to the file that has changed"
}
},
"additionalProperties": False
},
"description": "The list of files that have changed with their new content"
},
"additional_message": {
"type": "string",
"description": "An additional message to the user as a response to their message"
}
},
"additionalProperties": False
},
"strict": True
}
}
model = create_pydantic_model_from_dict(schema["json_schema"]["name"], schema["json_schema"]["schema"])
# print all the fields
# print(model.model_fields)