Commit 56d7603
committed
bug #88 [AiBundle] Use model FQCN for indexer config, to allow any
This PR was merged into the main branch.
Discussion
----------
[AiBundle] Use model FQCN for indexer config, to allow any `Symfony\AI\Platform\Model` child class
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix symfony/ai#59 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Before:
```yaml
ai:
indexer:
default:
platform: 'symfony_ai.platform.mistral'
model:
name: 'Embeddings'
version: 'mistral-embed'
```
After
```yaml
ai:
indexer:
default:
platform: 'symfony_ai.platform.mistral'
model:
class: 'Symfony\AI\Platform\Bridge\Mistral\Embeddings'
name: !php/const Symfony\AI\Platform\Bridge\Mistral\Embeddings::MISTRAL_EMBED
```
This way, any class extending `Symfony\AI\Platform\Model` can be used as embedder model, even one written by users themselves.
Embeddings model of providers (OpenAI, Mistral, Gemini, ...) can be named `Embeddings` with no issue.
---
Replace php-llm/llm-chain-bundle#99
Commits
-------
66b6cbc Use model FQCN for indexer config, to allow any Symfony\AI\Platform\Model child classSymfony\AI\Platform\Model child class (welcoMattic)File tree
4 files changed
+37
-47
lines changed- config
- doc
- src
- tests/DependencyInjection
4 files changed
+37
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
| 199 | + | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
| 60 | + | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
97 | | - | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | 32 | | |
35 | | - | |
36 | | - | |
37 | 33 | | |
38 | | - | |
39 | | - | |
40 | 34 | | |
41 | 35 | | |
42 | | - | |
43 | 36 | | |
44 | 37 | | |
45 | 38 | | |
| |||
261 | 254 | | |
262 | 255 | | |
263 | 256 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
275 | 263 | | |
276 | | - | |
277 | | - | |
| 264 | + | |
| 265 | + | |
278 | 266 | | |
279 | 267 | | |
280 | 268 | | |
| |||
473 | 461 | | |
474 | 462 | | |
475 | 463 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
486 | 473 | | |
487 | 474 | | |
488 | 475 | | |
489 | 476 | | |
| 477 | + | |
490 | 478 | | |
491 | 479 | | |
492 | 480 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments