File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -45,24 +45,20 @@ def get_or_create_uuid():
45
45
46
46
47
47
def send_telemetry (event_name , properties = None ):
48
+ if properties is None :
49
+ properties = {}
50
+ properties ["oi_version" ] = pkg_resources .get_distribution (
51
+ "open-interpreter"
52
+ ).version
48
53
try :
49
- if properties is None :
50
- properties = {}
51
- properties ["oi_version" ] = pkg_resources .get_distribution (
52
- "open-interpreter"
53
- ).version
54
- with open (os .devnull , "w" ) as f , contextlib .redirect_stdout (
55
- f
56
- ), contextlib .redirect_stderr (f ):
57
- url = "https://app.posthog.com/capture"
58
- headers = {"Content-Type" : "application/json" }
59
- data = {
60
- "api_key" : "phc_6cmXy4MEbLfNGezqGjuUTY8abLu0sAwtGzZFpQW97lc" ,
61
- "event" : event_name ,
62
- "properties" : properties ,
63
- "distinct_id" : user_id ,
64
- }
65
- response = requests .post (url , headers = headers , data = json .dumps (data ))
54
+ url = "https://app.posthog.com/capture"
55
+ headers = {"Content-Type" : "application/json" }
56
+ data = {
57
+ "api_key" : "phc_6cmXy4MEbLfNGezqGjuUTY8abLu0sAwtGzZFpQW97lc" ,
58
+ "event" : event_name ,
59
+ "properties" : properties ,
60
+ "distinct_id" : user_id ,
61
+ }
62
+ requests .post (url , headers = headers , data = json .dumps (data ))
66
63
except :
67
- # Non blocking
68
64
pass
You can’t perform that action at this time.
0 commit comments