fairo 25.9.7__tar.gz → 25.10.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.

Potentially problematic release.


This version of fairo might be problematic. Click here for more details.

Files changed (52) hide show
  1. {fairo-25.9.7 → fairo-25.10.1}/PKG-INFO +1 -1
  2. fairo-25.10.1/fairo/__init__.py +1 -0
  3. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/execution/agent_serializer.py +16 -11
  4. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/execution/executor.py +12 -1
  5. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/execution/model_log_helper.py +4 -4
  6. {fairo-25.9.7 → fairo-25.10.1}/fairo.egg-info/PKG-INFO +1 -1
  7. fairo-25.9.7/fairo/__init__.py +0 -1
  8. {fairo-25.9.7 → fairo-25.10.1}/README.md +0 -0
  9. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/__init__.py +0 -0
  10. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/__init__.py +0 -0
  11. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/base_agent.py +0 -0
  12. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/code_analysis_agent.py +0 -0
  13. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/output/__init__.py +0 -0
  14. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/output/base_output.py +0 -0
  15. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/output/google_drive.py +0 -0
  16. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/tools/__init__.py +0 -0
  17. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/tools/base_tools.py +0 -0
  18. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/tools/code_analysis.py +0 -0
  19. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/tools/utils.py +0 -0
  20. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/agent/utils.py +0 -0
  21. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/chat/__init__.py +0 -0
  22. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/chat/chat.py +0 -0
  23. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/client/__init__.py +0 -0
  24. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/client/client.py +0 -0
  25. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/exceptions.py +0 -0
  26. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/execution/__init__.py +0 -0
  27. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/execution/env_finder.py +0 -0
  28. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/models/__init__.py +0 -0
  29. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/models/custom_field_value.py +0 -0
  30. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/models/resources.py +0 -0
  31. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/runnable/__init__.py +0 -0
  32. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/runnable/runnable.py +0 -0
  33. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/tools/__init__.py +0 -0
  34. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/tools/plot.py +0 -0
  35. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/tools/suggestion.py +0 -0
  36. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/utils.py +0 -0
  37. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/workflow/__init__.py +0 -0
  38. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/workflow/base_workflow.py +0 -0
  39. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/workflow/dependency.py +0 -0
  40. {fairo-25.9.7 → fairo-25.10.1}/fairo/core/workflow/utils.py +0 -0
  41. {fairo-25.9.7 → fairo-25.10.1}/fairo/metrics/__init__.py +0 -0
  42. {fairo-25.9.7 → fairo-25.10.1}/fairo/metrics/fairness_object.py +0 -0
  43. {fairo-25.9.7 → fairo-25.10.1}/fairo/metrics/metrics.py +0 -0
  44. {fairo-25.9.7 → fairo-25.10.1}/fairo/settings.py +0 -0
  45. {fairo-25.9.7 → fairo-25.10.1}/fairo/tests/__init__.py +0 -0
  46. {fairo-25.9.7 → fairo-25.10.1}/fairo/tests/test_metrics.py +0 -0
  47. {fairo-25.9.7 → fairo-25.10.1}/fairo.egg-info/SOURCES.txt +0 -0
  48. {fairo-25.9.7 → fairo-25.10.1}/fairo.egg-info/dependency_links.txt +0 -0
  49. {fairo-25.9.7 → fairo-25.10.1}/fairo.egg-info/requires.txt +0 -0
  50. {fairo-25.9.7 → fairo-25.10.1}/fairo.egg-info/top_level.txt +0 -0
  51. {fairo-25.9.7 → fairo-25.10.1}/pyproject.toml +0 -0
  52. {fairo-25.9.7 → fairo-25.10.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fairo
3
- Version: 25.9.7
3
+ Version: 25.10.1
4
4
  Summary: SDK for interfacing with Fairo SaaS platform.
5
5
  Author-email: "Fairo Systems, Inc." <support@fairo.ai>
6
6
  License: Apache-2.0
@@ -0,0 +1 @@
1
+ __version__ = "25.10.1"
@@ -1,5 +1,6 @@
1
1
  from typing import Any, Dict, Optional
2
2
  import mlflow
3
+ import json
3
4
  from langchain.callbacks.base import BaseCallbackHandler
4
5
  from langchain_core.callbacks import CallbackManagerForChainRun
5
6
  from pathlib import Path
@@ -77,12 +78,12 @@ class CustomPythonModel(mlflow.pyfunc.PythonModel):
77
78
  except ImportError as e:
78
79
  raise ImportError(f"Failed to import agent_code: {e}")
79
80
 
80
- def predict(self, context, model_input):
81
+ def predict(self, context, model_input: list[str]):
81
82
  if isinstance(model_input, list):
82
- return [self.agent.run(query) for query in model_input]
83
+ parsed_data = json.loads(model_input[0])
84
+ return self.run(parsed_data, callback_enabled=True)
83
85
  else:
84
- return self.agent.run(model_input)
85
-
86
+ return self.run(model_input)
86
87
  class AgentChainWrapper:
87
88
  def __init__(self, chain_class = SimpleSequentialChain, agent_functions_list = [], callback_enabled = False):
88
89
  self.chain_class = chain_class
@@ -182,9 +183,12 @@ class AgentChainWrapper:
182
183
  )
183
184
  return chain.run(result)
184
185
 
185
- def predict(self, context = "", model_input = "", callback_enabled: Optional[bool] = False):
186
- self.callback_enabled = callback_enabled
187
- return self.run(model_input)
186
+ def predict(self, context = "", model_input: list[str] = [""]):
187
+ if isinstance(model_input, list):
188
+ parsed_data = json.loads(model_input[0])
189
+ return self.run(parsed_data, callback_enabled=True)
190
+ else:
191
+ return self.run(model_input)
188
192
 
189
193
  class CustomChainModel(mlflow.pyfunc.PythonModel):
190
194
  def __init__(self):
@@ -253,9 +257,10 @@ class CustomChainModel(mlflow.pyfunc.PythonModel):
253
257
  # Create the agent chain
254
258
  self.agent_chain = AgentChainWrapper(agent_functions_list=agent_functions, callback_enabled=True)
255
259
 
256
- def predict(self, context, model_input, callback_enabled: Optional[bool] = False):
260
+ def predict(self, context, model_input: list[str]):
257
261
  if isinstance(model_input, list):
258
- return [self.agent_chain.run(query) for query in model_input]
262
+ parsed_data = json.loads(model_input[0])
263
+ return self.agent_chain.run(parsed_data)
259
264
  else:
260
265
  return self.agent_chain.run(model_input)
261
266
 
@@ -298,7 +303,7 @@ class CrewAgentWrapper:
298
303
  print(f"Error running CrewAI crew: {e}")
299
304
  return f"Error executing query '{query}': {str(e)}"
300
305
 
301
- def predict(self, context, model_input):
306
+ def predict(self, context, model_input: list[str]):
302
307
  return self.run(model_input)
303
308
 
304
309
  class CustomCrewModel(mlflow.pyfunc.PythonModel):
@@ -341,7 +346,7 @@ class CustomCrewModel(mlflow.pyfunc.PythonModel):
341
346
  except ImportError as e:
342
347
  raise ImportError(f"Failed to import CrewAI agent_code: {e}")
343
348
 
344
- def predict(self, context, model_input):
349
+ def predict(self, context, model_input: list[str]):
345
350
  if isinstance(model_input, list):
346
351
  return [self.agent.run(query) for query in model_input]
347
352
  else:
@@ -35,7 +35,8 @@ class FairoExecutor:
35
35
  chain_class = SimpleSequentialChain,
36
36
  input_fields: List[str] = [],
37
37
  input_schema: Optional[Type[BaseModel]] = None,
38
- chat_suggestions: Optional[ChatSuggestions] = None
38
+ chat_suggestions: Optional[ChatSuggestions] = None,
39
+ debug_mode: bool = False
39
40
  ):
40
41
  if agents and runnable:
41
42
  raise ValueError("FairoExecutor cannot be initialized with both 'agents' and 'runnable'. Please provide only one.")
@@ -45,10 +46,12 @@ class FairoExecutor:
45
46
  self.agents = agents
46
47
  self.agent_type = agent_type
47
48
  self.verbose = verbose
49
+ self.debug_mode = debug_mode
48
50
  self.patch_run_output_json = patch_run_output_json
49
51
  self.workflow_run_id = workflow_run_id
50
52
  self.runnable = runnable
51
53
  self.experiment_name = experiment_name if experiment_name else get_mlflow_experiment_name()
54
+ self._setup_logging()
52
55
  self.setup_mlflow()
53
56
  self.chain_class = chain_class
54
57
  self.client = BaseClient(
@@ -65,6 +68,14 @@ class FairoExecutor:
65
68
  if hasattr(agent, 'verbose'):
66
69
  agent.verbose = self.verbose
67
70
 
71
+ def _setup_logging(self):
72
+ """Configure MLflow logging level based on debug_mode."""
73
+ mlflow_logger = logging.getLogger('mlflow')
74
+ if not self.debug_mode:
75
+ import warnings
76
+ warnings.filterwarnings('ignore', category=UserWarning)
77
+ mlflow_logger.setLevel(logging.ERROR)
78
+
68
79
  def _build_pipeline(self) -> RunnableSequence:
69
80
  if not self.agents and not self.runnable:
70
81
  raise ValueError("At least one agent or runnable must be provided.")
@@ -2,7 +2,7 @@ import mlflow
2
2
  import mlflow.pyfunc
3
3
  import os
4
4
  import sys
5
- import pkg_resources
5
+ import importlib.metadata
6
6
  import ast
7
7
  import importlib.util
8
8
  import shutil
@@ -60,9 +60,9 @@ class ModelLogHelper:
60
60
  pip_packages = []
61
61
  for package in required_packages:
62
62
  try:
63
- dist = pkg_resources.get_distribution(package)
64
- pip_packages.append(f"{package}=={dist.version}")
65
- except pkg_resources.DistributionNotFound:
63
+ version = importlib.metadata.version(package)
64
+ pip_packages.append(f"{package}=={version}")
65
+ except importlib.metadata.PackageNotFoundError:
66
66
  pip_packages.append(package)
67
67
 
68
68
  conda_env = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fairo
3
- Version: 25.9.7
3
+ Version: 25.10.1
4
4
  Summary: SDK for interfacing with Fairo SaaS platform.
5
5
  Author-email: "Fairo Systems, Inc." <support@fairo.ai>
6
6
  License: Apache-2.0
@@ -1 +0,0 @@
1
- __version__ = "25.9.7"
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