| BaseAPIProcessor | R Documentation |
Base API Processor Class
Base API Processor Class
Abstract base class for API processors that provides common functionality including unified logging, error handling, input processing, and response validation. This eliminates code duplication across all provider-specific processors.
provider_nameName of the API provider
loggerUnified logger instance
base_urlCustom base URL for API endpoints
new()Initialize the base API processor
BaseAPIProcessor$new(provider_name, base_url = NULL)
process_request()Main entry point for processing API requests
BaseAPIProcessor$process_request(prompt, model, api_key)
get_api_url()Get the API URL to use for requests
BaseAPIProcessor$get_api_url()
get_default_api_url()Abstract method to be implemented by subclasses for getting default API URL
BaseAPIProcessor$get_default_api_url()
make_api_call()Abstract method to be implemented by subclasses for making the actual API call
BaseAPIProcessor$make_api_call(chunk_content, model, api_key)
extract_response_content()Abstract method to be implemented by subclasses for extracting content from response Make API call and extract response content
BaseAPIProcessor$extract_response_content(response, model)
clone()The objects of this class are cloneable with this method.
BaseAPIProcessor$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.