From c614d6468644d700d034afe66d11afc7d4097ce0 Mon Sep 17 00:00:00 2001 From: Shawn Qiu Date: Mon, 13 May 2024 16:14:52 -0700 Subject: [PATCH] Fix: not having langchain no longer raises an unhandled exception (#203) --- agentops/__init__.py | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/agentops/__init__.py b/agentops/__init__.py index 1c2d4dfa..efbfd365 100755 --- a/agentops/__init__.py +++ b/agentops/__init__.py @@ -9,8 +9,10 @@ from .decorators import record_function from .agent import track_agent from .log_config import set_logging_level_info, set_logging_level_critial -from .langchain_callback_handler import LangchainCallbackHandler, AsyncLangchainCallbackHandler - +try: + from .langchain_callback_handler import LangchainCallbackHandler, AsyncLangchainCallbackHandler +except ModuleNotFoundError: + pass def init(api_key: Optional[str] = None, parent_key: Optional[str] = None, diff --git a/pyproject.toml b/pyproject.toml index 49250903..a81826f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "agentops" -version = "0.1.10" +version = "0.1.11" authors = [ { name="Alex Reibman", email="areibman@gmail.com" }, { name="Shawn Qiu", email="siyangqiu@gmail.com" },