Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for crew refactor #393

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion agentops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from .log_config import logger
from .session import Session
import threading
from importlib.metadata import version as get_version
from packaging import version

try:
from .partners.langchain_callback_handler import (
Expand All @@ -23,7 +25,13 @@
Client().add_default_tags(["autogen"])

if "crewai" in sys.modules:
Client().configure(instrument_llm_calls=False)
crew_version = version.parse(get_version("crewai"))

Check warning on line 28 in agentops/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/__init__.py#L28

Added line #L28 was not covered by tests

if crew_version < version.parse("0.56.0"): # uses langchain
Client().configure(instrument_llm_calls=False)

Check warning on line 31 in agentops/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/__init__.py#L31

Added line #L31 was not covered by tests
else: # uses LiteLLM
Client().configure(instrument_llm_calls=True)

Check warning on line 33 in agentops/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/__init__.py#L33

Added line #L33 was not covered by tests

Client().add_default_tags(["crewai"])


Expand Down
Loading