Skip to content

Commit 47dd1d8

Browse files
OskarStarkchr-hertel
authored andcommitted
refactor: rename GOOGLE_API_KEY to GEMINI_API_KEY
1 parent 58186ba commit 47dd1d8

11 files changed

+31
-31
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ PINECONE_HOST=
6363
RUN_EXPENSIVE_EXAMPLES=false
6464

6565
# For using Gemini
66-
GOOGLE_API_KEY=
66+
GEMINI_API_KEY=
6767

6868
# For MariaDB store. Server defined in compose.yaml
6969
MARIADB_URI=pdo-mysql://[email protected]:3309/my_database

examples/google/audio-input.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1212
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1313

14-
if (empty($_ENV['GOOGLE_API_KEY'])) {
15-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
14+
if (empty($_ENV['GEMINI_API_KEY'])) {
15+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1616
exit(1);
1717
}
1818

19-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
19+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2020
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
2121

2222
$chain = new Chain($platform, $model);

examples/google/chat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1111
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1212

13-
if (empty($_ENV['GOOGLE_API_KEY'])) {
14-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
13+
if (empty($_ENV['GEMINI_API_KEY'])) {
14+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1515
exit(1);
1616
}
1717

18-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
18+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
1919
$model = new Gemini(Gemini::GEMINI_2_FLASH);
2020

2121
$chain = new Chain($platform, $model);

examples/google/image-input.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1212
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1313

14-
if (empty($_ENV['GOOGLE_API_KEY'])) {
15-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
14+
if (empty($_ENV['GEMINI_API_KEY'])) {
15+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1616
exit(1);
1717
}
1818

19-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
19+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2020
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
2121

2222
$chain = new Chain($platform, $model);

examples/google/pdf-input-binary.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1212
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1313

14-
if (empty($_ENV['GOOGLE_API_KEY'])) {
15-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
14+
if (empty($_ENV['GEMINI_API_KEY'])) {
15+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1616
exit(1);
1717
}
1818

19-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
19+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2020
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
2121

2222
$chain = new Chain($platform, $model);

examples/google/server-tools.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1414
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1515

16-
if (empty($_ENV['GOOGLE_API_KEY'])) {
17-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
16+
if (empty($_ENV['GEMINI_API_KEY'])) {
17+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1818
exit(1);
1919
}
2020

21-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
21+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2222

2323
// Available server-side tools as of 2025-06-28: url_context, google_search, code_execution
2424
$llm = new Gemini('gemini-2.5-pro-preview-03-25', ['server_tools' => ['url_context' => true], 'temperature' => 1.0]);

examples/google/stream.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1111
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1212

13-
if (empty($_ENV['GOOGLE_API_KEY'])) {
14-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
13+
if (empty($_ENV['GEMINI_API_KEY'])) {
14+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1515
exit(1);
1616
}
1717

18-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
18+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
1919
$model = new Gemini(Gemini::GEMINI_2_FLASH);
2020

2121
$chain = new Chain($platform, $model);

examples/google/structured-output-clock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1616
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1717

18-
if (empty($_ENV['GOOGLE_API_KEY'])) {
19-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
18+
if (empty($_ENV['GEMINI_API_KEY'])) {
19+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2020
exit(1);
2121
}
2222

23-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
23+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2424
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
2525

2626
$clock = new Clock(new SymfonyClock());

examples/google/structured-output-math.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1313
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1414

15-
if (empty($_ENV['GOOGLE_API_KEY'])) {
16-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
15+
if (empty($_ENV['GEMINI_API_KEY'])) {
16+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1717
exit(1);
1818
}
1919

20-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
20+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2121
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
2222

2323
$processor = new ChainProcessor();

examples/google/toolcall.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
1414
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
1515

16-
if (empty($_ENV['GOOGLE_API_KEY'])) {
17-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
16+
if (empty($_ENV['GEMINI_API_KEY'])) {
17+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
1818
exit(1);
1919
}
2020

21-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
21+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2222
$llm = new Gemini(Gemini::GEMINI_2_FLASH);
2323

2424
$toolbox = Toolbox::create(new Clock());

0 commit comments

Comments
 (0)