Spaces:
Running
Running
github-actions[bot]
commited on
Commit
Β·
e73811b
1
Parent(s):
35b631a
Sync with https://github.com/mozilla-ai/surf-spot-finder
Browse files- services/agent.py +3 -4
services/agent.py
CHANGED
@@ -5,7 +5,7 @@ from components.agent_status import export_logs
|
|
5 |
import streamlit as st
|
6 |
from surf_spot_finder.config import Config
|
7 |
from any_agent import AgentConfig, AnyAgent, TracingConfig, AgentFramework
|
8 |
-
from any_agent.tracing.trace import AgentTrace,
|
9 |
from any_agent.tracing.otel_types import StatusCode
|
10 |
from any_agent.evaluation import evaluate, TraceEvaluationResult
|
11 |
|
@@ -137,16 +137,15 @@ async def display_output(agent_trace: AgentTrace):
|
|
137 |
unsafe_allow_html=True,
|
138 |
)
|
139 |
|
140 |
-
cost: TotalTokenUseAndCost = agent_trace.get_total_cost()
|
141 |
with st.expander("### π Results", expanded=True):
|
142 |
time_col, cost_col, tokens_col = st.columns(3)
|
143 |
duration = agent_trace.duration.total_seconds()
|
144 |
with time_col:
|
145 |
st.info(f"β±οΈ Execution Time: {duration:0.2f} seconds")
|
146 |
with cost_col:
|
147 |
-
st.info(f"π° Estimated Cost: ${cost.total_cost:.6f}")
|
148 |
with tokens_col:
|
149 |
-
st.info(f"π¦ Total Tokens: {
|
150 |
st.markdown("#### Final Output")
|
151 |
st.info(agent_trace.final_output)
|
152 |
|
|
|
5 |
import streamlit as st
|
6 |
from surf_spot_finder.config import Config
|
7 |
from any_agent import AgentConfig, AnyAgent, TracingConfig, AgentFramework
|
8 |
+
from any_agent.tracing.trace import AgentTrace, AgentSpan
|
9 |
from any_agent.tracing.otel_types import StatusCode
|
10 |
from any_agent.evaluation import evaluate, TraceEvaluationResult
|
11 |
|
|
|
137 |
unsafe_allow_html=True,
|
138 |
)
|
139 |
|
|
|
140 |
with st.expander("### π Results", expanded=True):
|
141 |
time_col, cost_col, tokens_col = st.columns(3)
|
142 |
duration = agent_trace.duration.total_seconds()
|
143 |
with time_col:
|
144 |
st.info(f"β±οΈ Execution Time: {duration:0.2f} seconds")
|
145 |
with cost_col:
|
146 |
+
st.info(f"π° Estimated Cost: ${agent_trace.cost.total_cost:.6f}")
|
147 |
with tokens_col:
|
148 |
+
st.info(f"π¦ Total Tokens: {agent_trace.usage.total_tokens:,}")
|
149 |
st.markdown("#### Final Output")
|
150 |
st.info(agent_trace.final_output)
|
151 |
|