Skip to content

Commit c52d3aa

Browse files
committed
Deactivate LangSmith
1 parent 146f987 commit c52d3aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libs/e2e-tests/e2e_tests/test_utils/tracing.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
import logging
2+
import os
23
import time
34
from typing import Callable
45

56
from langsmith import Client
67

7-
LANGSMITH_CLIENT = Client()
8+
if os.getenv("LANGCHAIN_TRACING_V2", "") == "true":
9+
LANGSMITH_CLIENT = Client()
10+
else:
11+
LANGSMITH_CLIENT = None
812

913

1014
def record_langsmith_sharelink(
1115
run_id: str, record_property: Callable, tries: int = 6
1216
) -> None:
1317
try:
14-
sharelink = LANGSMITH_CLIENT.share_run(run_id)
18+
sharelink = (
19+
LANGSMITH_CLIENT.share_run(run_id) if LANGSMITH_CLIENT else "deactivated"
20+
)
1521
record_property("langsmith_url", sharelink)
1622
logging.info("recorded langsmith link: %s", sharelink)
1723
except Exception:

0 commit comments

Comments
 (0)