diff --git a/integrations/jina/src/haystack_integrations/components/connectors/jina/reader.py b/integrations/jina/src/haystack_integrations/components/connectors/jina/reader.py index d64b727da..3296ccc31 100644 --- a/integrations/jina/src/haystack_integrations/components/connectors/jina/reader.py +++ b/integrations/jina/src/haystack_integrations/components/connectors/jina/reader.py @@ -24,9 +24,9 @@ class JinaReaderConnector: Usage example: ```python from haystack import Document - from haystack_integrations.components.connectors.jina import JinaReader + from haystack_integrations.components.connectors.jina import JinaReaderConnector - reader = JinaReader(mode="READ") + reader = JinaReaderConnector(mode="READ") query = "https://example.com" result = reader.run(query=query) document = result["document"] diff --git a/integrations/jina/tests/test_reader_connector.py b/integrations/jina/tests/test_reader_connector.py index 97f7a1381..caa95099c 100644 --- a/integrations/jina/tests/test_reader_connector.py +++ b/integrations/jina/tests/test_reader_connector.py @@ -6,6 +6,7 @@ from haystack_integrations.components.connectors.jina import JinaReaderConnector, JinaReaderMode +os.environ["JINA_API_KEY"] = "test-api-key" os.environ["TEST_KEY"] = "test-api-key" @@ -41,15 +42,15 @@ def test_from_dict(self): component_dict = { "type": "haystack_integrations.components.connectors.jina.reader.JinaReaderConnector", "init_parameters": { - "mode": "GROUND", - "json_response": False, - "api_key": {"type": "env_var", "env_vars": ["TEST_KEY"]}, + "api_key": {"type": "env_var", "env_vars": ["JINA_API_KEY"]}, + "mode": "READ", + "json_response": True, }, } reader = JinaReaderConnector.from_dict(component_dict) assert isinstance(reader, JinaReaderConnector) - assert reader.mode == JinaReaderMode.GROUND - assert reader.json_response is False + assert reader.mode == JinaReaderMode.READ + assert reader.json_response is True assert reader.api_key.resolve_value() == "test-api-key"