fairo 25.7.4__tar.gz → 25.8.2__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.
- {fairo-25.7.4 → fairo-25.8.2}/PKG-INFO +2 -2
- fairo-25.8.2/fairo/__init__.py +1 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/chat/chat.py +3 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/client/client.py +9 -2
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/execution/executor.py +24 -3
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/workflow/dependency.py +7 -6
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/workflow/utils.py +29 -1
- {fairo-25.7.4 → fairo-25.8.2}/fairo.egg-info/PKG-INFO +2 -2
- {fairo-25.7.4 → fairo-25.8.2}/fairo.egg-info/requires.txt +1 -1
- {fairo-25.7.4 → fairo-25.8.2}/pyproject.toml +1 -1
- fairo-25.7.4/fairo/__init__.py +0 -1
- {fairo-25.7.4 → fairo-25.8.2}/README.md +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/base_agent.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/code_analysis_agent.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/output/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/output/base_output.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/output/google_drive.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/tools/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/tools/base_tools.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/tools/code_analysis.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/tools/utils.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/agent/utils.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/chat/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/client/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/exceptions.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/execution/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/execution/agent_serializer.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/execution/env_finder.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/execution/model_log_helper.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/models/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/models/custom_field_value.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/models/resources.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/runnable/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/runnable/runnable.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/workflow/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/core/workflow/base_workflow.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/metrics/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/metrics/fairness_object.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/metrics/metrics.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/settings.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/tests/__init__.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo/tests/test_metrics.py +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo.egg-info/SOURCES.txt +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo.egg-info/dependency_links.txt +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/fairo.egg-info/top_level.txt +0 -0
- {fairo-25.7.4 → fairo-25.8.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fairo
|
|
3
|
-
Version: 25.
|
|
3
|
+
Version: 25.8.2
|
|
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
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: mlflow<=3.
|
|
14
|
+
Requires-Dist: mlflow<=3.2.0,>=3.1.0
|
|
15
15
|
Requires-Dist: langchain<0.4.0,>=0.3.20
|
|
16
16
|
Requires-Dist: langchain-aws<0.3.0,>=0.2.18
|
|
17
17
|
Requires-Dist: langchain-community<0.4.0,>=0.3.20
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "25.8.2"
|
|
@@ -122,6 +122,9 @@ class FairoDeploymentClient(BaseDeploymentClient):
|
|
|
122
122
|
os.environ.get('MLFLOW_TRACKING_PASSWORD')
|
|
123
123
|
)
|
|
124
124
|
|
|
125
|
+
if os.environ.get('MLFLOW_TRACKING_TOKEN'):
|
|
126
|
+
headers['Authorization'] = f"Bearer {os.environ.get('MLFLOW_TRACKING_TOKEN')}"
|
|
127
|
+
|
|
125
128
|
# Make request
|
|
126
129
|
response = requests.post(
|
|
127
130
|
gateway_url,
|
|
@@ -3,10 +3,17 @@ import requests
|
|
|
3
3
|
from requests.auth import HTTPBasicAuth
|
|
4
4
|
|
|
5
5
|
class BaseClient:
|
|
6
|
-
def __init__(self, base_url: str, username: str, password: str):
|
|
6
|
+
def __init__(self, base_url: str, username: str = None, password: str = None, fairo_auth_token: str = None):
|
|
7
7
|
self.base_url = base_url
|
|
8
8
|
self.session = requests.Session()
|
|
9
|
-
|
|
9
|
+
if username is not None and password is not None:
|
|
10
|
+
self.session.auth = HTTPBasicAuth(username, password)
|
|
11
|
+
elif fairo_auth_token is not None:
|
|
12
|
+
self.session.headers.update({
|
|
13
|
+
"Authorization": f"Bearer {fairo_auth_token}"
|
|
14
|
+
})
|
|
15
|
+
else:
|
|
16
|
+
raise ValueError("Must provide either username/password or fairo_auth_token")
|
|
10
17
|
self.session.headers.update({
|
|
11
18
|
"Content-Type": "application/json",
|
|
12
19
|
})
|
|
@@ -23,6 +23,7 @@ logger = logging.getLogger(__name__)
|
|
|
23
23
|
class FairoExecutor:
|
|
24
24
|
def __init__(
|
|
25
25
|
self,
|
|
26
|
+
input_schema,
|
|
26
27
|
agent_type: str = "Langchain",
|
|
27
28
|
agents: List[Any] = [],
|
|
28
29
|
verbose: bool = False,
|
|
@@ -37,6 +38,7 @@ class FairoExecutor:
|
|
|
37
38
|
raise ValueError("FairoExecutor cannot be initialized with both 'agents' and 'runnable'. Please provide only one.")
|
|
38
39
|
if not input_fields:
|
|
39
40
|
raise ValueError("Missing input_fields")
|
|
41
|
+
self.input_schema = input_schema
|
|
40
42
|
self.agents = agents
|
|
41
43
|
self.agent_type = agent_type
|
|
42
44
|
self.verbose = verbose
|
|
@@ -67,8 +69,26 @@ class FairoExecutor:
|
|
|
67
69
|
pipeline = mlflow.pyfunc.load_model(self.runnable.artifact_path)
|
|
68
70
|
else:
|
|
69
71
|
pipeline = AgentChainWrapper(chain_class=self.chain_class, agent_functions_list=self.agents)
|
|
70
|
-
|
|
71
|
-
input_schema
|
|
72
|
+
# Convert Pydantic schema to MLflow Schema
|
|
73
|
+
if hasattr(self.input_schema, 'model_json_schema'):
|
|
74
|
+
# Extract field names from Pydantic schema
|
|
75
|
+
pydantic_schema = self.input_schema.model_json_schema()
|
|
76
|
+
properties = pydantic_schema.get('properties', {})
|
|
77
|
+
cols = []
|
|
78
|
+
for field_name, field_info in properties.items():
|
|
79
|
+
field_type = field_info.get('type', 'string')
|
|
80
|
+
# Map Pydantic types to MLflow types
|
|
81
|
+
mlflow_type = 'string' # Default to string
|
|
82
|
+
if field_type in ['integer', 'number']:
|
|
83
|
+
mlflow_type = 'double'
|
|
84
|
+
elif field_type == 'boolean':
|
|
85
|
+
mlflow_type = 'boolean'
|
|
86
|
+
cols.append(ColSpec(type=mlflow_type, name=field_name))
|
|
87
|
+
input_schema = Schema(cols)
|
|
88
|
+
else:
|
|
89
|
+
# Fallback to input_fields if schema is not Pydantic
|
|
90
|
+
cols = [ColSpec(type="string", name=field) for field in self.input_fields]
|
|
91
|
+
input_schema = Schema(cols)
|
|
72
92
|
|
|
73
93
|
output_schema = Schema([
|
|
74
94
|
ColSpec(type="string", name="output"),
|
|
@@ -97,7 +117,8 @@ class FairoExecutor:
|
|
|
97
117
|
fairo_settings = {
|
|
98
118
|
"type": type,
|
|
99
119
|
"process_graph": process_graph,
|
|
100
|
-
"
|
|
120
|
+
"schema": self.input_schema.model_json_schema(),
|
|
121
|
+
"input_fields": list(self.input_schema.model_fields.keys()),
|
|
101
122
|
}
|
|
102
123
|
if process_graph:
|
|
103
124
|
mlflow.log_text(json.dumps(fairo_settings, ensure_ascii=False, indent=2), artifact_file="fairo_settings.txt")
|
|
@@ -185,15 +185,17 @@ class FairoVectorStore(BaseVectorStore):
|
|
|
185
185
|
self.username = username or os.environ.get("FAIRO_API_ACCESS_KEY_ID")
|
|
186
186
|
self.password = password or os.environ.get("FAIRO_API_SECRET")
|
|
187
187
|
self.api_url = api_url or os.environ.get("FAIRO_BASE_URL", "https://api.fairo.ai")
|
|
188
|
+
self.fairo_auth_token = os.environ.get("FAIRO_AUTH_TOKEN")
|
|
188
189
|
|
|
189
|
-
if not self.username or not self.password:
|
|
190
|
-
raise ValueError("Fairo API credentials must be provided either as parameters or in the FAIRO_USERNAME and FAIRO_PASSWORD environment variables")
|
|
190
|
+
if not self.fairo_auth_token and (not self.username or not self.password):
|
|
191
|
+
raise ValueError("Fairo API credentials must be provided either as FAIRO_AUTH_TOKEN or as parameters or in the FAIRO_USERNAME and FAIRO_PASSWORD environment variables")
|
|
191
192
|
|
|
192
193
|
# Initialize API client
|
|
193
194
|
self.client = BaseClient(
|
|
194
195
|
base_url=self.api_url.rstrip('/'),
|
|
195
196
|
username=self.username,
|
|
196
|
-
password=self.password
|
|
197
|
+
password=self.password,
|
|
198
|
+
fairo_auth_token=self.fairo_auth_token
|
|
197
199
|
)
|
|
198
200
|
|
|
199
201
|
# Set up embeddings
|
|
@@ -258,11 +260,10 @@ class FairoVectorStore(BaseVectorStore):
|
|
|
258
260
|
# Generate embeddings for the document content
|
|
259
261
|
embedding = self.embeddings.embed_query(doc.page_content)
|
|
260
262
|
|
|
261
|
-
# Create doc entry
|
|
263
|
+
# Create doc entry (let Fairo API generate document IDs)
|
|
262
264
|
doc_entry = {
|
|
263
265
|
"page_content": doc.page_content,
|
|
264
|
-
"metadata": doc.metadata
|
|
265
|
-
"uuid": str(uuid.uuid4()) # Generate a UUID for this document
|
|
266
|
+
"metadata": doc.metadata
|
|
266
267
|
}
|
|
267
268
|
docs_data.append(doc_entry)
|
|
268
269
|
|
|
@@ -278,6 +278,7 @@ def output_langchain_process_graph(agents):
|
|
|
278
278
|
"prompt": get_agent_prompt(agent),
|
|
279
279
|
"prefix": agent_kwargs.get("prefix", ""),
|
|
280
280
|
"suffix": agent_kwargs.get("suffix", ""),
|
|
281
|
+
"schema": get_agent_schema(agent),
|
|
281
282
|
}
|
|
282
283
|
)
|
|
283
284
|
|
|
@@ -457,4 +458,31 @@ def get_agent_prompt(agent) -> str:
|
|
|
457
458
|
search_queue.append(child)
|
|
458
459
|
|
|
459
460
|
# Nothing found – return empty string
|
|
460
|
-
return ""
|
|
461
|
+
return ""
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
def get_agent_schema(agent):
|
|
465
|
+
"""
|
|
466
|
+
Returns a JSON schema dict when available, otherwise None.
|
|
467
|
+
Checks common attributes across SimpleAgent and LangChain agents.
|
|
468
|
+
"""
|
|
469
|
+
candidate_attrs = ("args_schema", "input_schema", "agent_schema", "schema")
|
|
470
|
+
for attr in candidate_attrs:
|
|
471
|
+
obj = getattr(agent, attr, None)
|
|
472
|
+
if obj is None:
|
|
473
|
+
continue
|
|
474
|
+
try:
|
|
475
|
+
if isinstance(obj, dict):
|
|
476
|
+
return obj
|
|
477
|
+
if hasattr(obj, "model_json_schema") and callable(getattr(obj, "model_json_schema")):
|
|
478
|
+
return obj.model_json_schema()
|
|
479
|
+
if hasattr(obj, "schema") and callable(getattr(obj, "schema")):
|
|
480
|
+
return obj.schema()
|
|
481
|
+
except Exception as e:
|
|
482
|
+
pass
|
|
483
|
+
|
|
484
|
+
inner = getattr(agent, "agent", None)
|
|
485
|
+
if inner is not None and inner is not agent:
|
|
486
|
+
return get_agent_schema(inner)
|
|
487
|
+
|
|
488
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fairo
|
|
3
|
-
Version: 25.
|
|
3
|
+
Version: 25.8.2
|
|
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
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: mlflow<=3.
|
|
14
|
+
Requires-Dist: mlflow<=3.2.0,>=3.1.0
|
|
15
15
|
Requires-Dist: langchain<0.4.0,>=0.3.20
|
|
16
16
|
Requires-Dist: langchain-aws<0.3.0,>=0.2.18
|
|
17
17
|
Requires-Dist: langchain-community<0.4.0,>=0.3.20
|
fairo-25.7.4/fairo/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "25.7.4"
|
|
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
|
|
File without changes
|