diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 61d121ffc..e74207421 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -4,6 +4,17 @@ model_list: model: openai/fake api_key: fake-key api_base: https://exampleopenaiendpoint-production.up.railway.app/ + +litellm_settings: + default_team_settings: + - team_id: team-1 + success_callback: ["langfuse"] + langfuse_public_key: os.environ/LANGFUSE_PROJECT1_PUBLIC # Project 1 + langfuse_secret: os.environ/LANGFUSE_PROJECT1_SECRET # Project 1 + - team_id: team-2 + success_callback: ["langfuse"] + langfuse_public_key: os.environ/LANGFUSE_PROJECT2_PUBLIC # Project 2 + langfuse_secret: os.environ/LANGFUSE_PROJECT2_SECRET # Project 2 general_settings: store_model_in_db: true master_key: sk-1234 \ No newline at end of file diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index c46b350f8..f39d5becb 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1896,7 +1896,12 @@ class ProxyConfig: param_name = getattr(response, "param_name", None) param_value = getattr(response, "param_value", None) if param_name is not None and param_value is not None: - config[param_name] = param_value + # check if param_name is already in the config + if param_name in config: + if isinstance(config[param_name], dict): + config[param_name].update(param_value) + else: + config[param_name] = param_value return config diff --git a/proxy_server_config.yaml b/proxy_server_config.yaml index fa8c7fff7..f76b79501 100644 --- a/proxy_server_config.yaml +++ b/proxy_server_config.yaml @@ -66,6 +66,15 @@ litellm_settings: request_timeout: 600 telemetry: False context_window_fallbacks: [{"gpt-3.5-turbo": ["gpt-3.5-turbo-large"]}] + default_team_settings: + - team_id: team-1 + success_callback: ["langfuse"] + langfuse_public_key: os.environ/LANGFUSE_PROJECT1_PUBLIC # Project 1 + langfuse_secret: os.environ/LANGFUSE_PROJECT1_SECRET # Project 1 + - team_id: team-2 + success_callback: ["langfuse"] + langfuse_public_key: os.environ/LANGFUSE_PROJECT2_PUBLIC # Project 2 + langfuse_secret: os.environ/LANGFUSE_PROJECT2_SECRET # Project 2 router_settings: routing_strategy: usage-based-routing-v2 diff --git a/tests/test_team_logging.py b/tests/test_team_logging.py index a6c8fa015..d745a8d77 100644 --- a/tests/test_team_logging.py +++ b/tests/test_team_logging.py @@ -7,6 +7,7 @@ import aiohttp import os import dotenv from dotenv import load_dotenv +import pytest load_dotenv() @@ -103,9 +104,9 @@ async def test_team_logging(): generations = langfuse_client.get_generations(trace_id=_trace_id).data print(generations) - assert len(generations) == 2 + assert len(generations) == 1 except Exception as e: - print(e) + pytest.fail(f"Unexpected error: {str(e)}") @pytest.mark.asyncio @@ -169,4 +170,4 @@ async def test_team_2logging(): assert len(generations_team_1) == 0 except Exception as e: - print(e) + pytest.fail("Team 2 logging failed: " + str(e))