Joshua Sundance Bailey
commited on
Commit
·
3aab4cd
1
Parent(s):
5a5e8cd
versioning and bug fix
Browse files
langchain-streamlit-demo/app.py
CHANGED
@@ -4,6 +4,7 @@ from tempfile import NamedTemporaryFile
|
|
4 |
from typing import Union
|
5 |
|
6 |
import anthropic
|
|
|
7 |
import openai
|
8 |
import streamlit as st
|
9 |
from langchain import LLMChain
|
@@ -411,9 +412,12 @@ if st.session_state.llm:
|
|
411 |
st.session_state.run_id = st.session_state.run.id
|
412 |
RUN_COLLECTOR.traced_runs = []
|
413 |
wait_for_all_tracers()
|
414 |
-
|
415 |
-
st.session_state.
|
416 |
-
|
|
|
|
|
|
|
417 |
if st.session_state.trace_link:
|
418 |
with sidebar:
|
419 |
st.markdown(
|
|
|
4 |
from typing import Union
|
5 |
|
6 |
import anthropic
|
7 |
+
import langsmith.utils
|
8 |
import openai
|
9 |
import streamlit as st
|
10 |
from langchain import LLMChain
|
|
|
412 |
st.session_state.run_id = st.session_state.run.id
|
413 |
RUN_COLLECTOR.traced_runs = []
|
414 |
wait_for_all_tracers()
|
415 |
+
try:
|
416 |
+
st.session_state.trace_link = st.session_state.client.read_run(
|
417 |
+
st.session_state.run_id,
|
418 |
+
).url
|
419 |
+
except langsmith.utils.LangSmithError:
|
420 |
+
st.session_state.trace_link = None
|
421 |
if st.session_state.trace_link:
|
422 |
with sidebar:
|
423 |
st.markdown(
|