Commit 9ba242c
feat(jina): add async support and migrate from requests to httpx (#3144)
* feat(jina): add async support to JinaTextEmbedder and migrate to httpx
Replace `requests` with `httpx` for HTTP calls and add `run_async`
method to `JinaTextEmbedder` for use with Haystack's `AsyncPipeline`.
Ref: #3134
* feat(jina): add async support to JinaDocumentEmbedder and migrate to httpx
Replace `requests` with `httpx` for HTTP calls and add `run_async`
method to `JinaDocumentEmbedder` for use with Haystack's `AsyncPipeline`.
Ref: #3134
* feat(jina): add async support to JinaRanker and migrate to httpx
Replace `requests` with `httpx` for HTTP calls and add `run_async`
method to `JinaRanker` for use with Haystack's `AsyncPipeline`.
Ref: #3134
* feat(jina): add async support to JinaReaderConnector and migrate to httpx
Replace `requests` with `httpx` for HTTP calls and add `run_async`
method to `JinaReaderConnector` for use with Haystack's `AsyncPipeline`.
Ref: #3134
* feat(jina): add async support to JinaDocumentImageEmbedder and migrate to httpx
Replace `requests` with `httpx` for HTTP calls and add `run_async`
method to `JinaDocumentImageEmbedder` for use with Haystack's `AsyncPipeline`.
Ref: #3134
* build(jina): replace requests dependency with httpx
The `requests` library is no longer used after migrating all components
to `httpx` for both sync and async HTTP calls.
Ref: #3134
* fix(jina): fix async test to actually call run_async and normalize variable naming
- Make test_run_async_wrong_input_format async and call run_async()
- Rename resp -> response in _embed_batch_async for consistency
Ref: #3134
* build(jina): pin httpx>=0.24.0
Ref: #3134
* build(jina): pin httpcore>=1.0.8 for Python 3.14 compatibility
httpcore < 1.0.8 fails to import on Python 3.14 due to typing.Union
changes. httpx only requires httpcore==1.* without a floor, so we
add an explicit minimum.
Ref: #3134
* build(jina): bump httpx>=0.28.0 for Python 3.13+ compatibility
httpx < 0.28.0 imports the removed `cgi` module on Python 3.13+ and
depends on httpcore versions incompatible with Python 3.14. Bumping
to >=0.28.0 fixes both issues, replacing the separate httpcore pin.
Ref: #3134
---------
Co-authored-by: bogdankostic <bogdankostic@web.de>1 parent d9d7f6c commit 9ba242c
11 files changed
Lines changed: 736 additions & 277 deletions
File tree
- integrations/jina
- src/haystack_integrations/components
- connectors/jina
- embedders/jina
- rankers/jina
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 48 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 107 | + | |
121 | 108 | | |
122 | 109 | | |
123 | 110 | | |
| |||
127 | 114 | | |
128 | 115 | | |
129 | 116 | | |
| 117 | + | |
130 | 118 | | |
131 | | - | |
132 | | - | |
| 119 | + | |
133 | 120 | | |
134 | 121 | | |
135 | 122 | | |
136 | 123 | | |
137 | 124 | | |
138 | | - | |
| 125 | + | |
139 | 126 | | |
140 | 127 | | |
141 | 128 | | |
142 | 129 | | |
143 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
Lines changed: 115 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
164 | 161 | | |
165 | 162 | | |
166 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
167 | 201 | | |
168 | 202 | | |
169 | 203 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
173 | 220 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
198 | 242 | | |
199 | 243 | | |
200 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
201 | 254 | | |
202 | 255 | | |
203 | 256 | | |
| |||
209 | 262 | | |
210 | 263 | | |
211 | 264 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 265 | + | |
218 | 266 | | |
219 | 267 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 268 | + | |
227 | 269 | | |
228 | 270 | | |
229 | 271 | | |
230 | 272 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 273 | + | |
234 | 274 | | |
235 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
0 commit comments