Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- models.py +4 -1
- 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,
|
|
|
|
|
|
|
|
|
|
| 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))
|