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

Llmtracker fix #554

Merged
merged 33 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ec30658
move files around
areibman Dec 5, 2024
f9bd40c
rename files to prevent bad imports
areibman Dec 6, 2024
5c33aa1
rename files back
areibman Dec 6, 2024
efb547f
version upgrade
areibman Dec 6, 2024
955cae3
fix tach
areibman Dec 6, 2024
ec8d2da
Merge branch 'main' into llmtracker_fix
areibman Dec 6, 2024
5f89b29
rc relase
areibman Dec 7, 2024
71de366
change to relative paths
areibman Dec 7, 2024
9c2607d
new rc
areibman Dec 7, 2024
d76039f
removed circular imports
areibman Dec 7, 2024
590cba9
new rc
areibman Dec 7, 2024
0170e0a
upgrade rc
areibman Dec 7, 2024
9b5be53
added new build stuff
areibman Dec 7, 2024
83fca9a
update version
areibman Dec 7, 2024
3be765e
made wildcare finder
areibman Dec 7, 2024
d871b3f
check providers
areibman Dec 7, 2024
16a0dae
remove partners
areibman Dec 7, 2024
d78b19a
rc7
areibman Dec 7, 2024
ac3866a
added new tool
areibman Dec 7, 2024
25b6540
revert providers
areibman Dec 7, 2024
d2762bd
resetore dependency groups
areibman Dec 9, 2024
259550d
Merge branch 'main' into llmtracker_fix
areibman Dec 10, 2024
eabc88e
fixed autogen logging
areibman Dec 10, 2024
2014adf
bump rc
areibman Dec 10, 2024
167366e
Merge branch 'main' into llmtracker_fix
areibman Dec 10, 2024
7f97876
version bump for rc
areibman Dec 10, 2024
e4b81aa
fix import
areibman Dec 10, 2024
bd9b19f
new release
areibman Dec 10, 2024
de99c17
add providers
areibman Dec 10, 2024
14550d0
bump to version 21
areibman Dec 10, 2024
d4236a2
Merge branch 'main' into llmtracker_fix
teocns Dec 11, 2024
c046fec
fix imports: use absolute paths
teocns Dec 11, 2024
14b7270
git checkout main -- pyproject.toml
teocns Dec 11, 2024
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
1 change: 1 addition & 0 deletions agentops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import threading
from importlib.metadata import version as get_version
from packaging import version
from .llms import tracker

try:
from .partners.langchain_callback_handler import (
Expand Down
2 changes: 1 addition & 1 deletion agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .config import Configuration
from .event import ErrorEvent, Event
from .host_env import get_host_env
from .llms import LlmTracker
from .llms.tracker import LlmTracker
from .log_config import logger
from .meta_client import MetaClient
from .session import Session, active_sessions
Expand Down
16 changes: 8 additions & 8 deletions agentops/llms/ai21.py → agentops/llms/providers/ai21.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import pprint
from typing import Optional

from agentops.llms.instrumented_provider import InstrumentedProvider
from agentops.time_travel import fetch_completion_override_from_time_travel_cache

from ..event import ErrorEvent, LLMEvent, ActionEvent, ToolEvent
from ..session import Session
from ..log_config import logger
from ..helpers import check_call_stack_for_agent_id, get_ISO_time
from ..singleton import singleton
from ...llms.providers.instrumented_provider import InstrumentedProvider
from ...time_travel import fetch_completion_override_from_time_travel_cache

from ...event import ErrorEvent, LLMEvent, ActionEvent, ToolEvent
from ...session import Session
from ...log_config import logger
from ...helpers import check_call_stack_for_agent_id, get_ISO_time
from ...singleton import singleton


@singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import pprint
from typing import Optional

from agentops.llms.instrumented_provider import InstrumentedProvider
from agentops.time_travel import fetch_completion_override_from_time_travel_cache

from ..event import ErrorEvent, LLMEvent, ToolEvent
from ..helpers import check_call_stack_for_agent_id, get_ISO_time
from ..log_config import logger
from ..session import Session
from ..singleton import singleton
from ...llms.providers.instrumented_provider import InstrumentedProvider
from ...time_travel import fetch_completion_override_from_time_travel_cache

from ...event import ErrorEvent, LLMEvent, ToolEvent
from ...helpers import check_call_stack_for_agent_id, get_ISO_time
from ...log_config import logger
from ...session import Session
from ...singleton import singleton


@singleton
Expand Down
10 changes: 5 additions & 5 deletions agentops/llms/cohere.py → agentops/llms/providers/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from typing import Optional

from .instrumented_provider import InstrumentedProvider
from ..event import ActionEvent, ErrorEvent, LLMEvent
from ..session import Session
from ..log_config import logger
from agentops.helpers import get_ISO_time, check_call_stack_for_agent_id
from ..singleton import singleton
from ...event import ActionEvent, ErrorEvent, LLMEvent
from ...session import Session
from ...log_config import logger
from ...helpers import get_ISO_time, check_call_stack_for_agent_id
areibman marked this conversation as resolved.
Show resolved Hide resolved
from ...singleton import singleton


@singleton
Expand Down
10 changes: 5 additions & 5 deletions agentops/llms/groq.py → agentops/llms/providers/groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from typing import Optional

from .instrumented_provider import InstrumentedProvider
from ..event import ErrorEvent, LLMEvent
from ..session import Session
from ..log_config import logger
from agentops.helpers import get_ISO_time, check_call_stack_for_agent_id
from ..singleton import singleton
from ...event import ErrorEvent, LLMEvent
from ...session import Session
from ...log_config import logger
from ...helpers import get_ISO_time, check_call_stack_for_agent_id
from ...singleton import singleton


@singleton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from abc import ABC, abstractmethod
from typing import Optional

from ..session import Session
from ..event import LLMEvent
from ...session import Session
from ...event import LLMEvent


class InstrumentedProvider(ABC):
Expand Down
14 changes: 7 additions & 7 deletions agentops/llms/litellm.py → agentops/llms/providers/litellm.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import pprint
from typing import Optional

from ..log_config import logger
from ..event import LLMEvent, ErrorEvent
from ..session import Session
from agentops.helpers import get_ISO_time, check_call_stack_for_agent_id
from agentops.llms.instrumented_provider import InstrumentedProvider
from agentops.time_travel import fetch_completion_override_from_time_travel_cache
from ..singleton import singleton
from ...log_config import logger
from ...event import LLMEvent, ErrorEvent
from ...session import Session
from ...helpers import get_ISO_time, check_call_stack_for_agent_id
from ...llms.providers.instrumented_provider import InstrumentedProvider
from ...time_travel import fetch_completion_override_from_time_travel_cache
from ...singleton import singleton


@singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import sys
from typing import Optional

from ..event import LLMEvent, ErrorEvent
from ..session import Session
from ..log_config import logger
from agentops.helpers import get_ISO_time, check_call_stack_for_agent_id
from ...event import LLMEvent, ErrorEvent
from ...session import Session
from ...log_config import logger
from ...helpers import get_ISO_time, check_call_stack_for_agent_id
from .instrumented_provider import InstrumentedProvider


Expand Down
8 changes: 4 additions & 4 deletions agentops/llms/ollama.py → agentops/llms/providers/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import sys
from typing import Optional

from ..event import LLMEvent
from ..session import Session
from agentops.helpers import get_ISO_time, check_call_stack_for_agent_id
from ...event import LLMEvent
from ...session import Session
from ...helpers import get_ISO_time, check_call_stack_for_agent_id
from .instrumented_provider import InstrumentedProvider
from ..singleton import singleton
from ...singleton import singleton

original_func = {}

Expand Down
16 changes: 8 additions & 8 deletions agentops/llms/openai.py → agentops/llms/providers/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import pprint
from typing import Optional

from agentops.llms.instrumented_provider import InstrumentedProvider
from agentops.time_travel import fetch_completion_override_from_time_travel_cache

from ..event import ActionEvent, ErrorEvent, LLMEvent
from ..session import Session
from ..log_config import logger
from ..helpers import check_call_stack_for_agent_id, get_ISO_time
from ..singleton import singleton
from ...llms.providers.instrumented_provider import InstrumentedProvider
from ...time_travel import fetch_completion_override_from_time_travel_cache

from ...event import ActionEvent, ErrorEvent, LLMEvent
from ...session import Session
from ...log_config import logger
from ...helpers import check_call_stack_for_agent_id, get_ISO_time
from ...singleton import singleton


@singleton
Expand Down
17 changes: 8 additions & 9 deletions agentops/llms/__init__.py → agentops/llms/tracker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import functools
import sys
from importlib import import_module
from importlib.metadata import version
Expand All @@ -7,14 +6,14 @@

from ..log_config import logger

from .cohere import CohereProvider
from .groq import GroqProvider
from .litellm import LiteLLMProvider
from .ollama import OllamaProvider
from .openai import OpenAiProvider
from .anthropic import AnthropicProvider
from .mistral import MistralProvider
from .ai21 import AI21Provider
from .providers.cohere import CohereProvider
from .providers.groq import GroqProvider
from .providers.litellm import LiteLLMProvider
from .providers.ollama import OllamaProvider
from .providers.openai import OpenAiProvider
from .providers.anthropic import AnthropicProvider
from .providers.mistral import MistralProvider
from .providers.ai21 import AI21Provider

teocns marked this conversation as resolved.
Show resolved Hide resolved
original_func = {}
original_create = None
Expand Down
2 changes: 1 addition & 1 deletion agentops/partners/autogen_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from autogen.logger.base_logger import BaseLogger, LLMConfig

from agentops.enums import EndState
from agentops.helpers import get_ISO_time
from ..helpers import get_ISO_time

from agentops import LLMEvent, ToolEvent, ActionEvent
from uuid import uuid4
Expand Down
10 changes: 5 additions & 5 deletions agentops/partners/langchain_callback_handler.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from typing import Dict, Any, List, Optional, Sequence, Union
from collections import defaultdict
from uuid import UUID
import logging
import os

from tenacity import RetryCallState

from langchain_core.agents import AgentFinish, AgentAction
from langchain_core.documents import Document
from langchain_core.outputs import ChatGenerationChunk, GenerationChunk, LLMResult
from langchain.callbacks.base import BaseCallbackHandler, AsyncCallbackHandler
from langchain_core.messages import BaseMessage

from tenacity import RetryCallState

from agentops import Client as AOClient
from agentops import ActionEvent, LLMEvent, ToolEvent, ErrorEvent
from agentops.helpers import get_ISO_time
from ..helpers import get_ISO_time, debug_print_function_params

from ..helpers import debug_print_function_params
import os
from ..log_config import logger
import logging


def get_model_from_kwargs(kwargs: any) -> str:
Expand Down
20 changes: 2 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "agentops"
version = "0.3.19"
version = "0.3.20rc8"
authors = [
{ name="Alex Reibman", email="[email protected]" },
{ name="Shawn Qiu", email="[email protected]" },
Expand Down Expand Up @@ -34,22 +34,6 @@ dependencies = [
langchain = [
"langchain==0.2.14; python_version >= '3.8.1'"
]


[dependency-groups]
dev = [
"pytest==7.4.0",
"pytest-depends",
"pytest-asyncio",
"pytest-vcr",
"pytest-mock",
"pyfakefs",
"requests_mock==1.11.0",
"ruff",
"vcrpy>=6.0.0; python_version >= '3.8'"
areibman marked this conversation as resolved.
Show resolved Hide resolved
]


ci = [
"tach~=0.9",
]
Expand Down Expand Up @@ -122,4 +106,4 @@ exclude = [
]

[tool.setuptools]
packages = ["agentops"]
packages = ["agentops", "agentops.llms", "agentops.llms.providers"]
Loading