Commit 3304689
committed
refactor: replace type casting with proper TypeScript interfaces for Ark caching
- Replace `(requestOptions as any)` with proper TypeScript interfaces
- Add ArkChatCompletionCreateParamsStreaming and ArkChatCompletionCreateParamsNonStreaming interfaces
- Update OpenAiHandler to use the new typed interfaces
- Update all test files to use proper types
- Maintain full backward compatibility and functionality
- All tests pass (38 test cases) and TypeScript compilation succeeds
Addresses feedback from @Artoria2e5 about using proper OpenAI.Responses interfaces
instead of type casting to any.1 parent 580e8d7 commit 3304689
File tree
3 files changed
+66
-24
lines changed- src/api
- providers
- transform/caching
- __tests__
3 files changed
+66
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
154 | | - | |
| 160 | + | |
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
| |||
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | | - | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
304 | 310 | | |
305 | 311 | | |
306 | 312 | | |
307 | | - | |
| 313 | + | |
308 | 314 | | |
309 | 315 | | |
310 | 316 | | |
| |||
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
343 | | - | |
| 349 | + | |
344 | 350 | | |
345 | 351 | | |
346 | 352 | | |
| |||
375 | 381 | | |
376 | 382 | | |
377 | 383 | | |
378 | | - | |
| 384 | + | |
379 | 385 | | |
380 | 386 | | |
381 | 387 | | |
| |||
482 | 488 | | |
483 | 489 | | |
484 | 490 | | |
485 | | - | |
486 | | - | |
487 | | - | |
| 491 | + | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
9 | | - | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | | - | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | | - | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | | - | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
90 | | - | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
110 | | - | |
| 117 | + | |
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
| |||
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
326 | | - | |
| 333 | + | |
327 | 334 | | |
328 | 335 | | |
329 | 336 | | |
| |||
364 | 371 | | |
365 | 372 | | |
366 | 373 | | |
367 | | - | |
| 374 | + | |
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 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 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
22 | 55 | | |
23 | 56 | | |
24 | 57 | | |
25 | 58 | | |
26 | 59 | | |
27 | 60 | | |
28 | 61 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 62 | + | |
32 | 63 | | |
33 | 64 | | |
34 | 65 | | |
35 | | - | |
| 66 | + | |
36 | 67 | | |
37 | 68 | | |
38 | 69 | | |
39 | 70 | | |
40 | 71 | | |
41 | | - | |
| 72 | + | |
42 | 73 | | |
43 | 74 | | |
44 | 75 | | |
45 | 76 | | |
46 | | - | |
| 77 | + | |
47 | 78 | | |
48 | 79 | | |
49 | 80 | | |
| |||
0 commit comments