From 6b14c8d2de713e6074416a6d57e95802f131bc71 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 16 Nov 2023 10:44:25 -0800 Subject: [PATCH] (test) langfuse logger --- litellm/tests/test_langfuse.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/litellm/tests/test_langfuse.py b/litellm/tests/test_langfuse.py index 67bd28a0f89..115c54c9d15 100644 --- a/litellm/tests/test_langfuse.py +++ b/litellm/tests/test_langfuse.py @@ -24,7 +24,7 @@ def test_langfuse_logging_async(): response = asyncio.run(_test_langfuse()) print(f"response: {response}") -test_langfuse_logging_async() +# test_langfuse_logging_async() def test_langfuse_logging(): try: @@ -42,6 +42,28 @@ def test_langfuse_logging(): # test_langfuse_logging() + +def test_langfuse_logging_stream(): + try: + litellm.set_verbose=True + response = completion(model="anyscale/meta-llama/Llama-2-7b-chat-hf", + messages=[{ + "role": "user", + "content": "this is a streaming test for llama2 + langfuse" + }], + max_tokens=20, + temperature=0.2, + stream=True + ) + print(response) + for chunk in response: + pass + # print(chunk) + except Exception as e: + print(e) + +# test_langfuse_logging_stream() + def test_langfuse_logging_custom_generation_name(): try: response = completion(model="gpt-3.5-turbo",