Skip to content

Commit e12d067

Browse files
committed
fix: nebius test for DeepSeek-R1 format handling
- Added fetchModel() call before testing createMessage to ensure models are loaded - This ensures the correct model ID is used when checking for R1 format - Test now properly verifies that system prompt and user message are merged for DeepSeek-R1
1 parent 1f58d87 commit e12d067

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/api/providers/__tests__/nebius.test.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ describe("NebiusHandler", () => {
151151
nebiusModelId: "deepseek-ai/DeepSeek-R1",
152152
})
153153

154+
// Ensure the model is loaded
155+
await handler.fetchModel()
156+
154157
const mockStream = {
155158
async *[Symbol.asyncIterator]() {
156159
yield {
@@ -169,16 +172,19 @@ describe("NebiusHandler", () => {
169172

170173
await handler.createMessage(systemPrompt, messages).next()
171174

172-
// Verify R1 format is used - the first message should combine system and user content
175+
// Verify R1 format is used - the system prompt and first user message should be merged
173176
expect(mockCreate).toHaveBeenCalledWith(
174177
expect.objectContaining({
175178
model: "deepseek-ai/DeepSeek-R1",
176-
messages: expect.arrayContaining([
177-
expect.objectContaining({
179+
messages: [
180+
{
178181
role: "user",
179-
content: expect.stringContaining("test system prompt"),
180-
}),
181-
]),
182+
content: "test system prompt\ntest message",
183+
},
184+
],
185+
temperature: 0,
186+
stream: true,
187+
stream_options: { include_usage: true },
182188
}),
183189
)
184190
})

0 commit comments

Comments
 (0)