Module: Raif::Concerns::Llms::OpenAiCompletions::Protocol
- Extended by:
- ActiveSupport::Concern
- Includes:
- Raif::Concerns::Llms::OpenAi::JsonSchemaValidation, MessageFormatting, ResponseToolCalls, ToolFormatting
- Included in:
- Llms::BedrockMantle, Llms::OpenAiCompletions, Llms::XAi
- Defined in:
- app/models/raif/concerns/llms/open_ai_completions/protocol.rb
Overview
The parts of the OpenAI Chat Completions protocol that every adapter speaking it must build identically: tool parameters, streaming flags, response_format, and the mapping from a response body onto a Raif::ModelCompletion. Adapters compose these from their own build_request_parameters, which keeps the provider-specific base parameters (model name, system prompt shaping, temperature, max_tokens) visible in the adapter while the shared pieces cannot drift between OpenAiCompletions, XAi, and BedrockMantle.