You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrations/jina.md
+37-2Lines changed: 37 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,9 @@ version: Haystack 2.0
17
17
toc: true
18
18
---
19
19
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.
21
23
22
24
Jina AI offers several models so people can use and chose whatever fits best to their needs:
23
25
@@ -64,10 +66,12 @@ You can reference the table below for hints on dimension vs. performance:
64
66
-[Haystack 2.0](#haystack-20)
65
67
-[Installation](#installation)
66
68
-[Usage](#usage)
69
+
-[Embedding Models](#embedding-models)
70
+
-[Jina Reader API](#jina-reader-api)
67
71
68
72
## Haystack 2.0
69
73
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)
71
75
72
76
### Installation
73
77
@@ -77,6 +81,8 @@ pip install jina-haystack
77
81
78
82
### Usage
79
83
84
+
#### Embedding Models
85
+
80
86
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).
81
87
82
88
You can use the Jina Reranker models with one component: [`JinaRanker`](https://docs.haystack.deepset.ai/docs/jinaranker)
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