Spaces:
Paused
Paused
Update config_provider.py
Browse files- config_provider.py +5 -3
config_provider.py
CHANGED
|
@@ -163,6 +163,7 @@ class APIAuthConfig(BaseModel):
|
|
| 163 |
|
| 164 |
class APIConfig(BaseModel):
|
| 165 |
name: str
|
|
|
|
| 166 |
url: HttpUrl
|
| 167 |
method: str = Field("GET", pattern=r"^(GET|POST|PUT|PATCH|DELETE)$")
|
| 168 |
headers: Dict[str, Any] = {}
|
|
@@ -183,6 +184,7 @@ class APIConfig(BaseModel):
|
|
| 183 |
extra = "allow"
|
| 184 |
populate_by_name = True
|
| 185 |
|
|
|
|
| 186 |
# ---------------- Intent / Param ---------
|
| 187 |
class ParameterConfig(BaseModel):
|
| 188 |
name: str
|
|
@@ -226,18 +228,18 @@ class ParameterConfig(BaseModel):
|
|
| 226 |
class IntentConfig(BaseModel):
|
| 227 |
name: str
|
| 228 |
caption: Optional[str] = ""
|
| 229 |
-
# Removed locale field - will use project's locale settings
|
| 230 |
dependencies: List[str] = []
|
| 231 |
-
examples: List[LocalizedExample] = []
|
| 232 |
detection_prompt: Optional[str] = None
|
| 233 |
parameters: List[ParameterConfig] = []
|
| 234 |
action: str
|
|
|
|
| 235 |
fallback_timeout_prompt: Optional[str] = None
|
| 236 |
fallback_error_prompt: Optional[str] = None
|
| 237 |
|
| 238 |
class Config:
|
| 239 |
extra = "allow"
|
| 240 |
-
|
| 241 |
def get_examples_for_locale(self, locale_code: str) -> List[str]:
|
| 242 |
"""Get examples for specific locale"""
|
| 243 |
# Try exact match
|
|
|
|
| 163 |
|
| 164 |
class APIConfig(BaseModel):
|
| 165 |
name: str
|
| 166 |
+
description: Optional[str] = None
|
| 167 |
url: HttpUrl
|
| 168 |
method: str = Field("GET", pattern=r"^(GET|POST|PUT|PATCH|DELETE)$")
|
| 169 |
headers: Dict[str, Any] = {}
|
|
|
|
| 184 |
extra = "allow"
|
| 185 |
populate_by_name = True
|
| 186 |
|
| 187 |
+
|
| 188 |
# ---------------- Intent / Param ---------
|
| 189 |
class ParameterConfig(BaseModel):
|
| 190 |
name: str
|
|
|
|
| 228 |
class IntentConfig(BaseModel):
|
| 229 |
name: str
|
| 230 |
caption: Optional[str] = ""
|
|
|
|
| 231 |
dependencies: List[str] = []
|
| 232 |
+
examples: List[LocalizedExample] = []
|
| 233 |
detection_prompt: Optional[str] = None
|
| 234 |
parameters: List[ParameterConfig] = []
|
| 235 |
action: str
|
| 236 |
+
requiresApproval: bool = False
|
| 237 |
fallback_timeout_prompt: Optional[str] = None
|
| 238 |
fallback_error_prompt: Optional[str] = None
|
| 239 |
|
| 240 |
class Config:
|
| 241 |
extra = "allow"
|
| 242 |
+
|
| 243 |
def get_examples_for_locale(self, locale_code: str) -> List[str]:
|
| 244 |
"""Get examples for specific locale"""
|
| 245 |
# Try exact match
|