Commit 42158ae
server : fix first message identification (ggml-org#13634)
* server : fix first message identification
When using the OpenAI SDK (https://github.com/openai/openai-node/blob/master/src/lib/ChatCompletionStream.ts#L623-L626) we noticed that the expected assistant role is missing in the first streaming message. Fix this by correctly checking for the first message.
Co-authored-by: Piotr Stankiewicz <[email protected]>
Signed-off-by: Dorin Geman <[email protected]>
* server : Fix checks for first role message for stream=True
Co-authored-by: Piotr Stankiewicz <[email protected]>
Signed-off-by: Dorin Geman <[email protected]>
---------
Signed-off-by: Dorin Geman <[email protected]>
Co-authored-by: Piotr Stankiewicz <[email protected]>1 parent 797f2ac commit 42158ae
2 files changed
+53
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
| 954 | + | |
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
965 | 966 | | |
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
969 | | - | |
| 970 | + | |
| 971 | + | |
970 | 972 | | |
971 | 973 | | |
972 | 974 | | |
973 | 975 | | |
| 976 | + | |
974 | 977 | | |
975 | 978 | | |
976 | 979 | | |
| |||
982 | 985 | | |
983 | 986 | | |
984 | 987 | | |
| 988 | + | |
985 | 989 | | |
986 | 990 | | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
987 | 1001 | | |
988 | 1002 | | |
989 | 1003 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
| |||
295 | 307 | | |
296 | 308 | | |
297 | 309 | | |
298 | | - | |
| 310 | + | |
299 | 311 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
311 | 329 | | |
0 commit comments