Skip to content

Commit 380f441

Browse files
jlonge4anakin87
andauthored
add reader connector mention to readme (#288)
* add reader connector mention * small improvements --------- Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
1 parent 7f4526f commit 380f441

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

integrations/jina.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ version: Haystack 2.0
1717
toc: true
1818
---
1919

20-
This integration allows users of Haystack to seamlessly use Jina AI's`jina-embeddings`and [reranking models](https://jina.ai/reranker/) in their pipelines. [Jina AI](https://jina.ai/embeddings/) is a multimodal AI company, with a vision to revolutionize the way we interpret and interact with information with its prompt and model technologies.
20+
This integration allows users of Haystack to seamlessly use Jina AI's`jina-embeddings`and [reranking models](https://jina.ai/reranker/) in their pipelines. Haystack also integrates the [Jina Reader API](https://jina.ai/reader/).
21+
22+
[Jina AI](https://jina.ai/embeddings/) is a multimodal AI company, with a vision to revolutionize the way we interpret and interact with information with its prompt and model technologies.
2123

2224
Jina AI offers several models so people can use and chose whatever fits best to their needs:
2325

@@ -64,10 +66,12 @@ You can reference the table below for hints on dimension vs. performance:
6466
- [Haystack 2.0](#haystack-20)
6567
- [Installation](#installation)
6668
- [Usage](#usage)
69+
- [Embedding Models](#embedding-models)
70+
- [Jina Reader API](#jina-reader-api)
6771

6872
## Haystack 2.0
6973

70-
You can use [Jina embedding Models](https://jina.ai/embeddings) and [Jina Rerankers](https://jina.ai/reranker/) in your Haystack 2.0 pipelines with the Jina [Embedders](https://docs.haystack.deepset.ai/docs/embedders) and Jina [Rankers](https://docs.haystack.deepset.ai/docs/rankers)
74+
You can use [Jina embedding Models](https://jina.ai/embeddings) and [Jina Rerankers](https://jina.ai/reranker/) in your Haystack 2.0 pipelines with the Jina [Embedders](https://docs.haystack.deepset.ai/docs/embedders) and Jina [Ranker](https://docs.haystack.deepset.ai/docs/jinaranker)
7175

7276
### Installation
7377

@@ -77,6 +81,8 @@ pip install jina-haystack
7781

7882
### Usage
7983

84+
#### Embedding Models
85+
8086
You can use Jina Embedding models with two components: [`JinaTextEmbedder`](https://docs.haystack.deepset.ai/docs/jinatextembedder) and [`JinaDocumentEmbedder`](https://docs.haystack.deepset.ai/docs/jinadocumentembedder).
8187

8288
You can use the Jina Reranker models with one component: [`JinaRanker`](https://docs.haystack.deepset.ai/docs/jinaranker)
@@ -118,3 +124,32 @@ indexing_pipeline.connect("embedder", "writer")
118124

119125
indexing_pipeline.run({"embedder": {"documents": documents}})
120126
```
127+
128+
#### Jina Reader API
129+
130+
The Jina Reader API converts a URL/query into a LLM-friendly format.
131+
It supports three modes of operation:
132+
- `read`: process a URL and return the textual content of the page.
133+
- `search`: search the web and return textual content of the most relevant pages.
134+
- `ground`: call the grounding engine to perform fact checking.
135+
136+
In Haystack, you can use the Jina Reader API with the [`JinaReaderConnector`](https://docs.haystack.deepset.ai/reference/integrations-jina#jinareaderconnector) component.
137+
138+
Below is an example of using the `JinaReaderConnector` in `read` mode:
139+
140+
```python
141+
import os
142+
from haystack_integrations.components.connectors.jina import JinaReaderConnector
143+
144+
os.environ["JINA_API_KEY"]="your-jina-api-key"
145+
146+
reader = JinaReaderConnector(mode="read")
147+
query = "https://example.com"
148+
result = reader.run(query=query)
149+
document = result["documents"][0]
150+
print(document.content)
151+
152+
>>> "This domain is for use in illustrative examples..."
153+
```
154+
155+
You can find more examples [here](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/jina/examples/jina_reader_connector.py).

0 commit comments

Comments
 (0)