Skip to content

Commit 82fcf46

Browse files
fix: set response object type for non-streaming responses
Needed for pydantic_ai to work properly with the API. PR: ericc-ch#185
1 parent 5869396 commit 82fcf46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/routes/chat-completions/handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export async function handleCompletion(c: Context) {
5050
const response = await createChatCompletions(payload)
5151

5252
if (isNonStreaming(response)) {
53+
response.object = "chat.completion"
5354
consola.debug("Non-streaming response:", JSON.stringify(response))
5455
return c.json(response)
5556
}

0 commit comments

Comments
 (0)