Skip to content

Function: toJSON()

@providerprotocol/ai


@providerprotocol/ai / proxy / toJSON

toJSON(turn): Response

Defined in: src/providers/proxy/server/webapi.ts:210

Create a JSON Response from a Turn.

Turn

The completed inference turn

Response

HTTP Response with JSON body

const turn = await instance.generate(messages);
return toJSON(turn);