Commit 5a153c3
committed
fix: improve type safety for max_completion_tokens params
Remove Record<string, unknown> type annotation to let TypeScript infer
the params object type, preserving type checking on all properties.
Cast to ChatCompletionCreateParamsNonStreaming at the create() call site
to accommodate the SDK's missing max_completion_tokens type. Add unit
test for reasoning model detection regex.
Signed-off-by: majiayu000 <1835304752@qq.com>1 parent 4d8cdf5 commit 5a153c3
File tree
4 files changed
+56
-18
lines changed- out
- src/engine
- test/unit
4 files changed
+56
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67158 | 67158 | | |
67159 | 67159 | | |
67160 | 67160 | | |
| 67161 | + | |
67161 | 67162 | | |
67162 | 67163 | | |
67163 | 67164 | | |
67164 | | - | |
67165 | | - | |
67166 | | - | |
| 67165 | + | |
| 67166 | + | |
| 67167 | + | |
| 67168 | + | |
| 67169 | + | |
67167 | 67170 | | |
67168 | 67171 | | |
67169 | 67172 | | |
67170 | 67173 | | |
67171 | 67174 | | |
67172 | | - | |
| 67175 | + | |
| 67176 | + | |
| 67177 | + | |
67173 | 67178 | | |
67174 | 67179 | | |
67175 | 67180 | | |
| |||
67277 | 67282 | | |
67278 | 67283 | | |
67279 | 67284 | | |
67280 | | - | |
67281 | | - | |
| 67285 | + | |
| 67286 | + | |
67282 | 67287 | | |
67283 | 67288 | | |
67284 | 67289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87943 | 87943 | | |
87944 | 87944 | | |
87945 | 87945 | | |
| 87946 | + | |
87946 | 87947 | | |
87947 | 87948 | | |
87948 | 87949 | | |
87949 | | - | |
87950 | | - | |
87951 | | - | |
| 87950 | + | |
| 87951 | + | |
| 87952 | + | |
| 87953 | + | |
| 87954 | + | |
87952 | 87955 | | |
87953 | 87956 | | |
87954 | 87957 | | |
87955 | 87958 | | |
87956 | 87959 | | |
87957 | | - | |
| 87960 | + | |
| 87961 | + | |
| 87962 | + | |
87958 | 87963 | | |
87959 | 87964 | | |
87960 | 87965 | | |
| |||
88062 | 88067 | | |
88063 | 88068 | | |
88064 | 88069 | | |
88065 | | - | |
88066 | | - | |
| 88070 | + | |
| 88071 | + | |
88067 | 88072 | | |
88068 | 88073 | | |
88069 | 88074 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments