Spaces:
Sleeping
Sleeping
Update src/schemas/_pydantic_agent.py
Browse files
src/schemas/_pydantic_agent.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from typing import Optional
|
|
|
|
| 2 |
from pydantic import BaseModel, Field, model_validator
|
| 3 |
|
| 4 |
|
|
@@ -117,6 +118,15 @@ class OrderConditions(BaseModel):
|
|
| 117 |
"Use 'ASC' for: oldest, lowest, alphabetical, earliest."
|
| 118 |
),
|
| 119 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
class SQLQueryExtractor(BaseModel):
|
|
@@ -211,6 +221,18 @@ class SQLQueryExtractor(BaseModel):
|
|
| 211 |
"This must be set True if provided tool return true else set False. "
|
| 212 |
),
|
| 213 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
| 215 |
@model_validator(mode="after")
|
| 216 |
def validate_sql_query(self):
|
|
|
|
| 1 |
from typing import Optional
|
| 2 |
+
from enum import Enum
|
| 3 |
from pydantic import BaseModel, Field, model_validator
|
| 4 |
|
| 5 |
|
|
|
|
| 118 |
"Use 'ASC' for: oldest, lowest, alphabetical, earliest."
|
| 119 |
),
|
| 120 |
)
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
class ChartsType(Enum):
|
| 124 |
+
"""
|
| 125 |
+
Enumeration of supported chart types for visualization.
|
| 126 |
+
"""
|
| 127 |
+
PIE: str = "PIE"
|
| 128 |
+
BAR: str = "BAR"
|
| 129 |
+
LINE: str = "LINE"
|
| 130 |
|
| 131 |
|
| 132 |
class SQLQueryExtractor(BaseModel):
|
|
|
|
| 221 |
"This must be set True if provided tool return true else set False. "
|
| 222 |
),
|
| 223 |
)
|
| 224 |
+
|
| 225 |
+
best_suitable_chart: ChartsType = Field(
|
| 226 |
+
...,
|
| 227 |
+
description=(
|
| 228 |
+
"The type of chart that best represents the data for visualization. "
|
| 229 |
+
"Choose based on the user query and the nature of the data: "
|
| 230 |
+
"- PIE: Use for showing proportions or percentages of a whole (e.g., market share, distribution). "
|
| 231 |
+
"- BAR: Use for comparing quantities across categories (e.g., sales by region, counts). "
|
| 232 |
+
"- LINE: Use for showing trends over time or continuous data (e.g., stock prices, temperature changes)."
|
| 233 |
+
),
|
| 234 |
+
)
|
| 235 |
+
|
| 236 |
|
| 237 |
@model_validator(mode="after")
|
| 238 |
def validate_sql_query(self):
|