satif-ai 0.2.4__tar.gz → 0.2.5__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.
- {satif_ai-0.2.4 → satif_ai-0.2.5}/PKG-INFO +1 -1
- {satif_ai-0.2.4 → satif_ai-0.2.5}/pyproject.toml +1 -1
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/code_builders/transformation.py +18 -9
- {satif_ai-0.2.4 → satif_ai-0.2.5}/LICENSE +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/README.md +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/__init__.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/adapters/__init__.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/adapters/tidy.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/code_builders/__init__.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/code_builders/adaptation.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/plot_builders/__init__.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/plot_builders/agent.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/plot_builders/prompt.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/plot_builders/tool.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/standardizers/__init__.py +0 -0
- {satif_ai-0.2.4 → satif_ai-0.2.5}/satif_ai/standardizers/ai_csv.py +0 -0
@@ -15,6 +15,7 @@ from satif_sdk.transformers import CodeTransformer
|
|
15
15
|
# Global variables for transformation
|
16
16
|
INPUT_SDIF_PATH: Optional[Path] = None
|
17
17
|
OUTPUT_TARGET_FILES: Optional[Dict[Union[str, Path], str]] = None
|
18
|
+
SCHEMA_ONLY: Optional[bool] = None
|
18
19
|
|
19
20
|
|
20
21
|
@function_tool
|
@@ -32,6 +33,9 @@ async def execute_transformation(code: str) -> str:
|
|
32
33
|
generated_output_path = code_transformer.export(INPUT_SDIF_PATH)
|
33
34
|
|
34
35
|
comparisons = []
|
36
|
+
comparator_kwargs = {}
|
37
|
+
if SCHEMA_ONLY:
|
38
|
+
comparator_kwargs["check_structure_only"] = True
|
35
39
|
|
36
40
|
if os.path.isdir(generated_output_path):
|
37
41
|
# If it's a directory, compare each file with its corresponding target
|
@@ -46,7 +50,9 @@ async def execute_transformation(code: str) -> str:
|
|
46
50
|
generated_output_path, output_target_file_name
|
47
51
|
)
|
48
52
|
comparator = get_comparator(output_target_file_name.split(".")[-1])
|
49
|
-
comparison = comparator.compare(
|
53
|
+
comparison = comparator.compare(
|
54
|
+
generated_file_path, output_base_file, **comparator_kwargs
|
55
|
+
)
|
50
56
|
comparisons.append(
|
51
57
|
f"Comparison for {generated_file_path} [SOURCE] with {output_target_file_name} [TARGET]: {comparison}"
|
52
58
|
)
|
@@ -60,7 +66,9 @@ async def execute_transformation(code: str) -> str:
|
|
60
66
|
output_file = list(OUTPUT_TARGET_FILES.keys())[0]
|
61
67
|
output_target_file_name = list(OUTPUT_TARGET_FILES.values())[0]
|
62
68
|
comparator = get_comparator(output_file.split(".")[-1])
|
63
|
-
comparison = comparator.compare(
|
69
|
+
comparison = comparator.compare(
|
70
|
+
generated_output_path, output_file, **comparator_kwargs
|
71
|
+
)
|
64
72
|
comparisons.append(
|
65
73
|
f"Comparison for {generated_output_path} [SOURCE] with {output_target_file_name} [TARGET]: {comparison}"
|
66
74
|
)
|
@@ -91,7 +99,7 @@ class TransformationAsyncCodeBuilder(AsyncCodeBuilder):
|
|
91
99
|
self,
|
92
100
|
mcp_server: MCPServer,
|
93
101
|
mcp_session: ClientSession,
|
94
|
-
llm_model: str = "
|
102
|
+
llm_model: str = "o4-mini",
|
95
103
|
):
|
96
104
|
self.mcp_server = mcp_server
|
97
105
|
self.mcp_session = mcp_session
|
@@ -103,17 +111,16 @@ class TransformationAsyncCodeBuilder(AsyncCodeBuilder):
|
|
103
111
|
output_target_files: Dict[Union[str, Path], str] | List[Path],
|
104
112
|
output_sdif: Optional[Path] = None, # This will now be relative or None
|
105
113
|
instructions: Optional[str] = None,
|
114
|
+
schema_only: bool = False,
|
106
115
|
) -> str:
|
107
|
-
global INPUT_SDIF_PATH, OUTPUT_TARGET_FILES
|
116
|
+
global INPUT_SDIF_PATH, OUTPUT_TARGET_FILES, SCHEMA_ONLY
|
108
117
|
# INPUT_SDIF_PATH is used by execute_transformation tool, needs to be accessible from where that tool runs.
|
109
118
|
# If execute_transformation runs in the same process as the builder, absolute path is fine.
|
110
119
|
# If it were a separate context, this might need adjustment.
|
111
120
|
# For now, assume execute_transformation can access absolute paths if needed for its *input SDIF*.
|
112
121
|
# However, the sdif for MCP URIs must be relative.
|
113
|
-
INPUT_SDIF_PATH = Path(
|
114
|
-
|
115
|
-
).resolve() # Keep this as absolute for the tool's potential direct access.
|
116
|
-
|
122
|
+
INPUT_SDIF_PATH = Path(sdif).resolve()
|
123
|
+
SCHEMA_ONLY = schema_only
|
117
124
|
# Paths for MCP URIs are now expected to be relative to MCP server CWD (project root)
|
118
125
|
# So, use them directly as strings.
|
119
126
|
input_sdif_mcp_uri_path = base64.b64encode(str(sdif).encode()).decode()
|
@@ -204,7 +211,9 @@ class TransformationAsyncCodeBuilder(AsyncCodeBuilder):
|
|
204
211
|
else "Error reading input sample",
|
205
212
|
"output_files": str(list(OUTPUT_TARGET_FILES.values())),
|
206
213
|
"output_schema": output_schema_text,
|
207
|
-
"output_sample": output_sample_text
|
214
|
+
"output_sample": output_sample_text
|
215
|
+
if not SCHEMA_ONLY
|
216
|
+
else "Sample not available. Transform according to the schema only. No data is present in the output example.",
|
208
217
|
"output_representation": str(
|
209
218
|
output_representation
|
210
219
|
), # Representation keyed by agent-facing name
|
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
|