Spaces:
Runtime error
Runtime error
display trace url
Browse files- app.py +3 -0
- 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 {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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__":
|