satif-ai 0.2.4__py3-none-any.whl → 0.2.5__py3-none-any.whl

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.
@@ -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(generated_file_path, output_base_file)
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(generated_output_path, output_file)
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 = "o3-mini",
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
- sdif
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: satif-ai
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: AI Agents for Satif
5
5
  License: MIT
6
6
  Author: Bryan Djafer
@@ -3,15 +3,15 @@ satif_ai/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
3
3
  satif_ai/adapters/tidy.py,sha256=2oYj7Gz3vOQtzcpoJI4JbftWlMKvOWL8rdwthjg-zUE,19884
4
4
  satif_ai/code_builders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  satif_ai/code_builders/adaptation.py,sha256=E29YM0S6pMtAfB0uzSUexoeWKwXfF8iJVyYUCKWQz5k,188
6
- satif_ai/code_builders/transformation.py,sha256=c0-7JTs5pgiDOYxjWtB-w8Z-nwwqDWSUPCY1kJo3xEs,9638
6
+ satif_ai/code_builders/transformation.py,sha256=ZYpZpJb28PzN3suNG1lxeF2zB6mWn8gMoOLQov9YJUA,10043
7
7
  satif_ai/plot_builders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  satif_ai/plot_builders/agent.py,sha256=Ncw7SL9qkpRN0hw76ezSo1K8vVQK6gcXFp8x8VFwqUI,8291
9
9
  satif_ai/plot_builders/prompt.py,sha256=m0W1SsxnB9_FhIYRumkthImJbK-7KUm4dygN3kjAXGk,6877
10
10
  satif_ai/plot_builders/tool.py,sha256=MeLnG_wFoITSVWZcNFsQLCi157O4L3wItQgolBa4fAw,5994
11
11
  satif_ai/standardizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  satif_ai/standardizers/ai_csv.py,sha256=AAeTt7eqFAtayxF2b95Z_K_lnMdwBBnv2Cn-qTEpMp8,29499
13
- satif_ai-0.2.4.dist-info/LICENSE,sha256=kS8EN6yAaGZd7V5z6GKSn_x3ozcZltrfRky4vMPRCw8,1072
14
- satif_ai-0.2.4.dist-info/METADATA,sha256=3wCHxt5KwmSGllAwhqSQus7rgtcbteW7DYPmKRxIO-A,670
15
- satif_ai-0.2.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
16
- satif_ai-0.2.4.dist-info/entry_points.txt,sha256=Mz2SwYALjktap1bF-Q3EWBgiZVNT6QJCVsCs_fCV33Y,43
17
- satif_ai-0.2.4.dist-info/RECORD,,
13
+ satif_ai-0.2.5.dist-info/LICENSE,sha256=kS8EN6yAaGZd7V5z6GKSn_x3ozcZltrfRky4vMPRCw8,1072
14
+ satif_ai-0.2.5.dist-info/METADATA,sha256=jIyyKOcveIz_98_JTyF6bsfVn5iOVvc3qLFVQZ0wUSo,670
15
+ satif_ai-0.2.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
16
+ satif_ai-0.2.5.dist-info/entry_points.txt,sha256=Mz2SwYALjktap1bF-Q3EWBgiZVNT6QJCVsCs_fCV33Y,43
17
+ satif_ai-0.2.5.dist-info/RECORD,,