Skip to content

Commit

Permalink
[TELEMETRY]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Mar 22, 2024
1 parent 09494cb commit 492377b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 27 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ IFTTTKey="your_iftttkey_here"
BRAVE_API_KEY="your_brave_api_key_here"
SPOONACULAR_KEY="your_spoonacular_key_here"
HF_API_KEY="your_huggingface_api_key_here"
USE_TELEMTRY=True


REDIS_HOST=
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms"
version = "4.3.1"
version = "4.3.3"
description = "Swarms - Pytorch"
license = "MIT"
authors = ["Kye Gomez <[email protected]>"]
Expand All @@ -25,13 +25,13 @@ classifiers = [

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
torch = "2.1.1"
torch = ">=2.1.1,<3.0"
transformers = "*"
asyncio = "3.4.3"
asyncio = ">=3.4.3,<4.0"
einops = "0.7.0"
google-generativeai = "0.3.1"
langchain-experimental = "0.0.10"
langchain-community = "*"
langchain-community = "0.0.29"
faiss-cpu = "1.7.4"
backoff = "2.2.1"
datasets = "*"
Expand All @@ -50,7 +50,7 @@ huggingface-hub = "*"
pydantic = "2.6.4"
tenacity = "8.2.2"
Pillow = "9.4.0"
chromadb = "*"
chromadb = "0.4.24"
termcolor = "2.2.0"
torchvision = "0.16.1"
rich = "13.5.2"
Expand Down
9 changes: 6 additions & 3 deletions swarms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# from swarms.telemetry.main import Telemetry # noqa: E402, F403
from swarms.telemetry.bootup import bootup # noqa: E402, F403
import os

from swarms.telemetry.bootup import bootup # noqa: E402, F403
from swarms.telemetry.sentry_active import activate_sentry

os.environ["WANDB_SILENT"] = "true"

bootup()
activate_sentry()


from swarms.agents import * # noqa: E402, F403
from swarms.artifacts import * # noqa: E402, F403
from swarms.chunkers import * # noqa: E402, F403
from swarms.memory import * # noqa: E402, F403
from swarms.models import * # noqa: E402, F403
from swarms.prompts import * # noqa: E402, F403
from swarms.structs import * # noqa: E402, F403
from swarms.telemetry import * # noqa: E402, F403
from swarms.tokenizers import * # noqa: E402, F403
from swarms.tools import * # noqa: E402, F403
from swarms.utils import * # noqa: E402, F403
from swarms.memory import * # noqa: E402, F403
21 changes: 2 additions & 19 deletions swarms/telemetry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,7 @@
get_system_info,
get_user_device_data,
)

# # Capture data from the user's device
# posthog.capture(
# "User Device Data",
# str(get_user_device_data()),
# )

# # Capture system information
# posthog.capture(
# "System Information",
# str(system_info()),
# )

# # Capture the user's unique identifier
# posthog.capture(
# "User Unique Identifier",
# str(generate_unique_identifier()),
# )

from swarms.telemetry.sentry_active import activate_sentry

__all__ = [
"log_all_calls",
Expand All @@ -54,4 +36,5 @@
"get_package_mismatches",
"system_info",
"get_user_device_data",
"activate_sentry",
]
20 changes: 20 additions & 0 deletions swarms/telemetry/sentry_active.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
from dotenv import load_dotenv
import sentry_sdk

load_dotenv()

os.environ["USE_TELEMETRY"] = "True"

use_telementry = os.getenv("USE_TELEMETRY")

def activate_sentry():
if use_telementry == "True":
sentry_sdk.init(
dsn="https://5d72dd59551c02f78391d2ea5872ddd4@o4504578305490944.ingest.us.sentry.io/4506951704444928",
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
enable_tracing=True,
debug = True,
)

0 comments on commit 492377b

Please sign in to comment.