new GoogleAI(), 'vertex-ai' => new VertexAI(), 'huggingface' => new HuggingFace(), 'cf-workers-ai' => new CloudflareWorkersAI(), 'anthropic' => new Anthropic(), default => new OpenAI(), }; } public static function genTextResponse(string $q): string { if ($q === '') { return 'No question provided'; } return self::getClient()->textPrompt($q); } public static function genTextResponseWithContext(string $q, array $context = []): string { if ($q === '') { return 'No question provided'; } if ($context === []) { return self::getClient()->textPrompt($q); } return self::getClient()->textPromptWithContext($q, $context); } }