class Riffer::Providers::Base

Base class for all LLM providers in the Riffer framework.

Provides a template-method flow for text generation and streaming. Subclasses implement five hook methods; the base class orchestrates them.

Hook methods

build_request_params

convert messages, tools, and options into SDK params

execute_generate

call the SDK and return the raw response

execute_stream

call the streaming SDK, mapping events to the yielder

extract_token_usage

pull token counts from the SDK response

extract_content

extract text content from the SDK response

extract_tool_calls

extract tool calls from the SDK response