lionagi 0.12.8__py3-none-any.whl → 0.13.1__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.
lionagi/_errors.py CHANGED
@@ -33,3 +33,7 @@ class OperationError(LionError):
33
33
 
34
34
  class ExecutionError(LionError):
35
35
  pass
36
+
37
+
38
+ class ValidationError(LionError):
39
+ pass
@@ -151,9 +151,6 @@ def load_pydantic_model_from_schema(
151
151
  base_class="pydantic.BaseModel",
152
152
  )
153
153
  except Exception as e:
154
- # Optional: Print generated code on failure for debugging
155
- # if output_file.exists():
156
- # print(f"--- Generated Code (Error) ---\n{output_file.read_text()}\n--------------------------")
157
154
  error_msg = "Failed to generate model code"
158
155
  raise RuntimeError(error_msg) from e
159
156
 
@@ -175,15 +172,9 @@ def load_pydantic_model_from_schema(
175
172
  # --- 3. Import the Generated Module Dynamically ---
176
173
  try:
177
174
  spec, generated_module = get_modules()
178
- # Important: Make pydantic available within the executed module's globals
179
- # if it's not explicitly imported by the generated code for some reason.
180
- # Usually, datamodel-code-generator handles imports well.
181
- # generated_module.__dict__['BaseModel'] = BaseModel
182
175
  spec.loader.exec_module(generated_module)
183
176
 
184
177
  except Exception as e:
185
- # Optional: Print generated code on failure for debugging
186
- # print(f"--- Generated Code (Import Error) ---\n{output_file.read_text()}\n--------------------------")
187
178
  error_msg = f"Failed to load generated module ({output_file})"
188
179
  raise RuntimeError(error_msg) from e
189
180