Class: PromptBuilder::Serializers::ChatCompletion::Response

Inherits:
Base
  • Object
show all
Defined in:
lib/prompt_builder/serializers/chat_completion/response.rb

Overview

Response parser for the OpenAI Chat Completions API format.

Responses with multiple choices (+n > 1+) parse only the first choice; the canonical response object has no candidate collection. Audio responses, legacy function_call responses, non-function tool calls, and unknown content block types are silently skipped. Streaming chunks (chat.completion.chunk deltas) raise UnsupportedFormatError — this parser expects a fully assembled non-streaming response body. Top-level system_fingerprint is exposed through extra.

Method Summary

Methods inherited from Base

parse_response, request_payload