Qwen API Processor
Qwen API Processor
mLLMCelltype::BaseAPIProcessor -> QwenProcessor
new()Test if an endpoint is accessible
Initialize Qwen processor
QwenProcessor$new(base_url = NULL)base_urlOptional custom base URL for Qwen API
urlThe endpoint URL to test
api_keyAPI key for authentication
TRUE if accessible, FALSE otherwise
get_default_api_url()Get default Qwen API URL with intelligent endpoint selection
QwenProcessor$get_default_api_url()Default Qwen API endpoint URL
get_working_api_url()Get working Qwen API URL with automatic endpoint detection
QwenProcessor$get_working_api_url(api_key)api_keyAPI key for testing endpoints
Working Qwen API endpoint URL
make_api_call()Make API call to Qwen
QwenProcessor$make_api_call(chunk_content, model, api_key)chunk_contentContent for this chunk
modelModel identifier
api_keyAPI key
httr response object
extract_response_content()Extract response content from Qwen API response
QwenProcessor$extract_response_content(response, model)responsehttr response object
modelModel identifier
Extracted text content
clone()The objects of this class are cloneable with this method.
QwenProcessor$clone(deep = FALSE)deepWhether to make a deep clone.
Concrete implementation of BaseAPIProcessor for Qwen models. Handles Qwen-specific API calls, authentication, and response parsing.
Qwen has two API endpoints:
International: https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text-generation/generation (preferred)
Domestic (China): https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation (fallback) The processor automatically tries international first, then falls back to domestic if needed.