Skip to content

Commit 9037ede

Browse files
authored
Merge pull request #23 from WordPress/prepare/0.1.0-release
Prepare initial release by bumping version to 0.1.0
2 parents ea9e742 + 854bd5f commit 9037ede

File tree

8 files changed

+56
-56
lines changed

8 files changed

+56
-56
lines changed

includes/AI_Client.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Class WordPress\AI_Client\AI_Client
44
*
5-
* @since n.e.x.t
6-
* @package wp-ai-client
5+
* @since 0.1.0
6+
* @package WordPress\AI_Client
77
*/
88

99
namespace WordPress\AI_Client;
@@ -17,7 +17,7 @@
1717
/**
1818
* Main AI Client class providing fluent APIs for AI operations.
1919
*
20-
* @since n.e.x.t
20+
* @since 0.1.0
2121
*
2222
* @phpstan-import-type Prompt from Prompt_Builder
2323
*/
@@ -26,7 +26,7 @@ class AI_Client {
2626
/**
2727
* Indicates whether the AI Client package has been initialized.
2828
*
29-
* @since n.e.x.t
29+
* @since 0.1.0
3030
* @var bool
3131
*/
3232
private static bool $initialized = false;
@@ -36,7 +36,7 @@ class AI_Client {
3636
*
3737
* This method needs to be called by the consumer of this package, on the WordPress 'init' action hook.
3838
*
39-
* @since n.e.x.t
39+
* @since 0.1.0
4040
*/
4141
public static function init(): void {
4242
if ( self::$initialized ) {
@@ -56,7 +56,7 @@ public static function init(): void {
5656
/**
5757
* Creates a new prompt builder for fluent API usage.
5858
*
59-
* @since n.e.x.t
59+
* @since 0.1.0
6060
*
6161
* @param Prompt $prompt Optional initial prompt content.
6262
* @return Prompt_Builder The prompt builder instance.
@@ -66,7 +66,7 @@ public static function prompt( $prompt = null ): Prompt_Builder {
6666
_doing_it_wrong(
6767
__METHOD__,
6868
esc_html__( 'You must call AI_Client::init() on the WordPress "init" action hook before using the AI Client.', 'wp-ai-client' ),
69-
'n.e.x.t'
69+
'0.1.0'
7070
);
7171
}
7272
return new Prompt_Builder( AiClient::defaultRegistry(), $prompt );
@@ -75,7 +75,7 @@ public static function prompt( $prompt = null ): Prompt_Builder {
7575
/**
7676
* Creates a new prompt builder for fluent API usage, returning WP_Error on errors.
7777
*
78-
* @since n.e.x.t
78+
* @since 0.1.0
7979
*
8080
* @param Prompt $prompt Optional initial prompt content.
8181
* @return Prompt_Builder_With_WP_Error The prompt builder instance.
@@ -85,7 +85,7 @@ public static function prompt_with_wp_error( $prompt = null ): Prompt_Builder_Wi
8585
_doing_it_wrong(
8686
__METHOD__,
8787
esc_html__( 'You must call AI_Client::init() on the WordPress "init" action hook before using the AI Client.', 'wp-ai-client' ),
88-
'n.e.x.t'
88+
'0.1.0'
8989
);
9090
}
9191
return new Prompt_Builder_With_WP_Error( AiClient::defaultRegistry(), $prompt );

includes/API_Credentials/API_Credentials_Manager.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Class WordPress\AI_Client\API_Credentials\API_Credentials_Manager
44
*
5-
* @since n.e.x.t
6-
* @package wp-ai-client
5+
* @since 0.1.0
6+
* @package WordPress\AI_Client
77
*/
88

99
namespace WordPress\AI_Client\API_Credentials;
@@ -16,7 +16,7 @@
1616
/**
1717
* Class for managing the AI API credentials for the various providers.
1818
*
19-
* @since n.e.x.t
19+
* @since 0.1.0
2020
*
2121
* Note about PHPStan: Technically, we want `ProviderExtendedMetadataArrayShape` to be the intersection of
2222
* `ProviderMetadataArrayShape` and the additional `ai_client_classnames` field. However, PHPStan does not seem to
@@ -45,7 +45,7 @@ class API_Credentials_Manager {
4545
*
4646
* This method needs to be called by the consumer of this package, on the WordPress 'init' action hook.
4747
*
48-
* @since n.e.x.t
48+
* @since 0.1.0
4949
*/
5050
public function initialize(): void {
5151
$this->collect_providers();
@@ -75,7 +75,7 @@ function () {
7575
* provider ID, and for each provider metadata it also stores a map of the AiClient class names where the provider
7676
* is registered in.
7777
*
78-
* @since n.e.x.t
78+
* @since 0.1.0
7979
*
8080
* @throws RuntimeException If the collected provider metadata is in an invalid format.
8181
*/
@@ -128,7 +128,7 @@ private function collect_providers(): void {
128128
*
129129
* See {@see API_Credentials_Manager::collect_providers()} for details on how this works and why it uses a global.
130130
*
131-
* @since n.e.x.t
131+
* @since 0.1.0
132132
* @see API_Credentials_Manager::collect_providers()
133133
*
134134
* @return array<string, ProviderMetadata> Array of provider metadata objects, keyed by provider ID.
@@ -157,7 +157,7 @@ static function ( array $provider_metadata ) {
157157
/**
158158
* Returns the metadata for all registered cloud providers across all instances of the PHP AI Client SDK.
159159
*
160-
* @since n.e.x.t
160+
* @since 0.1.0
161161
*
162162
* @return array<string, ProviderMetadata> Array of cloud provider metadata objects, keyed by provider ID.
163163
*/
@@ -177,7 +177,7 @@ static function ( ProviderMetadata $metadata ) {
177177
*
178178
* The setting will only be registered once, even if the class is used multiple times.
179179
*
180-
* @since n.e.x.t
180+
* @since 0.1.0
181181
*/
182182
private function register_settings(): void {
183183
// Avoid registering the setting multiple times.
@@ -219,7 +219,7 @@ private function register_settings(): void {
219219
*
220220
* This method should be called on every request, before any API requests are made via the PHP AI Client SDK.
221221
*
222-
* @since n.e.x.t
222+
* @since 0.1.0
223223
*
224224
* @throws RuntimeException If the stored credentials option is in an invalid format.
225225
*/
@@ -253,7 +253,7 @@ private function pass_credentials_to_client(): void {
253253
*
254254
* The screen will only be added once, even if the class is used multiple times.
255255
*
256-
* @since n.e.x.t
256+
* @since 0.1.0
257257
*/
258258
private function add_admin_screen(): void {
259259
global $_wp_submenu_nopriv, $_parent_pages;

includes/API_Credentials/API_Credentials_Settings_Screen.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Class WordPress\AI_Client\API_Credentials\API_Credentials_Settings_Screen
44
*
5-
* @since n.e.x.t
6-
* @package wp-ai-client
5+
* @since 0.1.0
6+
* @package WordPress\AI_Client
77
*/
88

99
namespace WordPress\AI_Client\API_Credentials;
@@ -13,62 +13,62 @@
1313
/**
1414
* Class for a settings screen which displays AI provider API credentials fields.
1515
*
16-
* @since n.e.x.t
16+
* @since 0.1.0
1717
*/
1818
class API_Credentials_Settings_Screen {
1919

2020
/**
2121
* The screen slug.
2222
*
23-
* @since n.e.x.t
23+
* @since 0.1.0
2424
* @var string
2525
*/
2626
private string $screen_slug;
2727

2828
/**
2929
* The screen title.
3030
*
31-
* @since n.e.x.t
31+
* @since 0.1.0
3232
* @var string
3333
*/
3434
private string $screen_title;
3535

3636
/**
3737
* The screen description.
3838
*
39-
* @since n.e.x.t
39+
* @since 0.1.0
4040
* @var string
4141
*/
4242
private string $screen_description;
4343

4444
/**
4545
* The option group for the settings.
4646
*
47-
* @since n.e.x.t
47+
* @since 0.1.0
4848
* @var string
4949
*/
5050
private string $option_group;
5151

5252
/**
5353
* The option name for storing the provider credentials.
5454
*
55-
* @since n.e.x.t
55+
* @since 0.1.0
5656
* @var string
5757
*/
5858
private string $option_name;
5959

6060
/**
6161
* The providers metadata collected from the PHP AI Client SDK.
6262
*
63-
* @since n.e.x.t
63+
* @since 0.1.0
6464
* @var array<string, ProviderMetadata> An array of provider metadata, keyed by provider ID.
6565
*/
6666
private array $providers_metadata = array();
6767

6868
/**
6969
* Constructor.
7070
*
71-
* @since n.e.x.t
71+
* @since 0.1.0
7272
*
7373
* @param string $screen_slug The screen slug.
7474
* @param string $screen_title The screen title.
@@ -92,7 +92,7 @@ public function __construct( string $screen_slug, string $screen_title, string $
9292
* This method adds a settings section for provider API credentials, including a field for each provider that
9393
* requires API key authentication.
9494
*
95-
* @since n.e.x.t
95+
* @since 0.1.0
9696
*/
9797
public function initialize_screen(): void {
9898
$settings_section = 'wp-ai-client-provider-credentials';
@@ -164,7 +164,7 @@ function () {
164164
/**
165165
* Renders the provider settings screen.
166166
*
167-
* @since n.e.x.t
167+
* @since 0.1.0
168168
*/
169169
public function render_screen(): void {
170170
?>
@@ -185,7 +185,7 @@ public function render_screen(): void {
185185
/**
186186
* Renders a settings field based on the given arguments.
187187
*
188-
* @since n.e.x.t
188+
* @since 0.1.0
189189
*
190190
* @param array<string, string> $args Field arguments set up during `add_settings_field()`.
191191
*/
@@ -246,7 +246,7 @@ class="description"
246246
/**
247247
* Returns the allowed HTML tags and attributes for descriptions using wp_kses().
248248
*
249-
* @since n.e.x.t
249+
* @since 0.1.0
250250
*
251251
* @return array<string, array<string, mixed>> Allowed HTML tags and their attributes.
252252
*/

includes/Builders/Prompt_Builder.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Class WordPress\AI_Client\Builders\Prompt_Builder
44
*
5-
* @since n.e.x.t
6-
* @package wp-ai-client
5+
* @since 0.1.0
6+
* @package WordPress\AI_Client
77
*/
88

99
namespace WordPress\AI_Client\Builders;
@@ -35,7 +35,7 @@
3535
* It adds the necessary WordPress flavoring around it, e.g. follow WordPress Coding Standards, as well as
3636
* integrate with WordPress specific AI primitives such as the Abilities API.
3737
*
38-
* @since n.e.x.t
38+
* @since 0.1.0
3939
*
4040
* @method self with_text(string $text) Adds text to the current message.
4141
* @method self with_file($file, ?string $mimeType = null) Adds a file to the current message.
@@ -94,15 +94,15 @@ class Prompt_Builder {
9494
/**
9595
* Wrapped prompt builder instance.
9696
*
97-
* @since n.e.x.t
97+
* @since 0.1.0
9898
* @var PromptBuilder
9999
*/
100100
private PromptBuilder $builder;
101101

102102
/**
103103
* Constructor.
104104
*
105-
* @since n.e.x.t
105+
* @since 0.1.0
106106
*
107107
* @param ProviderRegistry $registry The provider registry for finding suitable models.
108108
* @param Prompt $prompt Optional initial prompt content.
@@ -116,7 +116,7 @@ public function __construct( ProviderRegistry $registry, $prompt = null ) {
116116
*
117117
* This allows WordPress developers to use snake_case naming conventions.
118118
*
119-
* @since n.e.x.t
119+
* @since 0.1.0
120120
*
121121
* @param string $name The method name in snake_case.
122122
* @param array<int, mixed> $arguments The method arguments.
@@ -137,7 +137,7 @@ public function __call( string $name, array $arguments ) {
137137
/**
138138
* Retrieves a callable for a given PHP AI Client SDK prompt builder method name.
139139
*
140-
* @since n.e.x.t
140+
* @since 0.1.0
141141
*
142142
* @param string $name The method name in snake_case.
143143
* @return callable The callable for the specified method.
@@ -164,7 +164,7 @@ protected function get_builder_callable( string $name ): callable {
164164
/**
165165
* Converts snake_case to camelCase.
166166
*
167-
* @since n.e.x.t
167+
* @since 0.1.0
168168
*
169169
* @param string $snake_case The snake_case string.
170170
* @return string The camelCase string.

includes/Builders/Prompt_Builder_With_WP_Error.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Class WordPress\AI_Client\Builders\Prompt_Builder_With_WP_Error
44
*
5-
* @since n.e.x.t
6-
* @package wp-ai-client
5+
* @since 0.1.0
6+
* @package WordPress\AI_Client
77
*/
88

99
namespace WordPress\AI_Client\Builders;
@@ -33,7 +33,7 @@
3333
* will be no-ops that just return the same error state instance. Only when a terminate method is called, the WP_Error
3434
* will be returned.
3535
*
36-
* @since n.e.x.t
36+
* @since 0.1.0
3737
*
3838
* @method self with_text(string $text) Adds text to the current message.
3939
* @method self with_file($file, ?string $mimeType = null) Adds a file to the current message.
@@ -87,7 +87,7 @@ class Prompt_Builder_With_WP_Error extends Prompt_Builder {
8787
/**
8888
* WordPress error instance, if any error occurred during method calls.
8989
*
90-
* @since n.e.x.t
90+
* @since 0.1.0
9191
* @var WP_Error|null
9292
*/
9393
private ?WP_Error $error = null;
@@ -97,7 +97,7 @@ class Prompt_Builder_With_WP_Error extends Prompt_Builder {
9797
*
9898
* Technically a map, simply for faster lookups.
9999
*
100-
* @since n.e.x.t
100+
* @since 0.1.0
101101
* @var array<string, bool>
102102
*/
103103
private static array $terminate_methods = array(
@@ -122,7 +122,7 @@ class Prompt_Builder_With_WP_Error extends Prompt_Builder {
122122
* This allows WordPress developers to use snake_case naming conventions. It also catches any exceptions thrown,
123123
* stores them, and returns a WP_Error when a terminate method is called.
124124
*
125-
* @since n.e.x.t
125+
* @since 0.1.0
126126
*
127127
* @param string $name The method name in snake_case.
128128
* @param array<int, mixed> $arguments The method arguments.
@@ -171,7 +171,7 @@ public function __call( string $name, array $arguments ) {
171171
/**
172172
* Checks if a method is a terminating method.
173173
*
174-
* @since n.e.x.t
174+
* @since 0.1.0
175175
*
176176
* @param string $name The method name.
177177
* @return bool True if the method is a terminating method, false otherwise.

0 commit comments

Comments
 (0)