From 5e9d024c2cf8269c4e70bc44226230f462f1b502 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 28 May 2024 17:29:13 -0700 Subject: [PATCH] fix - test openai batches --- litellm/tests/test_openai_batches.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/litellm/tests/test_openai_batches.py b/litellm/tests/test_openai_batches.py index 2bf0090128..fc29331a5a 100644 --- a/litellm/tests/test_openai_batches.py +++ b/litellm/tests/test_openai_batches.py @@ -24,8 +24,12 @@ def test_create_batch(): 2. Create Batch Request 3. Retrieve the specific batch """ + file_name = "openai_batch_completions.jsonl" + _current_dir = os.path.dirname(os.path.abspath(__file__)) + file_path = os.path.join(_current_dir, file_name) + file_obj = litellm.create_file( - file=open("openai_batch_completions.jsonl", "rb"), + file=open(file_path, "rb"), purpose="batch", custom_llm_provider="openai", ) @@ -77,8 +81,12 @@ async def test_async_create_batch(): 3. Retrieve the specific batch """ print("Testing async create batch") + + file_name = "openai_batch_completions.jsonl" + _current_dir = os.path.dirname(os.path.abspath(__file__)) + file_path = os.path.join(_current_dir, file_name) file_obj = await litellm.acreate_file( - file=open("openai_batch_completions.jsonl", "rb"), + file=open(file_path, "rb"), purpose="batch", custom_llm_provider="openai", )