How to get langsmith trace linkj from the session id? #24001
Replies: 5 comments 3 replies
-
Hey there, @the-krushnakant! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's crack this code conundrum together! 🤖 To get the LangSmith trace link from the session ID, you can use the from langchain_core.tracers.langchain import LangChainTracer
from langsmith import Client
# Initialize the LangChainTracer with your LangSmith client
client = Client(api_key="your_api_key")
tracer = LangChainTracer(client=client, project_name="your_project_name")
# Assuming you have already run your assistant function and have traces
try:
trace_link = tracer.get_run_url()
print(f"LangSmith trace link: {trace_link}")
except ValueError as e:
print(f"Error retrieving trace link: {e}") This method will return the URL for the latest run, which you can use to access the trace link directly [1]. |
Beta Was this translation helpful? Give feedback.
-
@dosu |
Beta Was this translation helpful? Give feedback.
-
@dosu |
Beta Was this translation helpful? Give feedback.
-
@dosu I want to get id of existing project |
Beta Was this translation helpful? Give feedback.
-
@dosu how can i get list of all threads on a specific project using project name |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I'm using the langsmith_extra session_id to send all related traces to a thread.
But now that I have the unique identifier for the thread, is there a simple way to get the langsmith link where this thread is shown?
The link is something like
https://smith.langchain.com/o//projects/p//t/
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
Beta Was this translation helpful? Give feedback.
All reactions