File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
libs/e2e-tests/e2e_tests/test_utils Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import os
2
3
import time
3
4
from typing import Callable
4
5
5
6
from langsmith import Client
6
7
7
- LANGSMITH_CLIENT = Client ()
8
+ if os .getenv ("LANGCHAIN_TRACING_V2" , "" ) == "true" :
9
+ LANGSMITH_CLIENT = Client ()
10
+ else :
11
+ LANGSMITH_CLIENT = None
8
12
9
13
10
14
def record_langsmith_sharelink (
11
15
run_id : str , record_property : Callable , tries : int = 6
12
16
) -> None :
13
17
try :
14
- sharelink = LANGSMITH_CLIENT .share_run (run_id )
18
+ sharelink = (
19
+ LANGSMITH_CLIENT .share_run (run_id ) if LANGSMITH_CLIENT else "deactivated"
20
+ )
15
21
record_property ("langsmith_url" , sharelink )
16
22
logging .info ("recorded langsmith link: %s" , sharelink )
17
23
except Exception :
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- export LANGCHAIN_TRACING_V2=true
3
+ # export LANGCHAIN_TRACING_V2=true
4
4
export LANGCHAIN_ENDPOINT=" https://api.smith.langchain.com"
5
5
export LANGCHAIN_PROJECT=" ragstack-ci"
You can’t perform that action at this time.
0 commit comments