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_url
Optional custom base URL for Qwen API
url
The endpoint URL to test
api_key
API 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_key
API 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_content
Content for this chunk
model
Model identifier
api_key
API key
httr response object
extract_response_content()
Extract response content from Qwen API response
QwenProcessor$extract_response_content(response, model)
response
httr response object
model
Model identifier
Extracted text content
clone()
The objects of this class are cloneable with this method.
QwenProcessor$clone(deep = FALSE)
deep
Whether 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.