forked from phoenix/litellm-mirror
remove deps datalib, pytest, tenacity, infisical
This commit is contained in:
parent
a4bebe6815
commit
3edcf8c7d8
6 changed files with 25 additions and 15 deletions
|
@ -13,6 +13,8 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
pip install infisical
|
||||||
|
pip install pytest
|
||||||
|
|
||||||
# Run pytest and generate JUnit XML report
|
# Run pytest and generate JUnit XML report
|
||||||
- run:
|
- run:
|
||||||
|
|
|
@ -4,7 +4,7 @@ failure_callback = []
|
||||||
set_verbose=False
|
set_verbose=False
|
||||||
telemetry=True
|
telemetry=True
|
||||||
max_tokens = 256 # OpenAI Defaults
|
max_tokens = 256 # OpenAI Defaults
|
||||||
retry = True # control tenacity retries.
|
retry = True
|
||||||
openai_key = None
|
openai_key = None
|
||||||
azure_key = None
|
azure_key = None
|
||||||
anthropic_key = None
|
anthropic_key = None
|
||||||
|
|
|
@ -7,11 +7,6 @@ import litellm
|
||||||
from litellm import client, logging, exception_type, timeout, get_optional_params
|
from litellm import client, logging, exception_type, timeout, get_optional_params
|
||||||
import tiktoken
|
import tiktoken
|
||||||
encoding = tiktoken.get_encoding("cl100k_base")
|
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
|
from litellm.utils import get_secret, install_and_import
|
||||||
####### ENVIRONMENT VARIABLES ###################
|
####### ENVIRONMENT VARIABLES ###################
|
||||||
dotenv.load_dotenv() # Loading env variables using dotenv
|
dotenv.load_dotenv() # Loading env variables using dotenv
|
||||||
|
|
20
litellm/tests/test_embedding.py
Normal file
20
litellm/tests/test_embedding.py
Normal file
|
@ -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}")
|
|
@ -9,12 +9,8 @@ readme = "README.md"
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.8"
|
||||||
openai = "^0.27.8"
|
openai = "^0.27.8"
|
||||||
|
|
||||||
pytest = "^7.4.0"
|
pytest = "^7.4.0"
|
||||||
|
|
||||||
|
|
||||||
python-dotenv = "^1.0.0"
|
python-dotenv = "^1.0.0"
|
||||||
tenacity = "^8.0.1"
|
|
||||||
tiktoken = "^0.4.0"
|
tiktoken = "^0.4.0"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
# used by CI/CD testing
|
# used by CI/CD testing
|
||||||
openai
|
openai
|
||||||
pytest
|
|
||||||
python-dotenv
|
python-dotenv
|
||||||
openai[datalib]
|
openai
|
||||||
tenacity
|
|
||||||
tiktoken
|
tiktoken
|
||||||
infisical
|
|
Loading…
Add table
Add a link
Reference in a new issue