test(test_batch_completion.py): cleanup tests

This commit is contained in:
Krrish Dholakia 2023-10-24 15:09:51 -07:00
parent 3ec103f712
commit cb100d19da
2 changed files with 2 additions and 27 deletions

View file

@ -63,30 +63,3 @@ def test_batch_completion_models_all_responses():
# pytest.fail(f"An error occurred: {e}")
# test_batch_completions()
def test_rate_limit_handler():
import asyncio
##### USAGE ################
jobs = [
{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}]},
{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}]},
]
from litellm import RateLimitManager
handler = RateLimitManager(
max_requests_per_minute = 60,
max_tokens_per_minute = 20000
)
try:
asyncio.run(
handler.batch_completion(
jobs = jobs,
api_key=os.environ['OPENAI_API_KEY'],
)
)
except Exception as e:
print(e)