mpnikhil commited on
Commit
31b5209
·
verified ·
1 Parent(s): f678c99

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. models.py +4 -1
  2. test_schema.py +8 -0
models.py CHANGED
@@ -40,7 +40,10 @@ class SkillInvocationAction(Action):
40
  default=None, description='Skill ID (required for load/unload)'
41
  )
42
  answer: Optional[str] = Field(
43
- default=None, description='Solution text (required for submit)', max_length=100000
 
 
 
44
  )
45
 
46
 
 
40
  default=None, description='Skill ID (required for load/unload)'
41
  )
42
  answer: Optional[str] = Field(
43
+ default=None,
44
+ description='Solution text (required for submit)',
45
+ max_length=100000,
46
+ json_schema_extra={"type": "string"}
47
  )
48
 
49
 
test_schema.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional
3
+ import json
4
+
5
+ class A(BaseModel):
6
+ answer: Optional[str] = Field(None, json_schema_extra={"type": "string", "maxLength": 100000})
7
+
8
+ print(json.dumps(A.model_json_schema(), indent=2))