BhanuPrakashSamoju commited on
Commit
a04fa6e
1 Parent(s): 9d0d311

Upload trace.py

Browse files
Files changed (1) hide show
  1. pages/trace.py +24 -1
pages/trace.py CHANGED
@@ -1 +1,24 @@
1
- .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import streamlit as st
3
+
4
+ #from .streamapp import trace_df
5
+
6
+ print("trace_df ", st.session_state['trace_df'])
7
+
8
+ trace_df = st.session_state['trace_df']
9
+ print(list(trace_df))
10
+
11
+ 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']]
12
+ trace_df = trace_df.sort_values(by='start_time', ascending = False)
13
+
14
+
15
+ st.dataframe(trace_df)
16
+
17
+ # if px.active_session():
18
+ # df0 = px.active_session().get_spans_dataframe()
19
+ # if not df0.empty:
20
+ # df= df0.fillna('')
21
+ # st.dataframe(df)
22
+
23
+
24
+ #'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'