Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ describe("convertVercelStreamPart", () => {
const result = convertVercelStreamPart(part, options);

expect(result).not.toBeNull();
expect(result?.choices[0].delta.content).toBe("Let me think...");
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect((result?.choices[0].delta as any).reasoning_content).toBe(
"Let me think...",
);
});

test("returns null for tool-call (handled by tool-input-start/delta)", () => {
Expand Down
7 changes: 5 additions & 2 deletions packages/openai-adapters/src/vercelStreamConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ export function convertVercelStreamPart(
});

case "reasoning-delta":
return chatChunk({
content: part.text,
return chatChunkFromDelta({
delta: {
// `reasoning_content` is not yet typed in OpenAI's SDK types.
reasoning_content: part.text,
} as ChatCompletionChunk.Choice["delta"],
model,
});

Expand Down
Loading