From 3edcf8c7d8f154a40c8e99832c7c9b17bfc5ab48 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 8 Aug 2023 10:58:43 -0700 Subject: [PATCH] remove deps datalib, pytest, tenacity, infisical --- .circleci/config.yml | 2 ++ litellm/__init__.py | 2 +- litellm/main.py | 5 ----- litellm/tests/test_embedding.py | 20 ++++++++++++++++++++ pyproject.toml | 4 ---- requirements.txt | 7 ++----- 6 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 litellm/tests/test_embedding.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 20260abce..edefc4b7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,8 @@ jobs: command: | python -m pip install --upgrade pip python -m pip install -r requirements.txt + pip install infisical + pip install pytest # Run pytest and generate JUnit XML report - run: diff --git a/litellm/__init__.py b/litellm/__init__.py index 937b22c14..aaa36737e 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -4,7 +4,7 @@ failure_callback = [] set_verbose=False telemetry=True max_tokens = 256 # OpenAI Defaults -retry = True # control tenacity retries. +retry = True openai_key = None azure_key = None anthropic_key = None diff --git a/litellm/main.py b/litellm/main.py index 33f7676d3..299376458 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -7,11 +7,6 @@ import litellm from litellm import client, logging, exception_type, timeout, get_optional_params import tiktoken encoding = tiktoken.get_encoding("cl100k_base") -from tenacity import ( - retry, - stop_after_attempt, - wait_random_exponential, -) # for exponential backoff from litellm.utils import get_secret, install_and_import ####### ENVIRONMENT VARIABLES ################### dotenv.load_dotenv() # Loading env variables using dotenv diff --git a/litellm/tests/test_embedding.py b/litellm/tests/test_embedding.py new file mode 100644 index 000000000..be2b30a81 --- /dev/null +++ b/litellm/tests/test_embedding.py @@ -0,0 +1,20 @@ + +import sys, os +import traceback +import pytest + +sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path +import litellm +from litellm import embedding, completion +from infisical import InfisicalClient + +# litellm.set_verbose = True +litellm.secret_manager_client = InfisicalClient(token=os.environ["INFISICAL_TOKEN"]) + +def test_openai_embedding(): + try: + response = embedding(model='text-embedding-ada-002', input=["good morning from litellm"]) + # Add any assertions here to check the response + print(f"response: {str(response)}") + except Exception as e: + pytest.fail(f"Error occurred: {e}") diff --git a/pyproject.toml b/pyproject.toml index 20916e782..d75e1762d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,12 +9,8 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.8" openai = "^0.27.8" - pytest = "^7.4.0" - - python-dotenv = "^1.0.0" -tenacity = "^8.0.1" tiktoken = "^0.4.0" [build-system] diff --git a/requirements.txt b/requirements.txt index ba5e487e3..56f796b35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,5 @@ # used by CI/CD testing openai -pytest python-dotenv -openai[datalib] -tenacity -tiktoken -infisical \ No newline at end of file +openai +tiktoken \ No newline at end of file