remove useless tests

This commit is contained in:
ishaan-jaff 2023-08-02 21:08:01 -07:00
parent 728c5956b3
commit 13e800493c
2 changed files with 47 additions and 45 deletions

View file

@ -1,25 +1,27 @@
# #### What this tests ####
# # This tests the ability to set api key's via the params instead of as environment variables
#### What this tests ####
# This tests the ability to set api key's via the params instead of as environment variables
# import sys, os
# import traceback
# sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path
# import litellm
# from litellm import embedding, completion
import sys, os
import traceback
sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path
import litellm
from litellm import embedding, completion
# litellm.set_verbose = False
litellm.set_verbose = False
# def logger_fn(model_call_object: dict):
# print(f"model call details: {model_call_object}")
def logger_fn(model_call_object: dict):
print(f"model call details: {model_call_object}")
# user_message = "Hello, how are you?"
# messages = [{ "content": user_message,"role": "user"}]
user_message = "Hello, how are you?"
messages = [{ "content": user_message,"role": "user"}]
# temp_key = os.environ.get("OPENAI_API_KEY")
# os.environ["OPENAI_API_KEY"] = "bad-key"
# # test on openai completion call
# try:
# response = completion(model="gpt-3.5-turbo", messages=messages, logger_fn=logger_fn, api_key=temp_key)
# except:
# print(f"error occurred: {traceback.format_exc()}")
# pass
temp_key = os.environ.get("OPENAI_API_KEY")
os.environ["OPENAI_API_KEY"] = "bad-key"
# test on openai completion call
try:
response = completion(model="gpt-3.5-turbo", messages=messages, logger_fn=logger_fn, api_key=temp_key)
except:
print(f"error occurred: {traceback.format_exc()}")
pass
os.environ["OPENAI_API_KEY"] = temp_key