(fix) proxy server use set_callbacks & load dotenv

This commit is contained in:
ishaan-jaff 2023-10-23 14:52:20 -07:00
parent e9ac3ca130
commit 5733b10f04
3 changed files with 13 additions and 4 deletions

7
openai-proxy/utils.py Normal file
View file

@ -0,0 +1,7 @@
import os, litellm
import dotenv
dotenv.load_dotenv() # load env variables
def set_callbacks():
if ("LANGUFSE_PUBLIC_KEY" in os.environ and "LANGUFSE_SECRET_KEY" in os.environ) or "LANGFUSE_HOST" in os.environ:
litellm.success_callback = ["langfuse"]