BhanuPrakashSamoju commited on
Commit
a99896a
1 Parent(s): a4f673f

Update Index.py

Browse files
Files changed (1) hide show
  1. Index.py +6 -1
Index.py CHANGED
@@ -2,6 +2,7 @@ from fastapi import FastAPI
2
  import os
3
  import json
4
  import pandas as pd
 
5
 
6
  import phoenix as px
7
  from phoenix.trace.langchain import OpenInferenceTracer, LangChainInstrumentor
@@ -193,10 +194,14 @@ def rag( question: str, evaluate: bool):
193
 
194
  #response = chain("how tredence brought good insight?")
195
  response = chain(_prompt(question))
196
-
197
  print(response["result"])
198
 
 
 
199
  df = px.active_session().get_spans_dataframe()
 
 
 
200
  df_sorted = df.sort_values(by='end_time',ascending=False)
201
 
202
  model_input = json.loads(df_sorted[df_sorted["name"] == "LLMChain"]["attributes.input.value"][0])
 
2
  import os
3
  import json
4
  import pandas as pd
5
+ import time
6
 
7
  import phoenix as px
8
  from phoenix.trace.langchain import OpenInferenceTracer, LangChainInstrumentor
 
194
 
195
  #response = chain("how tredence brought good insight?")
196
  response = chain(_prompt(question))
 
197
  print(response["result"])
198
 
199
+ time.sleep(7)
200
+
201
  df = px.active_session().get_spans_dataframe()
202
+ print(px.active_session())
203
+ print(px.active_session().get_spans_dataframe())
204
+ print(df.count())
205
  df_sorted = df.sort_values(by='end_time',ascending=False)
206
 
207
  model_input = json.loads(df_sorted[df_sorted["name"] == "LLMChain"]["attributes.input.value"][0])