RetrieverService.fromApiKey constructor
RetrieverService.fromApiKey([
- String? apiKey
Creates a RetrieverService that does authentication through an API key.
If called without arguments, the API key is taken from these environment variables:
GOOGLE_API_KEYGEMINI_API_KEY
Throws ConfigurationException if called without arguments and none of
the above environment variables are set. On the web,
always throws ConfigurationException if called without arguments.
See API Keys Overview.
Implementation
factory RetrieverService.fromApiKey([String? apiKey]) =>
RetrieverService(client: httpClientFromApiKey(apiKey, _apiKeys));