openai / Exports / PayloadLogger
Interface: PayloadLogger
PayloadLogger interface for logging OpenAI API payloads
This interface provides a contract for different logging implementations:
- FilePayloadLogger: Node.js file-based logging
- ConsolePayloadLogger: Browser console-based logging
- Custom implementations: User-defined loggers
Table of contents
Methods
Methods
isEnabled
▸ isEnabled(): boolean
Check if logging is enabled
Returns
boolean
true if logging is active, false otherwise
Defined in
interfaces/payload-logger.ts:17
logPayload
▸ logPayload(payload
, type
): Promise
<void
>
Log API payload data
Parameters
Name | Type | Description |
---|---|---|
payload | OpenAILogData | The API request/response payload data |
type | "chat" | "stream" | Type of operation ('chat' or 'stream') |
Returns
Promise
<void
>