We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 146f987 commit c52d3aaCopy full SHA for c52d3aa
libs/e2e-tests/e2e_tests/test_utils/tracing.py
@@ -1,17 +1,23 @@
1
import logging
2
+import os
3
import time
4
from typing import Callable
5
6
from langsmith import Client
7
-LANGSMITH_CLIENT = Client()
8
+if os.getenv("LANGCHAIN_TRACING_V2", "") == "true":
9
+ LANGSMITH_CLIENT = Client()
10
+else:
11
+ LANGSMITH_CLIENT = None
12
13
14
def record_langsmith_sharelink(
15
run_id: str, record_property: Callable, tries: int = 6
16
) -> None:
17
try:
- sharelink = LANGSMITH_CLIENT.share_run(run_id)
18
+ sharelink = (
19
+ LANGSMITH_CLIENT.share_run(run_id) if LANGSMITH_CLIENT else "deactivated"
20
+ )
21
record_property("langsmith_url", sharelink)
22
logging.info("recorded langsmith link: %s", sharelink)
23
except Exception:
0 commit comments