diff --git a/docs/my-website/docs/proxy/streaming_logging.md b/docs/my-website/docs/proxy/streaming_logging.md index 3fa89646720..eb248424d9e 100644 --- a/docs/my-website/docs/proxy/streaming_logging.md +++ b/docs/my-website/docs/proxy/streaming_logging.md @@ -8,6 +8,7 @@ Define your custom callback class in a python file. ```python from litellm.integrations.custom_logger import CustomLogger import litellm +import logging # This file includes the custom callbacks for LiteLLM Proxy # Once defined, these can be passed in proxy_config.yaml @@ -25,9 +26,9 @@ class MyCustomHandler(CustomLogger): datefmt='%Y-%m-%d %H:%M:%S' ) - response_cost = litellm.completion_cost(completion_response=completion_response) + response_cost = litellm.completion_cost(completion_response=response_obj) print("regular response_cost", response_cost) - logging.info(f"Model {completion_response.model} Cost: ${response_cost:.8f}") + logging.info(f"Model {response_obj.model} Cost: ${response_cost:.8f}") except: pass @@ -78,4 +79,4 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ "user": "ishaan-app", "temperature": 0.2 }' -``` \ No newline at end of file +```