From 01aa8941a53ad1862450792eff97edac8d44b6f4 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 6 Dec 2023 10:08:36 -0800 Subject: [PATCH] (test) OTEL / traceloop - waiting for async support --- litellm/tests/test_traceloop.py | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 litellm/tests/test_traceloop.py diff --git a/litellm/tests/test_traceloop.py b/litellm/tests/test_traceloop.py new file mode 100644 index 00000000000..c03fdcd4331 --- /dev/null +++ b/litellm/tests/test_traceloop.py @@ -0,0 +1,49 @@ +# Commented out for now - since traceloop break ci/cd +# import sys +# import os +# import io, asyncio + +# sys.path.insert(0, os.path.abspath('../..')) + +# from litellm import completion +# import litellm +# litellm.num_retries = 3 +# litellm.success_callback = [""] +# import time +# import pytest +# from traceloop.sdk import Traceloop +# Traceloop.init(app_name="test-litellm", disable_batch=True) + + +# def test_traceloop_logging(): +# try: +# litellm.set_verbose = True +# response = litellm.completion( +# model="gpt-3.5-turbo", +# messages=[{"role": "user", "content":"This is a test"}], +# max_tokens=1000, +# temperature=0.7, +# timeout=5, +# ) +# print(f"response: {response}") +# except Exception as e: +# pytest.fail(f"An exception occurred - {e}") +# # test_traceloop_logging() + + +# # def test_traceloop_logging_async(): +# # try: +# # litellm.set_verbose = True +# # async def test_acompletion(): +# # return await litellm.acompletion( +# # model="gpt-3.5-turbo", +# # messages=[{"role": "user", "content":"This is a test"}], +# # max_tokens=1000, +# # temperature=0.7, +# # timeout=5, +# # ) +# # response = asyncio.run(test_acompletion()) +# # print(f"response: {response}") +# # except Exception as e: +# # pytest.fail(f"An exception occurred - {e}") +# # test_traceloop_logging_async()