From 92b56de2dbd92bbb0f88c89aba8a64cf3071361c Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 18 Oct 2023 12:00:30 -0700 Subject: [PATCH] (test) langsmith logger with metadata --- litellm/tests/test_langsmith.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/litellm/tests/test_langsmith.py b/litellm/tests/test_langsmith.py index 6ea9d95cf96..a99ee3a32fc 100644 --- a/litellm/tests/test_langsmith.py +++ b/litellm/tests/test_langsmith.py @@ -17,7 +17,7 @@ def test_langsmith_logging(): response = completion(model="claude-instant-1.2", messages=[{ "role": "user", - "content": "Hi 👋 - i'm claude" + "content": "what llm are u" }], max_tokens=10, temperature=0.2 @@ -27,3 +27,24 @@ def test_langsmith_logging(): print(e) test_langsmith_logging() + + +def test_langsmith_logging_with_metadata(): + try: + response = completion(model="gpt-3.5-turbo", + messages=[{ + "role": "user", + "content": "what llm are u" + }], + max_tokens=10, + temperature=0.2, + metadata={ + "run_name": "litellmRUN", + "project_name": "litellm-completion", + } + ) + print(response) + except Exception as e: + print(e) + +test_langsmith_logging_with_metadata()