JinaReaderConnector
A component that interacts with Jina AI's reader service to process queries and return documents.
Basic Information
- Type:
haystack_integrations.components.connectors.jina.reader.JinaReaderConnector
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| query | str | The query string or URL to process. | |
| headers | Optional[Dict[str, str]] | None | Optional headers to include in the request for customization. Refer to the Jina Reader documentation for more information. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents | List[Document] | A dictionary with the following keys: - documents: A list of Document objects. |
Overview
Work in Progress
Bear with us while we're working on adding pipeline examples and most common components connections.
A component that interacts with Jina AI's reader service to process queries and return documents.
This component supports different modes of operation: read, search, and ground.
Usage example:
from haystack_integrations.components.connectors.jina import JinaReaderConnector
reader = JinaReaderConnector(mode="read")
query = "https://example.com"
result = reader.run(query=query)
document = result["documents"][0]
print(document.content)
>>> "This domain is for use in illustrative examples..."
Usage Example
components:
JinaReaderConnector:
type: jina.src.haystack_integrations.components.connectors.jina.reader.JinaReaderConnector
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| mode | Union[JinaReaderMode, str] | The operation mode for the reader (read, search or ground). - read: process a URL and return the textual content of the page. - search: search the web and return textual content of the most relevant pages. - ground: call the grounding engine to perform fact checking. For more information on the modes, see the Jina Reader documentation. | |
| api_key | Secret | Secret.from_env_var('JINA_API_KEY') | The Jina API key. It can be explicitly provided or automatically read from the environment variable JINA_API_KEY (recommended). |
| json_response | bool | True | Controls the response format from the Jina Reader API. If True, requests a JSON response, resulting in Documents with rich structured metadata. If False, requests a raw response, resulting in one Document with minimal metadata. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| query | str | The query string or URL to process. | |
| headers | Optional[Dict[str, str]] | None | Optional headers to include in the request for customization. Refer to the Jina Reader documentation for more information. |
Was this page helpful?