(test) promptlayer logger

This commit is contained in:
ishaan-jaff 2023-11-02 08:17:59 -07:00
parent 5bf42d9be8
commit 82e93db774

View file

@ -46,12 +46,13 @@ def test_promptlayer_logging_with_metadata():
old_stdout = sys.stdout old_stdout = sys.stdout
sys.stdout = new_stdout = io.StringIO() sys.stdout = new_stdout = io.StringIO()
response = completion(model="gpt-3.5-turbo",
response = completion(model="j2-light",
messages=[{ messages=[{
"role": "user", "role": "user",
"content": "Hi 👋 - i'm ai21" "content": "Hi 👋 - i'm ai21"
}], }],
temperature=0.2,
max_tokens=20,
metadata={"model": "ai21"}) metadata={"model": "ai21"})
# Restore stdout # Restore stdout
@ -65,7 +66,7 @@ def test_promptlayer_logging_with_metadata():
except Exception as e: except Exception as e:
print(e) print(e)
# test_promptlayer_logging_with_metadata() test_promptlayer_logging_with_metadata()