ayut commited on
Commit
34ccb7c
β€’
1 Parent(s): c35885d

display trace url

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. rag/rag.py +5 -1
app.py CHANGED
@@ -58,6 +58,9 @@ if "last_output" in st.session_state:
58
  text = st.session_state["last_text"]
59
  st.write(text)
60
 
 
 
 
61
  # use the weave client to retrieve the call and attach feedback
62
  st.button(":thumbsup:", on_click=lambda: weave_client.call(output['call_id']).feedback.add_reaction("πŸ‘"), key='up')
63
  st.button(":thumbsdown:", on_click=lambda: weave_client.call(output['call_id']).feedback.add_reaction("πŸ‘Ž"), key='down')
 
58
  text = st.session_state["last_text"]
59
  st.write(text)
60
 
61
+ url = output["url"]
62
+ st.info(f"The weave trace url: {url}", icon="ℹ️")
63
+
64
  # use the weave client to retrieve the call and attach feedback
65
  st.button(":thumbsup:", on_click=lambda: weave_client.call(output['call_id']).feedback.add_reaction("πŸ‘"), key='up')
66
  st.button(":thumbsdown:", on_click=lambda: weave_client.call(output['call_id']).feedback.add_reaction("πŸ‘Ž"), key='down')
rag/rag.py CHANGED
@@ -150,7 +150,11 @@ class SimpleRAGPipeline(weave.Model):
150
  @weave.op()
151
  def predict(self, question: str):
152
  response = self.query_engine.query(question)
153
- return {"response": response, 'call_id': weave.get_current_call().id}
 
 
 
 
154
 
155
 
156
  if __name__ == "__main__":
 
150
  @weave.op()
151
  def predict(self, question: str):
152
  response = self.query_engine.query(question)
153
+ return {
154
+ "response": response,
155
+ 'call_id': weave.get_current_call().id,
156
+ "url": weave.get_current_call().ui_url,
157
+ }
158
 
159
 
160
  if __name__ == "__main__":