import streamlit as st | |
from PIL import Image | |
#from .streamapp import trace_df | |
st.sidebar.image(Image.open("./test-logo.png"), use_column_width=True) | |
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) | |
blankIndex=[''] * len(trace_df) | |
trace_df.index=blankIndex | |
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' |