-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathplugin.php
More file actions
54 lines (43 loc) · 1.21 KB
/
plugin.php
File metadata and controls
54 lines (43 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Plugin Name: AI Provider for Anthropic
* Plugin URI: https://github.com/WordPress/ai-provider-for-anthropic
* Description: AI Provider for Anthropic for the WordPress AI Client.
* Requires at least: 6.9
* Requires PHP: 7.4
* Version: 1.0.2
* Author: WordPress AI Team
* Author URI: https://make.wordpress.org/ai/
* License: GPL-2.0-or-later
* License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
* Text Domain: ai-provider-for-anthropic
*
* @package WordPress\AnthropicAiProvider
*/
declare(strict_types=1);
namespace WordPress\AnthropicAiProvider;
use WordPress\AiClient\AiClient;
use WordPress\AnthropicAiProvider\Provider\AnthropicProvider;
if (!defined('ABSPATH')) {
return;
}
require_once __DIR__ . '/src/autoload.php';
/**
* Registers the AI Provider for Anthropic with the AI Client.
*
* @since 1.0.0
*
* @return void
*/
function register_provider(): void
{
if (!class_exists(AiClient::class)) {
return;
}
$registry = AiClient::defaultRegistry();
if ($registry->hasProvider(AnthropicProvider::class)) {
return;
}
$registry->registerProvider(AnthropicProvider::class);
}
add_action('init', __NAMESPACE__ . '\\register_provider', 5);