Skip to content

Commit d51e56e

Browse files
committed
test: remove outdated test case for optional fields in ChatCompletionResponse
1 parent f194098 commit d51e56e

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

responseHandler_test.go

-64
Original file line numberDiff line numberDiff line change
@@ -68,70 +68,6 @@ func TestHandleChatCompletionResponse(t *testing.T) {
6868
},
6969
want: &validResponse,
7070
},
71-
{
72-
name: "response with optional fields",
73-
response: &http.Response{
74-
StatusCode: http.StatusOK,
75-
Body: io.NopCloser(bytes.NewReader([]byte(`{
76-
"id": "chat-123",
77-
"object": "chat.completion",
78-
"created": 1677858242,
79-
"model": "deepseek-chat",
80-
"choices": [{
81-
"index": 0,
82-
"message": {
83-
"role": "assistant",
84-
"content": "Hello!",
85-
"reasoning_content": "User greeting"
86-
},
87-
"logprobs": {
88-
"tokens": ["Hello", "!"],
89-
"token_logprobs": [-0.5, -0.2],
90-
"top_logprobs": [{"Hello": -0.5}, {"!": -0.2}]
91-
},
92-
"finish_reason": "stop"
93-
}],
94-
"usage": {
95-
"prompt_tokens": 5,
96-
"completion_tokens": 2,
97-
"total_tokens": 7,
98-
"prompt_cache_hit_tokens": 3,
99-
"prompt_cache_miss_tokens": 2
100-
},
101-
"system_fingerprint": "fp-123"
102-
}`))),
103-
},
104-
want: &deepseek.ChatCompletionResponse{
105-
ID: "chat-123",
106-
Object: "chat.completion",
107-
Created: 1677858242,
108-
Model: "deepseek-chat",
109-
Choices: []deepseek.Choice{
110-
{
111-
Index: 0,
112-
Message: deepseek.Message{
113-
Role: "assistant",
114-
Content: "Hello!",
115-
ReasoningContent: "User greeting",
116-
},
117-
LogProbs: &deepseek.LogProbs{
118-
Tokens: []string{"Hello", "!"},
119-
TokenLogProbs: []float64{-0.5, -0.2},
120-
TopLogProbs: []map[string]float64{{"Hello": -0.5}, {"!": -0.2}},
121-
},
122-
FinishReason: "stop",
123-
},
124-
},
125-
Usage: deepseek.Usage{
126-
PromptTokens: 5,
127-
CompletionTokens: 2,
128-
TotalTokens: 7,
129-
PromptCacheHitTokens: 3,
130-
PromptCacheMissTokens: 2,
131-
},
132-
SystemFingerprint: func(s string) *string { return &s }("fp-123"),
133-
},
134-
},
13571
{
13672
name: "invalid JSON",
13773
response: &http.Response{

0 commit comments

Comments
 (0)