Spaces:
Paused
Paused
Update config_provider.py
Browse files- config_provider.py +8 -4
config_provider.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
Flare – ConfigProvider (
|
| 3 |
"""
|
| 4 |
|
| 5 |
from __future__ import annotations
|
|
@@ -75,16 +75,20 @@ class APIConfig(BaseModel):
|
|
| 75 |
class ParameterConfig(BaseModel):
|
| 76 |
name: str
|
| 77 |
caption: Optional[str] = ""
|
| 78 |
-
type: str = Field(..., pattern=r"^(int|float|bool|str|string)$")
|
| 79 |
required: bool = True
|
| 80 |
-
variable_name: str
|
| 81 |
extraction_prompt: Optional[str] = None
|
| 82 |
validation_regex: Optional[str] = None
|
| 83 |
invalid_prompt: Optional[str] = None
|
| 84 |
type_error_prompt: Optional[str] = None
|
| 85 |
|
| 86 |
def canonical_type(self) -> str:
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
|
| 90 |
class IntentConfig(BaseModel):
|
|
|
|
| 1 |
"""
|
| 2 |
+
Flare – ConfigProvider (date type support)
|
| 3 |
"""
|
| 4 |
|
| 5 |
from __future__ import annotations
|
|
|
|
| 75 |
class ParameterConfig(BaseModel):
|
| 76 |
name: str
|
| 77 |
caption: Optional[str] = ""
|
| 78 |
+
type: str = Field(..., pattern=r"^(int|float|bool|str|string|date)$") # Added 'date'
|
| 79 |
required: bool = True
|
| 80 |
+
variable_name: str
|
| 81 |
extraction_prompt: Optional[str] = None
|
| 82 |
validation_regex: Optional[str] = None
|
| 83 |
invalid_prompt: Optional[str] = None
|
| 84 |
type_error_prompt: Optional[str] = None
|
| 85 |
|
| 86 |
def canonical_type(self) -> str:
|
| 87 |
+
if self.type == "string":
|
| 88 |
+
return "str"
|
| 89 |
+
elif self.type == "date":
|
| 90 |
+
return "str" # Store dates as strings in ISO format
|
| 91 |
+
return self.type
|
| 92 |
|
| 93 |
|
| 94 |
class IntentConfig(BaseModel):
|