Commit 679d43c
authored
feat: respect context and add request cancellation (#7187)
* feat: respect context
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* workaround fasthttp
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* feat(ui): allow to abort call
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Refactor
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* chore: improving error
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Respect context also with MCP
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Tie to both contexts
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Make detection more robust
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
---------
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>1 parent 4730b52 commit 679d43c
File tree
8 files changed
+240
-42
lines changed- backend/cpp/llama-cpp
- core
- config
- http
- endpoints/openai
- middleware
- static
- views
- pkg/grpc
8 files changed
+240
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
| |||
875 | 881 | | |
876 | 882 | | |
877 | 883 | | |
878 | | - | |
879 | | - | |
880 | | - | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
881 | 887 | | |
882 | 888 | | |
883 | 889 | | |
884 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
885 | 896 | | |
886 | 897 | | |
887 | 898 | | |
| |||
1145 | 1156 | | |
1146 | 1157 | | |
1147 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1148 | 1167 | | |
1149 | 1168 | | |
1150 | 1169 | | |
| |||
1176 | 1195 | | |
1177 | 1196 | | |
1178 | 1197 | | |
1179 | | - | |
1180 | | - | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1181 | 1202 | | |
1182 | 1203 | | |
1183 | 1204 | | |
1184 | 1205 | | |
1185 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1186 | 1212 | | |
1187 | 1213 | | |
1188 | 1214 | | |
| |||
1234 | 1260 | | |
1235 | 1261 | | |
1236 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1237 | 1270 | | |
1238 | 1271 | | |
1239 | 1272 | | |
| |||
1242 | 1275 | | |
1243 | 1276 | | |
1244 | 1277 | | |
1245 | | - | |
1246 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1247 | 1281 | | |
1248 | 1282 | | |
1249 | 1283 | | |
1250 | 1284 | | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1251 | 1290 | | |
1252 | 1291 | | |
1253 | 1292 | | |
| |||
1325 | 1364 | | |
1326 | 1365 | | |
1327 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
1328 | 1374 | | |
1329 | 1375 | | |
1330 | 1376 | | |
| |||
1333 | 1379 | | |
1334 | 1380 | | |
1335 | 1381 | | |
1336 | | - | |
1337 | | - | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1338 | 1385 | | |
1339 | 1386 | | |
1340 | 1387 | | |
1341 | 1388 | | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
1342 | 1394 | | |
1343 | 1395 | | |
1344 | 1396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 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 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
25 | 80 | | |
26 | 81 | | |
27 | 82 | | |
| |||
358 | 413 | | |
359 | 414 | | |
360 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
361 | 421 | | |
362 | 422 | | |
363 | 423 | | |
| |||
511 | 571 | | |
512 | 572 | | |
513 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
514 | 578 | | |
515 | 579 | | |
516 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| |||
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
86 | | - | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
164 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
165 | 175 | | |
166 | 176 | | |
167 | 177 | | |
| |||
0 commit comments