From 22e75e780f4e3fe84eff208cd12f2bb43e6c4a21 Mon Sep 17 00:00:00 2001 From: nicolas Date: Fri, 29 Aug 2025 06:42:34 -0300 Subject: [PATCH 1/6] Add tool_calls in AIMessage (#1314) --- langfuse/langchain/CallbackHandler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/langfuse/langchain/CallbackHandler.py b/langfuse/langchain/CallbackHandler.py index a1bf51bd7..c304b9dcd 100644 --- a/langfuse/langchain/CallbackHandler.py +++ b/langfuse/langchain/CallbackHandler.py @@ -912,6 +912,13 @@ def _convert_message_to_dict(self, message: BaseMessage) -> Dict[str, Any]: message_dict = {"role": "user", "content": message.content} elif isinstance(message, AIMessage): message_dict = {"role": "assistant", "content": message.content} + + if ( + hasattr(message, "tool_calls") + and message.tool_calls is not None + and len(message.tool_calls) > 0 + ): + message_dict["tool_calls"] = message.tool_calls elif isinstance(message, SystemMessage): message_dict = {"role": "system", "content": message.content} elif isinstance(message, ToolMessage): From abea0fa41ba68aa244d4dc1a26be50b618f021ef Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:48:11 +0200 Subject: [PATCH 2/6] push --- langfuse/_client/client.py | 39 +++++++++++++-------------- langfuse/_utils/prompt_cache.py | 10 ++++--- langfuse/langchain/CallbackHandler.py | 3 ++- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/langfuse/_client/client.py b/langfuse/_client/client.py index 5655dd7ce..df243e51c 100644 --- a/langfuse/_client/client.py +++ b/langfuse/_client/client.py @@ -5,9 +5,9 @@ import logging import os -import warnings import re import urllib.parse +import warnings from datetime import datetime from hashlib import sha256 from time import time_ns @@ -17,8 +17,8 @@ List, Literal, Optional, - Union, Type, + Union, cast, overload, ) @@ -36,6 +36,13 @@ from packaging.version import Version from langfuse._client.attributes import LangfuseOtelSpanAttributes +from langfuse._client.constants import ( + ObservationTypeGenerationLike, + ObservationTypeLiteral, + ObservationTypeLiteralNoEvent, + ObservationTypeSpanLike, + get_observation_types_list, +) from langfuse._client.datasets import DatasetClient, DatasetItemClient from langfuse._client.environment_variables import ( LANGFUSE_DEBUG, @@ -47,25 +54,18 @@ LANGFUSE_TRACING_ENABLED, LANGFUSE_TRACING_ENVIRONMENT, ) -from langfuse._client.constants import ( - ObservationTypeLiteral, - ObservationTypeLiteralNoEvent, - ObservationTypeGenerationLike, - ObservationTypeSpanLike, - get_observation_types_list, -) from langfuse._client.resource_manager import LangfuseResourceManager from langfuse._client.span import ( - LangfuseEvent, - LangfuseGeneration, - LangfuseSpan, LangfuseAgent, - LangfuseTool, LangfuseChain, - LangfuseRetriever, - LangfuseEvaluator, LangfuseEmbedding, + LangfuseEvaluator, + LangfuseEvent, + LangfuseGeneration, LangfuseGuardrail, + LangfuseRetriever, + LangfuseSpan, + LangfuseTool, ) from langfuse._utils import _get_timestamp from langfuse._utils.parse_error import handle_fern_exception @@ -2996,11 +2996,10 @@ def _url_encode(self, url: str, *, is_url_param: Optional[bool] = False) -> str: # we need add safe="" to force escaping of slashes # This is necessary for prompts in prompt folders return urllib.parse.quote(url, safe="") - - def clear_prompt_cache(self): - """ - Clear the entire prompt cache, removing all cached prompts. - + + def clear_prompt_cache(self) -> None: + """Clear the entire prompt cache, removing all cached prompts. + This method is useful when you want to force a complete refresh of all cached prompts, for example after major updates or when you need to ensure the latest versions are fetched from the server. diff --git a/langfuse/_utils/prompt_cache.py b/langfuse/_utils/prompt_cache.py index acca515cc..919333b6b 100644 --- a/langfuse/_utils/prompt_cache.py +++ b/langfuse/_utils/prompt_cache.py @@ -2,18 +2,20 @@ import atexit import logging +import os from datetime import datetime from queue import Empty, Queue from threading import Thread from typing import Callable, Dict, List, Optional, Set -import os -from langfuse.model import PromptClient from langfuse._client.environment_variables import ( - LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS + LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS, ) +from langfuse.model import PromptClient -DEFAULT_PROMPT_CACHE_TTL_SECONDS = int(os.getenv(LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS, 60)) +DEFAULT_PROMPT_CACHE_TTL_SECONDS = int( + os.getenv(LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS, 60) +) DEFAULT_PROMPT_CACHE_REFRESH_WORKERS = 1 diff --git a/langfuse/langchain/CallbackHandler.py b/langfuse/langchain/CallbackHandler.py index 2dd7e6c9c..20bfa2534 100644 --- a/langfuse/langchain/CallbackHandler.py +++ b/langfuse/langchain/CallbackHandler.py @@ -939,7 +939,7 @@ def __join_tags_and_metadata( def _convert_message_to_dict(self, message: BaseMessage) -> Dict[str, Any]: # assistant message if isinstance(message, HumanMessage): - message_dict = {"role": "user", "content": message.content} + message_dict: Dict[str, Any] = {"role": "user", "content": message.content} elif isinstance(message, AIMessage): message_dict = {"role": "assistant", "content": message.content} @@ -949,6 +949,7 @@ def _convert_message_to_dict(self, message: BaseMessage) -> Dict[str, Any]: and len(message.tool_calls) > 0 ): message_dict["tool_calls"] = message.tool_calls + elif isinstance(message, SystemMessage): message_dict = {"role": "system", "content": message.content} elif isinstance(message, ToolMessage): From 208b33c8b02cfa6e82c743792f892d5f0c38019f Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:54:38 +0200 Subject: [PATCH 3/6] push --- tests/test_prompt.py | 116 +++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 60 deletions(-) diff --git a/tests/test_prompt.py b/tests/test_prompt.py index 2cff02f7b..82a287f57 100644 --- a/tests/test_prompt.py +++ b/tests/test_prompt.py @@ -1,3 +1,4 @@ +import os from time import sleep from unittest.mock import Mock, patch @@ -5,6 +6,9 @@ import pytest from langfuse._client.client import Langfuse +from langfuse._client.environment_variables import ( + LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS, +) from langfuse._utils.prompt_cache import ( DEFAULT_PROMPT_CACHE_TTL_SECONDS, PromptCacheItem, @@ -13,8 +17,6 @@ from langfuse.model import ChatPromptClient, TextPromptClient from tests.utils import create_uuid, get_api -import os -from langfuse._client.environment_variables import LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS def test_create_prompt(): langfuse = Langfuse() @@ -690,16 +692,6 @@ def langfuse(): return langfuse_instance -@pytest.fixture -def langfuse_with_override_default_cache(): - langfuse_instance = Langfuse( - public_key="test-public-key", - secret_key="test-secret-key", - host="https://mock-host.com", - default_cache_ttl_seconds=OVERRIDE_DEFAULT_PROMPT_CACHE_TTL_SECONDS, - ) - langfuse_instance.api = Mock() - return langfuse_instance # Fetching a new prompt when nothing in cache def test_get_fresh_prompt(langfuse): @@ -1430,12 +1422,9 @@ def test_update_prompt(): def test_environment_variable_override_prompt_cache_ttl(): """Test that LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS environment variable overrides default TTL.""" - import os - from unittest.mock import patch - # Set environment variable to override default TTL os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] = "120" - + # Create a new Langfuse instance to pick up the environment variable langfuse = Langfuse( public_key="test-public-key", @@ -1443,7 +1432,7 @@ def test_environment_variable_override_prompt_cache_ttl(): host="https://mock-host.com", ) langfuse.api = Mock() - + prompt_name = "test_env_override_ttl" prompt = Prompt_Text( name=prompt_name, @@ -1455,62 +1444,64 @@ def test_environment_variable_override_prompt_cache_ttl(): tags=[], ) prompt_client = TextPromptClient(prompt) - + mock_server_call = langfuse.api.prompts.get mock_server_call.return_value = prompt - + # Mock time to control cache expiration with patch.object(PromptCacheItem, "get_epoch_seconds") as mock_time: mock_time.return_value = 0 - + # First call - should cache the prompt result1 = langfuse.get_prompt(prompt_name) assert mock_server_call.call_count == 1 assert result1 == prompt_client - + # Check that prompt is cached cached_item = langfuse._resources.prompt_cache.get( - langfuse._resources.prompt_cache.generate_cache_key(prompt_name, version=None, label=None) + langfuse._resources.prompt_cache.generate_cache_key( + prompt_name, version=None, label=None + ) ) assert cached_item is not None assert cached_item.value == prompt_client - + # Debug: check the cache item's expiry time print(f"DEBUG: Cache item expiry: {cached_item._expiry}") print(f"DEBUG: Current mock time: {mock_time.return_value}") print(f"DEBUG: Is expired? {cached_item.is_expired()}") - + # Set time to 60 seconds (before new TTL of 120 seconds) mock_time.return_value = 60 - + # Second call - should still use cache result2 = langfuse.get_prompt(prompt_name) assert mock_server_call.call_count == 1 # No new server call assert result2 == prompt_client - + # Set time to 120 seconds (at TTL expiration) mock_time.return_value = 120 - + # Third call - should still use cache (stale cache behavior) result3 = langfuse.get_prompt(prompt_name) assert result3 == prompt_client - + # Wait for background refresh to complete while True: if langfuse._resources.prompt_cache._task_manager.active_tasks() == 0: break sleep(0.1) - + # Should have made a new server call for refresh assert mock_server_call.call_count == 2 - + # Set time to 121 seconds (after TTL expiration) mock_time.return_value = 121 - + # Fourth call - should use refreshed cache result4 = langfuse.get_prompt(prompt_name) assert result4 == prompt_client - + # Clean up environment variable if LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS in os.environ: del os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] @@ -1519,15 +1510,14 @@ def test_environment_variable_override_prompt_cache_ttl(): @patch.object(PromptCacheItem, "get_epoch_seconds") def test_default_ttl_when_environment_variable_not_set(mock_time): """Test that default 60-second TTL is used when LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS is not set.""" - from unittest.mock import patch - + # Ensure environment variable is not set if LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS in os.environ: del os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] - + # Set initial time to 0 mock_time.return_value = 0 - + # Create a new Langfuse instance to pick up the default TTL langfuse = Langfuse( public_key="test-public-key", @@ -1535,7 +1525,7 @@ def test_default_ttl_when_environment_variable_not_set(mock_time): host="https://mock-host.com", ) langfuse.api = Mock() - + prompt_name = "test_default_ttl" prompt = Prompt_Text( name=prompt_name, @@ -1547,59 +1537,61 @@ def test_default_ttl_when_environment_variable_not_set(mock_time): tags=[], ) prompt_client = TextPromptClient(prompt) - + mock_server_call = langfuse.api.prompts.get mock_server_call.return_value = prompt - + # First call - should cache the prompt result1 = langfuse.get_prompt(prompt_name) assert mock_server_call.call_count == 1 assert result1 == prompt_client - + # Check that prompt is cached cached_item = langfuse._resources.prompt_cache.get( - langfuse._resources.prompt_cache.generate_cache_key(prompt_name, version=None, label=None) + langfuse._resources.prompt_cache.generate_cache_key( + prompt_name, version=None, label=None + ) ) assert cached_item is not None assert cached_item.value == prompt_client - + # Set time to just before default TTL expiration mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS - 1 - + # Second call - should still use cache result2 = langfuse.get_prompt(prompt_name) assert mock_server_call.call_count == 1 # No new server call assert result2 == prompt_client - + # Set time to just after default TTL expiration to trigger cache expiry # Use the actual DEFAULT_PROMPT_CACHE_TTL_SECONDS value that was imported mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS + 1 - + # Third call - should still use cache (stale cache behavior) result3 = langfuse.get_prompt(prompt_name) assert result3 == prompt_client - + # Wait for background refresh to complete while True: if langfuse._resources.prompt_cache._task_manager.active_tasks() == 0: break sleep(0.1) - + # Should have made a new server call for refresh assert mock_server_call.call_count == 2 - + # Set time to just after default TTL expiration mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS + 1 - + # Fourth call - should use refreshed cache result4 = langfuse.get_prompt(prompt_name) assert result4 == prompt_client - + def test_clear_prompt_cache(langfuse): """Test clearing the entire prompt cache.""" prompt_name = create_uuid() - + # Mock the API calls mock_prompt = Prompt_Text( name=prompt_name, @@ -1610,34 +1602,38 @@ def test_clear_prompt_cache(langfuse): config={}, tags=[], ) - + # Mock the create_prompt API call langfuse.api.prompts.create.return_value = mock_prompt - + # Mock the get_prompt API call langfuse.api.prompts.get.return_value = mock_prompt - + # Create a prompt and cache it prompt_client = langfuse.create_prompt( name=prompt_name, prompt="test prompt", labels=["production"], ) - + # Get the prompt to cache it cached_prompt = langfuse.get_prompt(prompt_name) assert cached_prompt.name == prompt_name # Verify that the prompt is in the cache cache_key = f"{prompt_name}-label:production" - assert langfuse._resources.prompt_cache.get(cache_key) is not None, "Prompt should be in cache before clearing" - + assert ( + langfuse._resources.prompt_cache.get(cache_key) is not None + ), "Prompt should be in cache before clearing" + # Clear the entire prompt cache langfuse.clear_prompt_cache() - + # Verify cache is completely cleared - assert langfuse._resources.prompt_cache.get(cache_key) is None, "Prompt should be removed from cache after clearing" - + assert ( + langfuse._resources.prompt_cache.get(cache_key) is None + ), "Prompt should be removed from cache after clearing" + # Verify data integrity assert prompt_client.name == prompt_name assert cached_prompt.name == prompt_name From 8c09c3d8a14cab38f18489d8aab085ff50df504b Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:47:50 +0200 Subject: [PATCH 4/6] push --- tests/test_prompt.py | 132 ------------------------------------------- 1 file changed, 132 deletions(-) diff --git a/tests/test_prompt.py b/tests/test_prompt.py index 82a287f57..3d8d5e796 100644 --- a/tests/test_prompt.py +++ b/tests/test_prompt.py @@ -1505,135 +1505,3 @@ def test_environment_variable_override_prompt_cache_ttl(): # Clean up environment variable if LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS in os.environ: del os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] - - -@patch.object(PromptCacheItem, "get_epoch_seconds") -def test_default_ttl_when_environment_variable_not_set(mock_time): - """Test that default 60-second TTL is used when LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS is not set.""" - - # Ensure environment variable is not set - if LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS in os.environ: - del os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] - - # Set initial time to 0 - mock_time.return_value = 0 - - # Create a new Langfuse instance to pick up the default TTL - langfuse = Langfuse( - public_key="test-public-key", - secret_key="test-secret-key", - host="https://mock-host.com", - ) - langfuse.api = Mock() - - prompt_name = "test_default_ttl" - prompt = Prompt_Text( - name=prompt_name, - version=1, - prompt="Test prompt with default TTL", - type="text", - labels=[], - config={}, - tags=[], - ) - prompt_client = TextPromptClient(prompt) - - mock_server_call = langfuse.api.prompts.get - mock_server_call.return_value = prompt - - # First call - should cache the prompt - result1 = langfuse.get_prompt(prompt_name) - assert mock_server_call.call_count == 1 - assert result1 == prompt_client - - # Check that prompt is cached - cached_item = langfuse._resources.prompt_cache.get( - langfuse._resources.prompt_cache.generate_cache_key( - prompt_name, version=None, label=None - ) - ) - assert cached_item is not None - assert cached_item.value == prompt_client - - # Set time to just before default TTL expiration - mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS - 1 - - # Second call - should still use cache - result2 = langfuse.get_prompt(prompt_name) - assert mock_server_call.call_count == 1 # No new server call - assert result2 == prompt_client - - # Set time to just after default TTL expiration to trigger cache expiry - # Use the actual DEFAULT_PROMPT_CACHE_TTL_SECONDS value that was imported - mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS + 1 - - # Third call - should still use cache (stale cache behavior) - result3 = langfuse.get_prompt(prompt_name) - assert result3 == prompt_client - - # Wait for background refresh to complete - while True: - if langfuse._resources.prompt_cache._task_manager.active_tasks() == 0: - break - sleep(0.1) - - # Should have made a new server call for refresh - assert mock_server_call.call_count == 2 - - # Set time to just after default TTL expiration - mock_time.return_value = DEFAULT_PROMPT_CACHE_TTL_SECONDS + 1 - - # Fourth call - should use refreshed cache - result4 = langfuse.get_prompt(prompt_name) - assert result4 == prompt_client - - -def test_clear_prompt_cache(langfuse): - """Test clearing the entire prompt cache.""" - prompt_name = create_uuid() - - # Mock the API calls - mock_prompt = Prompt_Text( - name=prompt_name, - version=1, - prompt="test prompt", - type="text", - labels=["production"], - config={}, - tags=[], - ) - - # Mock the create_prompt API call - langfuse.api.prompts.create.return_value = mock_prompt - - # Mock the get_prompt API call - langfuse.api.prompts.get.return_value = mock_prompt - - # Create a prompt and cache it - prompt_client = langfuse.create_prompt( - name=prompt_name, - prompt="test prompt", - labels=["production"], - ) - - # Get the prompt to cache it - cached_prompt = langfuse.get_prompt(prompt_name) - assert cached_prompt.name == prompt_name - - # Verify that the prompt is in the cache - cache_key = f"{prompt_name}-label:production" - assert ( - langfuse._resources.prompt_cache.get(cache_key) is not None - ), "Prompt should be in cache before clearing" - - # Clear the entire prompt cache - langfuse.clear_prompt_cache() - - # Verify cache is completely cleared - assert ( - langfuse._resources.prompt_cache.get(cache_key) is None - ), "Prompt should be removed from cache after clearing" - - # Verify data integrity - assert prompt_client.name == prompt_name - assert cached_prompt.name == prompt_name From be4c4463285abe8fc543a8f9770f7cd373ff78b5 Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:01:34 +0200 Subject: [PATCH 5/6] push --- tests/test_prompt.py | 91 -------------------------------------------- 1 file changed, 91 deletions(-) diff --git a/tests/test_prompt.py b/tests/test_prompt.py index 3d8d5e796..4479f7bf2 100644 --- a/tests/test_prompt.py +++ b/tests/test_prompt.py @@ -1,4 +1,3 @@ -import os from time import sleep from unittest.mock import Mock, patch @@ -6,9 +5,6 @@ import pytest from langfuse._client.client import Langfuse -from langfuse._client.environment_variables import ( - LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS, -) from langfuse._utils.prompt_cache import ( DEFAULT_PROMPT_CACHE_TTL_SECONDS, PromptCacheItem, @@ -1418,90 +1414,3 @@ def test_update_prompt(): expected_labels = sorted(["latest", "doe", "production", "john"]) assert sorted(fetched_prompt.labels) == expected_labels assert sorted(updated_prompt.labels) == expected_labels - - -def test_environment_variable_override_prompt_cache_ttl(): - """Test that LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS environment variable overrides default TTL.""" - # Set environment variable to override default TTL - os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] = "120" - - # Create a new Langfuse instance to pick up the environment variable - langfuse = Langfuse( - public_key="test-public-key", - secret_key="test-secret-key", - host="https://mock-host.com", - ) - langfuse.api = Mock() - - prompt_name = "test_env_override_ttl" - prompt = Prompt_Text( - name=prompt_name, - version=1, - prompt="Test prompt with env override", - type="text", - labels=[], - config={}, - tags=[], - ) - prompt_client = TextPromptClient(prompt) - - mock_server_call = langfuse.api.prompts.get - mock_server_call.return_value = prompt - - # Mock time to control cache expiration - with patch.object(PromptCacheItem, "get_epoch_seconds") as mock_time: - mock_time.return_value = 0 - - # First call - should cache the prompt - result1 = langfuse.get_prompt(prompt_name) - assert mock_server_call.call_count == 1 - assert result1 == prompt_client - - # Check that prompt is cached - cached_item = langfuse._resources.prompt_cache.get( - langfuse._resources.prompt_cache.generate_cache_key( - prompt_name, version=None, label=None - ) - ) - assert cached_item is not None - assert cached_item.value == prompt_client - - # Debug: check the cache item's expiry time - print(f"DEBUG: Cache item expiry: {cached_item._expiry}") - print(f"DEBUG: Current mock time: {mock_time.return_value}") - print(f"DEBUG: Is expired? {cached_item.is_expired()}") - - # Set time to 60 seconds (before new TTL of 120 seconds) - mock_time.return_value = 60 - - # Second call - should still use cache - result2 = langfuse.get_prompt(prompt_name) - assert mock_server_call.call_count == 1 # No new server call - assert result2 == prompt_client - - # Set time to 120 seconds (at TTL expiration) - mock_time.return_value = 120 - - # Third call - should still use cache (stale cache behavior) - result3 = langfuse.get_prompt(prompt_name) - assert result3 == prompt_client - - # Wait for background refresh to complete - while True: - if langfuse._resources.prompt_cache._task_manager.active_tasks() == 0: - break - sleep(0.1) - - # Should have made a new server call for refresh - assert mock_server_call.call_count == 2 - - # Set time to 121 seconds (after TTL expiration) - mock_time.return_value = 121 - - # Fourth call - should use refreshed cache - result4 = langfuse.get_prompt(prompt_name) - assert result4 == prompt_client - - # Clean up environment variable - if LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS in os.environ: - del os.environ[LANGFUSE_PROMPT_CACHE_DEFAULT_TTL_SECONDS] From cba05ab32d817724b0a2db0e6ff6466ad8a52281 Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:20:19 +0200 Subject: [PATCH 6/6] push --- tests/test_prompt.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_prompt.py b/tests/test_prompt.py index 4479f7bf2..d3c20d285 100644 --- a/tests/test_prompt.py +++ b/tests/test_prompt.py @@ -679,11 +679,7 @@ def test_prompt_end_to_end(): @pytest.fixture def langfuse(): - langfuse_instance = Langfuse( - public_key="test-public-key", - secret_key="test-secret-key", - host="https://mock-host.com", - ) + langfuse_instance = Langfuse() langfuse_instance.api = Mock() return langfuse_instance