diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py index afe8be28f5..81db798ae8 100644 --- a/litellm/integrations/langsmith.py +++ b/litellm/integrations/langsmith.py @@ -8,6 +8,7 @@ from datetime import datetime from typing import Any, List, Optional, Union import dotenv # type: ignore +import httpx import requests # type: ignore from pydantic import BaseModel # type: ignore @@ -59,7 +60,9 @@ class LangsmithLogger(CustomLogger): self.langsmith_base_url = os.getenv( "LANGSMITH_BASE_URL", "https://api.smith.langchain.com" ) - self.async_httpx_client = AsyncHTTPHandler() + self.async_httpx_client = AsyncHTTPHandler( + timeout=httpx.Timeout(timeout=600.0, connect=5.0) + ) def _prepare_log_data(self, kwargs, response_obj, start_time, end_time): import datetime diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 2fc6a5771d..8803940fbb 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -1820,26 +1820,6 @@ "supports_vision": true, "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" }, - "medlm-medium": { - "max_tokens": 8192, - "max_input_tokens": 32768, - "max_output_tokens": 8192, - "input_cost_per_character": 0.0000005, - "output_cost_per_character": 0.000001, - "litellm_provider": "vertex_ai-language-models", - "mode": "chat", - "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" - }, - "medlm-large": { - "max_tokens": 1024, - "max_input_tokens": 8192, - "max_output_tokens": 1024, - "input_cost_per_character": 0.000005, - "output_cost_per_character": 0.000015, - "litellm_provider": "vertex_ai-language-models", - "mode": "chat", - "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" - }, "vertex_ai/claude-3-sonnet@20240229": { "max_tokens": 4096, "max_input_tokens": 200000, diff --git a/litellm/tests/test_langsmith.py b/litellm/tests/test_langsmith.py index f69c964a13..96fdbc2a4a 100644 --- a/litellm/tests/test_langsmith.py +++ b/litellm/tests/test_langsmith.py @@ -20,13 +20,11 @@ verbose_logger.setLevel(logging.DEBUG) litellm.set_verbose = True import time -test_langsmith_logger = LangsmithLogger() - @pytest.mark.asyncio() -async def test_langsmith_logging(): +async def test_async_langsmith_logging(): try: - + test_langsmith_logger = LangsmithLogger() run_id = str(uuid.uuid4()) litellm.set_verbose = True litellm.callbacks = ["langsmith"] @@ -84,7 +82,7 @@ async def test_langsmith_logging(): # test_langsmith_logging() -def test_langsmith_logging_with_metadata(): +def test_async_langsmith_logging_with_metadata(): try: litellm.success_callback = ["langsmith"] litellm.set_verbose = True @@ -104,8 +102,9 @@ def test_langsmith_logging_with_metadata(): @pytest.mark.parametrize("sync_mode", [False, True]) @pytest.mark.asyncio -async def test_langsmith_logging_with_streaming_and_metadata(sync_mode): +async def test_async_langsmith_logging_with_streaming_and_metadata(sync_mode): try: + test_langsmith_logger = LangsmithLogger() litellm.success_callback = ["langsmith"] litellm.set_verbose = True run_id = str(uuid.uuid4())