Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/blueversionx/wp-content/plugins/ai-engine/labs/ |
Upload File : |
<?php
/**
* Availability check. Scoped: configured iff AI Engine has an env of the
* given type with a key (or no key needed, like Ollama). Unscoped: any env.
*/
use WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface;
class Meow_MWAI_Labs_WPAI_Gateway_Availability implements ProviderAvailabilityInterface {
private ?string $engine_type;
public function __construct( ?string $engine_type = null ) {
$this->engine_type = $engine_type;
}
public function isConfigured(): bool {
$core = Meow_MWAI_Labs_WPAI_Gateway::$core;
if ( ! $core ) {
return false;
}
$options = $core->get_all_options();
if ( empty( $options['ai_envs'] ) ) {
return false;
}
foreach ( $options['ai_envs'] as $env ) {
$type = $env['type'] ?? '';
if ( $this->engine_type !== null && $type !== $this->engine_type ) {
continue;
}
$key = $env['apikey'] ?? '';
if ( $type === 'ollama' || ! empty( $key ) ) {
return true;
}
}
return false;
}
}