gaard-core 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gaard_core-0.2.0 → gaard_core-0.2.1}/PKG-INFO +1 -1
- {gaard_core-0.2.0 → gaard_core-0.2.1}/pyproject.toml +1 -1
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_pipeline/models.py +1 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/sql_validator/select_only.py +1 -1
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core.egg-info/PKG-INFO +1 -1
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_sql_validator.py +6 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/README.md +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/setup.cfg +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/errors.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/execution/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/execution/mock_executor.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/json_utils.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/llm_output.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/intent_classification_prompt.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/models.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/result_classification_prompt.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/result_interpretation_prompt.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/schema_formatter.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/sql_generation_prompt.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_intent/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_intent/llm_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_intent/mock_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_pipeline/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_pipeline/llm_sql_generator.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_pipeline/mock_sql_generator.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/query_pipeline/pipeline.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_classifier/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_classifier/llm_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_classifier/mock_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_interpreter/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_interpreter/llm_interpreter.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/result_interpreter/mock_interpreter.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/schema/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/schema/cache.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/schema/context.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/schema/models.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/sql_validator/__init__.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core.egg-info/SOURCES.txt +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core.egg-info/dependency_links.txt +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core.egg-info/requires.txt +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core.egg-info/top_level.txt +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_json_utils.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_llm_output.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_llm_query_intent_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_llm_result_classifier.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_llm_result_interpreter.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_llm_sql_generator.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_query_pipeline.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_result_classification_prompt_compiler.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_result_interpretation_prompt_compiler.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_schema_context_cache.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_schema_context_service.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_schema_prompt_formatter.py +0 -0
- {gaard_core-0.2.0 → gaard_core-0.2.1}/tests/test_sql_generation_prompt_compiler.py +0 -0
|
@@ -29,6 +29,7 @@ class QueryIntentClassification(BaseModel):
|
|
|
29
29
|
class QueryRequest(BaseModel):
|
|
30
30
|
question: str = Field(min_length=1)
|
|
31
31
|
datasource_id: str = "default"
|
|
32
|
+
datasource_ids: list[str] = Field(default_factory=list)
|
|
32
33
|
user_id: str = "local-admin"
|
|
33
34
|
interpret: bool = True
|
|
34
35
|
|
|
@@ -19,7 +19,7 @@ class SelectOnlySqlValidator:
|
|
|
19
19
|
|
|
20
20
|
statement = statements[0]
|
|
21
21
|
|
|
22
|
-
if not isinstance(statement, exp.Select):
|
|
22
|
+
if not isinstance(statement, (exp.Select, exp.SetOperation)):
|
|
23
23
|
raise SqlValidationError(f"Only SELECT queries are allowed. {sql}")
|
|
24
24
|
|
|
25
25
|
forbidden_expressions = (
|
|
@@ -22,6 +22,12 @@ def test_validator_accepts_mysql_quoted_identifier() -> None:
|
|
|
22
22
|
validator.validate("SELECT COUNT(*) AS total_leads FROM `lead`")
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
def test_validator_accepts_union_of_literal_selects() -> None:
|
|
26
|
+
validator = SelectOnlySqlValidator()
|
|
27
|
+
|
|
28
|
+
validator.validate("SELECT 'form_id' AS column_name UNION ALL SELECT 'status'")
|
|
29
|
+
|
|
30
|
+
|
|
25
31
|
def test_validator_rejects_delete() -> None:
|
|
26
32
|
validator = SelectOnlySqlValidator()
|
|
27
33
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/intent_classification_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
{gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/result_classification_prompt.py
RENAMED
|
File without changes
|
{gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/result_interpretation_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
{gaard_core-0.2.0 → gaard_core-0.2.1}/src/gaard_core/prompt_compiler/sql_generation_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|