Operations
Reusable AI status, cache and content-gap operations.
Namespace: WebberZone\Better_Search\Pro\AI
Since: 4.5.0
Source: includes/pro/ai/class-operations.php line 19
Methods
__construct()
Constructor.
Line: 33
public function __construct( AI $ai );
| Type | Name | Description |
|---|---|---|
AI |
$ai |
AI module. |
get_status()
Get AI status without forcing a remote provider check.
Since: 4.5.0
Line: 44
public function get_status( ): array;
Returns: array — mixed> Status values.
check_provider()
Force a provider availability check.
Since: 4.5.0
Line: 69
public function check_provider( ): bool;
Returns: bool — Whether a suitable provider is available.
ask()
Ask a question through the same handler used by the REST endpoint and ability.
Since: 4.5.0
Line: 81
public function ask( string $question ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
string |
$question |
Question text. |
Returns: array|\WP_Error — Answer data or an error.
clear_cache()
Clear cached answers and provider state.
Since: 4.5.0
Line: 92
public function clear_cache( ): bool;
Returns: bool — True when complete.
get_gaps()
Get grouped unanswered questions.
Since: 4.5.0
Line: 108
public function get_gaps( string $from = ..., string $to = ..., int $limit = ..., int $page = ... ): array[]|\WP_Error;
| Type | Name | Description |
|---|---|---|
string |
$from |
Start date in site time. |
string |
$to |
End date in site time. |
int |
$limit |
Maximum rows. Zero returns all rows. |
int |
$page |
Page number. |
Returns: array[]|\WP_Error — Unanswered question groups or a validation error.
clear_gaps()
Clear recorded questions.
Since: 4.5.0
Line: 124
public function clear_gaps( ): int;
Returns: int — Number of deleted rows.
validate_range()
Resolve a site-time date range to full GMT days.
Since: 4.5.0
Line: 137
public function validate_range( string $from = ..., string $to = ... ): array<string,;
| Type | Name | Description |
|---|---|---|
string |
$from |
Start date in Y-m-d format. |
string |
$to |
End date in Y-m-d format. |
Returns: array<string, — string>|\WP_Error Date range or validation error.