Commit 03df311
committed
feat: Add Jina as a selectable embeddings provider with reranking support
This commit adds Jina AI as a new embeddings provider option with the following features:
- Added JinaEmbeddingProvider implementing the EmbeddingProvider trait
- Support for Jina embeddings API (jina-embeddings-v4 model)
- Configurable task parameter (default: code.query for code embeddings)
- Late chunking support enabled by default for improved accuracy
- Integrated reranking functionality using Jina reranker-v3 model
- Reranking is enabled by default when Jina provider is selected
- Added Jina variant to EmbeddingProvider enum
- Created JinaEmbeddingConfig struct with all necessary configuration options
- Added 'jina' feature flag to Cargo.toml
- Registered jina_provider module in lib.rs
- Updated example_embedding.toml with Jina configuration example
The implementation follows the same pattern as existing providers (OpenAI, Ollama)
with retry logic, batch processing, and proper error handling.1 parent 4e92c73 commit 03df311
File tree
5 files changed
+645
-0
lines changed- config
- crates
- codegraph-core/src
- codegraph-vector
- src
5 files changed
+645
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
17 | 37 | | |
18 | 38 | | |
19 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 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 | + | |
98 | 172 | | |
99 | 173 | | |
100 | 174 | | |
| |||
109 | 183 | | |
110 | 184 | | |
111 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
112 | 189 | | |
113 | 190 | | |
114 | 191 | | |
| |||
175 | 252 | | |
176 | 253 | | |
177 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
178 | 271 | | |
179 | 272 | | |
180 | 273 | | |
| |||
190 | 283 | | |
191 | 284 | | |
192 | 285 | | |
| 286 | + | |
193 | 287 | | |
194 | 288 | | |
195 | 289 | | |
| |||
206 | 300 | | |
207 | 301 | | |
208 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
209 | 321 | | |
210 | 322 | | |
211 | 323 | | |
| |||
221 | 333 | | |
222 | 334 | | |
223 | 335 | | |
| 336 | + | |
224 | 337 | | |
225 | 338 | | |
226 | 339 | | |
| |||
277 | 390 | | |
278 | 391 | | |
279 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
280 | 401 | | |
281 | 402 | | |
282 | 403 | | |
283 | 404 | | |
284 | 405 | | |
285 | 406 | | |
286 | 407 | | |
| 408 | + | |
287 | 409 | | |
288 | 410 | | |
289 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
0 commit comments