File size: 1,263 Bytes
3f19740 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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' |