fairo 25.9.2__tar.gz → 25.9.4__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.9.2 → fairo-25.9.4}/PKG-INFO +1 -1
- fairo-25.9.4/fairo/__init__.py +1 -0
- fairo-25.9.4/fairo/core/utils.py +54 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/workflow/dependency.py +0 -3
- {fairo-25.9.2 → fairo-25.9.4}/fairo.egg-info/PKG-INFO +1 -1
- fairo-25.9.2/fairo/__init__.py +0 -1
- fairo-25.9.2/fairo/core/utils.py +0 -28
- {fairo-25.9.2 → fairo-25.9.4}/README.md +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/base_agent.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/code_analysis_agent.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/output/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/output/base_output.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/output/google_drive.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/tools/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/tools/base_tools.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/tools/code_analysis.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/tools/utils.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/agent/utils.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/chat/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/chat/chat.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/client/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/client/client.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/exceptions.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/execution/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/execution/agent_serializer.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/execution/env_finder.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/execution/executor.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/execution/model_log_helper.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/models/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/models/custom_field_value.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/models/resources.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/runnable/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/runnable/runnable.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/tools/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/tools/plot.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/tools/suggestion.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/workflow/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/workflow/base_workflow.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/core/workflow/utils.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/metrics/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/metrics/fairness_object.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/metrics/metrics.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/settings.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/tests/__init__.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo/tests/test_metrics.py +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo.egg-info/SOURCES.txt +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo.egg-info/dependency_links.txt +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo.egg-info/requires.txt +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/fairo.egg-info/top_level.txt +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/pyproject.toml +0 -0
- {fairo-25.9.2 → fairo-25.9.4}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "25.9.4"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from langchain_core.messages import ToolMessage
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
def parse_chat_interface_output(agent_executor_result):
|
|
6
|
+
"""
|
|
7
|
+
Parses agent executor result into chat interface response
|
|
8
|
+
return_intermediate_steps must be set as true on the AgentExecutor in order to properly parse plot and suggestions
|
|
9
|
+
"""
|
|
10
|
+
messages = [{"role": "assistant", "content": [
|
|
11
|
+
{
|
|
12
|
+
"type": "text",
|
|
13
|
+
"text": agent_executor_result["output"]
|
|
14
|
+
}
|
|
15
|
+
]}]
|
|
16
|
+
suggestions = []
|
|
17
|
+
intermediate_steps = agent_executor_result.get('intermediate_steps', [])
|
|
18
|
+
for step, output in intermediate_steps:
|
|
19
|
+
if step.tool == "generate_plot":
|
|
20
|
+
messages.append({"role": "assistant", "content": [
|
|
21
|
+
{
|
|
22
|
+
"type": "image",
|
|
23
|
+
"image": output
|
|
24
|
+
}
|
|
25
|
+
]})
|
|
26
|
+
if step.tool == "send_chat_suggestions":
|
|
27
|
+
suggestions = output
|
|
28
|
+
|
|
29
|
+
# Check if some tool message has artifact and raw_html attribute
|
|
30
|
+
artifact = None
|
|
31
|
+
is_tool_msg = isinstance(output, ToolMessage)
|
|
32
|
+
if is_tool_msg:
|
|
33
|
+
artifact = getattr(output, "artifact", None)
|
|
34
|
+
if artifact is None:
|
|
35
|
+
artifact = getattr(output, "additional_kwargs", {}).get("artifact")
|
|
36
|
+
if artifact:
|
|
37
|
+
artifact_id = artifact.get("artifact_id")
|
|
38
|
+
if artifact_id:
|
|
39
|
+
base_dir = Path("/tmp") if Path("/tmp").exists() else Path.cwd()
|
|
40
|
+
artifact_path = base_dir / f"{artifact_id}.html"
|
|
41
|
+
messages.append({
|
|
42
|
+
"role": "assistant",
|
|
43
|
+
"content": [{
|
|
44
|
+
"type": "file",
|
|
45
|
+
"mimeType": "text/html",
|
|
46
|
+
"data": artifact_path.read_text(encoding="utf-8")
|
|
47
|
+
}]
|
|
48
|
+
})
|
|
49
|
+
if os.path.exists(artifact_path):
|
|
50
|
+
os.remove(artifact_path)
|
|
51
|
+
return {
|
|
52
|
+
"messages": messages,
|
|
53
|
+
"suggestions": suggestions
|
|
54
|
+
}
|
|
@@ -122,9 +122,6 @@ class FairoVectorStore(BaseVectorStore):
|
|
|
122
122
|
# Convert documents to Fairo format
|
|
123
123
|
docs_data = []
|
|
124
124
|
for doc in documents:
|
|
125
|
-
# Generate embeddings for the document content
|
|
126
|
-
embedding = self.embeddings.embed_query(doc.page_content)
|
|
127
|
-
|
|
128
125
|
# Create doc entry (let Fairo API generate document IDs)
|
|
129
126
|
doc_entry = {
|
|
130
127
|
"page_content": doc.page_content,
|
fairo-25.9.2/fairo/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "25.9.2"
|
fairo-25.9.2/fairo/core/utils.py
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
def parse_chat_interface_output(agent_executor_result):
|
|
2
|
-
"""
|
|
3
|
-
Parses agent executor result into chat interface response
|
|
4
|
-
return_intermediate_steps must be set as true on the AgentExecutor in order to properly parse plot and suggestions
|
|
5
|
-
"""
|
|
6
|
-
messages = [{"role": "assistant", "content": [
|
|
7
|
-
{
|
|
8
|
-
"type": "text",
|
|
9
|
-
"text": agent_executor_result["output"]
|
|
10
|
-
}
|
|
11
|
-
]}]
|
|
12
|
-
suggestions = []
|
|
13
|
-
intermediate_steps = agent_executor_result.get('intermediate_steps', [])
|
|
14
|
-
for step, output in intermediate_steps:
|
|
15
|
-
if step.tool == "generate_plot":
|
|
16
|
-
messages.append({"role": "assistant", "content": [
|
|
17
|
-
{
|
|
18
|
-
"type": "image",
|
|
19
|
-
"image": output
|
|
20
|
-
}
|
|
21
|
-
]})
|
|
22
|
-
if step.tool == "send_chat_suggestions":
|
|
23
|
-
suggestions = output
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
"messages": messages,
|
|
27
|
-
"suggestions": suggestions
|
|
28
|
-
}
|
|
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
|
|
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
|