1. Go to this page and download the library: Download chubes4/ai-http-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Get all registered tools
$all_tools = apply_filters('chubes_ai_tools', []);
// Pass tools to AI request
$response = apply_filters('chubes_ai_request', $request, 'openai', null, $tools);
// Note: Tool execution is handled by consuming plugins
class AI_HTTP_MyProvider {
public function __construct($config = []) { /* Provider setup */ }
public function is_configured() { /* Check if ready */ }
public function request($standard_request) { /* Standard → Provider → Standard */ }
public function streaming_request($standard_request, $callback) { /* Streaming support */ }
public function get_normalized_models() { /* Get models for UI */ }
public function get_raw_models() { /* Get raw API response */ }
}
// Self-register via filter
add_filter('chubes_ai_providers', function($providers) {
$providers['myprovider'] = [
'class' => 'AI_HTTP_MyProvider',
'type' => 'llm',
'name' => 'My Provider'
];
return $providers;
});