From 9f24b7d43f60eb29afa5bc31e0c27b2b2693c16b Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Tue, 13 Aug 2024 15:23:59 -0700 Subject: [PATCH] remove support for openai v0 --- agentops/llms/__init__.py | 46 +------- agentops/llms/openai_v0.py | 234 ------------------------------------- 2 files changed, 4 insertions(+), 276 deletions(-) delete mode 100644 agentops/llms/openai_v0.py diff --git a/agentops/llms/__init__.py b/agentops/llms/__init__.py index 229cd51d..fa7df2c9 100644 --- a/agentops/llms/__init__.py +++ b/agentops/llms/__init__.py @@ -43,43 +43,6 @@ def __init__(self, client): self.client = client self.completion = "" - # def _override_openai_v0_method(self, api, method_path, module): - # def handle_response(result, kwargs, init_timestamp): - # if api == "openai": - # return handle_response_v0_openai(self, result, kwargs, init_timestamp) - # return result - # - # def wrap_method(original_method): - # if inspect.iscoroutinefunction(original_method): - # - # @functools.wraps(original_method) - # async def async_method(*args, **kwargs): - # init_timestamp = get_ISO_time() - # response = await original_method(*args, **kwargs) - # return handle_response(response, kwargs, init_timestamp) - # - # return async_method - # - # else: - # - # @functools.wraps(original_method) - # def sync_method(*args, **kwargs): - # init_timestamp = get_ISO_time() - # response = original_method(*args, **kwargs) - # return handle_response(response, kwargs, init_timestamp) - # - # return sync_method - # - # method_parts = method_path.split(".") - # original_method = functools.reduce(getattr, method_parts, module) - # new_method = wrap_method(original_method) - # - # if len(method_parts) == 1: - # setattr(module, method_parts[0], new_method) - # else: - # parent = functools.reduce(getattr, method_parts[:-1], module) - # setattr(parent, method_parts[-1], new_method) - def override_api(self): """ Overrides key methods of the specified API to record events. @@ -112,11 +75,10 @@ def override_api(self): provider = OpenAiProvider(self.client) provider.override() else: - # Patch openai dict: - """Handle responses for OpenAI versions