diff --git a/integrations/anthropic/tests/test_chat_generator.py b/integrations/anthropic/tests/test_chat_generator.py index 36622ecd9..d46ee624d 100644 --- a/integrations/anthropic/tests/test_chat_generator.py +++ b/integrations/anthropic/tests/test_chat_generator.py @@ -81,25 +81,6 @@ def test_to_dict_with_parameters(self, monkeypatch): }, } - def test_to_dict_with_lambda_streaming_callback(self, monkeypatch): - monkeypatch.setenv("ANTHROPIC_API_KEY", "test-api-key") - component = AnthropicChatGenerator( - model="claude-3-5-sonnet-20240620", - streaming_callback=lambda x: x, - generation_kwargs={"max_tokens": 10, "some_test_param": "test-params"}, - ) - data = component.to_dict() - assert data == { - "type": "haystack_integrations.components.generators.anthropic.chat.chat_generator.AnthropicChatGenerator", - "init_parameters": { - "api_key": {"env_vars": ["ANTHROPIC_API_KEY"], "strict": True, "type": "env_var"}, - "model": "claude-3-5-sonnet-20240620", - "streaming_callback": "tests.test_chat_generator.", - "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"}, - "ignore_tools_thinking_messages": True, - }, - } - def test_from_dict(self, monkeypatch): monkeypatch.setenv("ANTHROPIC_API_KEY", "fake-api-key") data = { diff --git a/integrations/cohere/tests/test_cohere_chat_generator.py b/integrations/cohere/tests/test_cohere_chat_generator.py index 4aaa2da2b..1a4774a40 100644 --- a/integrations/cohere/tests/test_cohere_chat_generator.py +++ b/integrations/cohere/tests/test_cohere_chat_generator.py @@ -98,26 +98,6 @@ def test_to_dict_with_parameters(self, monkeypatch): }, } - def test_to_dict_with_lambda_streaming_callback(self, monkeypatch): - monkeypatch.setenv("COHERE_API_KEY", "test-api-key") - component = CohereChatGenerator( - model="command-r", - streaming_callback=lambda x: x, - api_base_url="test-base-url", - generation_kwargs={"max_tokens": 10, "some_test_param": "test-params"}, - ) - data = component.to_dict() - assert data == { - "type": "haystack_integrations.components.generators.cohere.chat.chat_generator.CohereChatGenerator", - "init_parameters": { - "model": "command-r", - "api_base_url": "test-base-url", - "api_key": {"env_vars": ["COHERE_API_KEY", "CO_API_KEY"], "strict": True, "type": "env_var"}, - "streaming_callback": "tests.test_cohere_chat_generator.", - "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"}, - }, - } - def test_from_dict(self, monkeypatch): monkeypatch.setenv("COHERE_API_KEY", "fake-api-key") monkeypatch.setenv("CO_API_KEY", "fake-api-key")