api_key = $api_key; $this->model = $model; } public function get_api_url(): string { return "https://generativelanguage.googleapis.com/v1beta/models/{$this->model}:generateContent?key={$this->api_key}"; } public function get_headers(): array { return [ 'Content-Type' => 'application/json', ]; } public function prepare_payload(string $prompt): array { return [ 'contents' => [ [ 'parts' => [ ['text' => $prompt] ] ] ] ]; } }