streamlit / pages /trace.py
DeepVen's picture
Upload 2 files
3f19740
import streamlit as st
#from .streamapp import trace_df
print("trace_df ", st.session_state['trace_df'])
trace_df = st.session_state['trace_df']
print(list(trace_df))
trace_df = trace_df.loc[:,['name', 'span_kind', 'start_time', 'end_time', 'attributes.__computed__.latency_ms', 'status_code', 'status_message', 'attributes.llm.invocation_parameters', 'attributes.llm.prompts', 'attributes.input.value', 'attributes.output.value', 'attributes.llm.prompt_template.template', 'attributes.llm.prompt_template.variables', 'attributes.llm.prompt_template.version', 'attributes.retrieval.documents']]
trace_df = trace_df.sort_values(by='start_time', ascending = False)
st.dataframe(trace_df)
# if px.active_session():
# df0 = px.active_session().get_spans_dataframe()
# if not df0.empty:
# df= df0.fillna('')
# st.dataframe(df)
#'name', 'span_kind', 'start_time', 'end_time', 'status_code', 'status_message', 'attributes.llm.invocation_parameters', 'attributes.llm.prompts', 'attributes.input.value', 'attributes.output.value', 'attributes.__computed__.latency_ms', 'attributes.llm.prompt_template.template', 'attributes.llm.prompt_template.variables', 'attributes.llm.prompt_template.version', 'attributes.retrieval.documents'