From 5a9001f04c592b063f016d2bb854416255ec6cdf Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 28 Apr 2025 15:29:02 -0700 Subject: [PATCH] test_moderations_api_logging --- .../test_moderations_api_logging.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/logging_callback_tests/test_moderations_api_logging.py b/tests/logging_callback_tests/test_moderations_api_logging.py index dd758315b1a..129e802763b 100644 --- a/tests/logging_callback_tests/test_moderations_api_logging.py +++ b/tests/logging_callback_tests/test_moderations_api_logging.py @@ -13,8 +13,6 @@ import os import time import json -# this file is to test litellm/proxy - sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path @@ -53,9 +51,9 @@ async def test_moderations_api_logging(model): custom_logger = TestCustomLogger() litellm.logging_callback_manager.add_litellm_callback(custom_logger) - + input_content = "Hello, how are you?" response = await litellm.amoderation( - input="Hello, how are you?", + input=input_content, model=model, ) @@ -72,6 +70,9 @@ async def test_moderations_api_logging(model): assert standard_logging_payload["custom_llm_provider"] == litellm.LlmProviders.OPENAI.value + # assert the logged input == input + assert standard_logging_payload["messages"][0]["content"] == input_content + # assert the logged response == response user received client side assert dict(standard_logging_payload["response"]) == response.model_dump()