@@ -36,6 +36,64 @@ function chatCompletion(): array
3636 ];
3737}
3838
39+ /**
40+ * @return array<string, mixed>
41+ */
42+ function chatCompletionWithoutId (): array
43+ {
44+ return [
45+ 'object ' => 'chat.completion ' ,
46+ 'created ' => 1677652288 ,
47+ 'model ' => 'gpt-3.5-turbo ' ,
48+ 'choices ' => [
49+ [
50+ 'index ' => 0 ,
51+ 'message ' => [
52+ 'role ' => 'assistant ' ,
53+ 'content ' => "\n\nHello there, how may I assist you today? " ,
54+ ],
55+ 'finish_reason ' => 'stop ' ,
56+ ],
57+ ],
58+ 'usage ' => [
59+ 'prompt_tokens ' => 9 ,
60+ 'completion_tokens ' => 12 ,
61+ 'total_tokens ' => 21 ,
62+ 'prompt_tokens_details ' => [
63+ 'cached_tokens ' => 5 ,
64+ ],
65+ 'completion_tokens_details ' => [
66+ 'reasoning_tokens ' => 0 ,
67+ 'accepted_prediction_tokens ' => 0 ,
68+ 'rejected_prediction_tokens ' => 0 ,
69+ ],
70+ ],
71+ ];
72+ }
73+
74+ /**
75+ * @return array<string, mixed>
76+ */
77+ function chatCompletionWithoutUsage (): array
78+ {
79+ return [
80+ 'id ' => 'chatcmpl-123 ' ,
81+ 'object ' => 'chat.completion ' ,
82+ 'created ' => 1677652288 ,
83+ 'model ' => 'gpt-3.5-turbo ' ,
84+ 'choices ' => [
85+ [
86+ 'index ' => 0 ,
87+ 'message ' => [
88+ 'role ' => 'assistant ' ,
89+ 'content ' => "\n\nHello there, how may I assist you today? " ,
90+ ],
91+ 'finish_reason ' => 'stop ' ,
92+ ],
93+ ],
94+ ];
95+ }
96+
3997/**
4098 * @return array<string, mixed>
4199 */
@@ -195,6 +253,24 @@ function chatCompletionStreamFirstChunk(): array
195253 ];
196254}
197255
256+ function chatCompletionStreamFirstChunkWithoutId (): array
257+ {
258+ return [
259+ 'object ' => 'chat.completion.chunk ' ,
260+ 'created ' => 1679432086 ,
261+ 'model ' => 'gpt-4-0314 ' ,
262+ 'choices ' => [
263+ [
264+ 'index ' => 0 ,
265+ 'delta ' => [
266+ 'role ' => 'assistant ' ,
267+ ],
268+ 'finish_reason ' => null ,
269+ ],
270+ ],
271+ ];
272+ }
273+
198274function chatCompletionStreamContentChunk (): array
199275{
200276 return [
0 commit comments