Skip to content

Responses

OpenPO returns a custom response from completions that is compatible with OpenAI chat completion response.

ChatCompletionOutput

class ChatCompletionOutput:
    id: str,
    provider: str,
    model: str,
    object: 'chat.completion' | 'chat.completion.chunk',
    created: int,
    choices: ChatCompletionOutputComplete,
    usage: ChatCompletionOutputUsage
class ChatCompletionOutputComplete
    finish_reason: str,
    index: int,
    message: ChatCompletionOutputMessage,
    lobprobs: bool,
class ChatCompletionOutputUsage:
    completion_tokens: int
    prompt_tokens: int
    total_tokens: int