Spaces:
Running
Running
github-actions[bot]
commited on
Commit
ยท
55a3068
1
Parent(s):
d98556a
Sync with https://github.com/mozilla-ai/surf-spot-finder
Browse files
utils.py
CHANGED
@@ -84,17 +84,23 @@ async def run_agent(user_inputs: dict[str, Any]):
|
|
84 |
if span.attributes:
|
85 |
# st.json(span.attributes, expanded=False)
|
86 |
if "input.value" in span.attributes:
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
92 |
if "output.value" in span.attributes:
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
98 |
with col2:
|
99 |
status_color = (
|
100 |
"green" if span.status.status_code == StatusCode.OK else "red"
|
|
|
84 |
if span.attributes:
|
85 |
# st.json(span.attributes, expanded=False)
|
86 |
if "input.value" in span.attributes:
|
87 |
+
try:
|
88 |
+
input_value = json.loads(span.attributes["input.value"])
|
89 |
+
if isinstance(input_value, list) and len(input_value) > 0:
|
90 |
+
st.write(f"Input: {input_value[-1]}")
|
91 |
+
else:
|
92 |
+
st.write(f"Input: {input_value}")
|
93 |
+
except: # noqa: E722
|
94 |
+
st.write(f"Input: {span.attributes['input.value']}")
|
95 |
if "output.value" in span.attributes:
|
96 |
+
try:
|
97 |
+
output_value = json.loads(span.attributes["output.value"])
|
98 |
+
if isinstance(output_value, list) and len(output_value) > 0:
|
99 |
+
st.write(f"Output: {output_value[-1]}")
|
100 |
+
else:
|
101 |
+
st.write(f"Output: {output_value}")
|
102 |
+
except: # noqa: E722
|
103 |
+
st.write(f"Output: {span.attributes['output.value']}")
|
104 |
with col2:
|
105 |
status_color = (
|
106 |
"green" if span.status.status_code == StatusCode.OK else "red"
|