This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Commit d01f27c
authored
Fix FIM for OpenRouter (#1097)
* Fix FIM for OpenRouter
FIM was not working with OpenRouter in Continue. The reason
was that we get FIM requests in `/completions`. LiteLLM when
using `acompletion` is forcing `/chat/completions` and the return
format `{..., "choices":[{"delta":{"content":"some text"}}]}`.
However, Continue was expecting the format:
`{..., "choices":[{"text":"some text"}]}` becuase of the endpoint
it called.
With this PR we force the return format to be the latter using
`atext_completion` from LiteLLM
* Force denormalization in OpenRouter FIM to have a prompt key1 parent 868c687 commit d01f27c
File tree
2 files changed
+39
-6
lines changed- src/codegate/providers
- openai
- openrouter
2 files changed
+39
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
27 | 51 | | |
28 | 52 | | |
29 | 53 | | |
30 | 54 | | |
31 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
32 | 64 | | |
33 | 65 | | |
34 | 66 | | |
| |||
0 commit comments