Skip to content

Commit e39641d

Browse files
committed
minor #65 refactor: rename GOOGLE_API_KEY to GEMINI_API_KEY (OskarStark)
This PR was merged into the main branch. Discussion ---------- refactor: rename `GOOGLE_API_KEY` to `GEMINI_API_KEY` | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#369 Commits ------- c77c4b5 refactor: rename `GOOGLE_API_KEY` to `GEMINI_API_KEY` (#369)
2 parents 04501a0 + c77c4b5 commit e39641d

11 files changed

+31
-31
lines changed

examples/.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
@@ -20,12 +20,12 @@
2020
require_once dirname(__DIR__).'/vendor/autoload.php';
2121
(new Dotenv())->loadEnv(dirname(__DIR__).'/.env');
2222

23-
if (empty($_ENV['GOOGLE_API_KEY'])) {
24-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
23+
if (empty($_ENV['GEMINI_API_KEY'])) {
24+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2525
exit(1);
2626
}
2727

28-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
28+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2929
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
3030

3131
$agent = new Agent($platform, $model);

examples/google/chat.php

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

22-
if (empty($_ENV['GOOGLE_API_KEY'])) {
23-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
22+
if (empty($_ENV['GEMINI_API_KEY'])) {
23+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2424
exit(1);
2525
}
2626

27-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
27+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2828
$model = new Gemini(Gemini::GEMINI_2_FLASH);
2929

3030
$agent = new Agent($platform, $model);

examples/google/image-input.php

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

23-
if (empty($_ENV['GOOGLE_API_KEY'])) {
24-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
23+
if (empty($_ENV['GEMINI_API_KEY'])) {
24+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2525
exit(1);
2626
}
2727

28-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
28+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2929
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
3030

3131
$agent = new Agent($platform, $model);

examples/google/pdf-input-binary.php

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

23-
if (empty($_ENV['GOOGLE_API_KEY'])) {
24-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
23+
if (empty($_ENV['GEMINI_API_KEY'])) {
24+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2525
exit(1);
2626
}
2727

28-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
28+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2929
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
3030

3131
$agent = new Agent($platform, $model);

examples/google/server-tools.php

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

25-
if (empty($_ENV['GOOGLE_API_KEY'])) {
26-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
25+
if (empty($_ENV['GEMINI_API_KEY'])) {
26+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2727
exit(1);
2828
}
2929

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

3232
// Available server-side tools as of 2025-06-28: url_context, google_search, code_execution
3333
$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
@@ -19,12 +19,12 @@
1919
require_once dirname(__DIR__).'/vendor/autoload.php';
2020
(new Dotenv())->loadEnv(dirname(__DIR__).'/.env');
2121

22-
if (empty($_ENV['GOOGLE_API_KEY'])) {
23-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
22+
if (empty($_ENV['GEMINI_API_KEY'])) {
23+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2424
exit(1);
2525
}
2626

27-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
27+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
2828
$model = new Gemini(Gemini::GEMINI_2_FLASH);
2929

3030
$agent = new Agent($platform, $model);

examples/google/structured-output-clock.php

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

27-
if (empty($_ENV['GOOGLE_API_KEY'])) {
28-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
27+
if (empty($_ENV['GEMINI_API_KEY'])) {
28+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2929
exit(1);
3030
}
3131

32-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
32+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
3333
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
3434

3535
$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
@@ -21,12 +21,12 @@
2121
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
2222
(new Dotenv())->loadEnv(dirname(__DIR__, 2).'/.env');
2323

24-
if (empty($_ENV['GOOGLE_API_KEY'])) {
25-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
24+
if (empty($_ENV['GEMINI_API_KEY'])) {
25+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2626
exit(1);
2727
}
2828

29-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
29+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
3030
$model = new Gemini(Gemini::GEMINI_1_5_FLASH);
3131

3232
$processor = new AgentProcessor();

examples/google/toolcall.php

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

25-
if (empty($_ENV['GOOGLE_API_KEY'])) {
26-
echo 'Please set the GOOGLE_API_KEY environment variable.'.\PHP_EOL;
25+
if (empty($_ENV['GEMINI_API_KEY'])) {
26+
echo 'Please set the GEMINI_API_KEY environment variable.'.\PHP_EOL;
2727
exit(1);
2828
}
2929

30-
$platform = PlatformFactory::create($_ENV['GOOGLE_API_KEY']);
30+
$platform = PlatformFactory::create($_ENV['GEMINI_API_KEY']);
3131
$llm = new Gemini(Gemini::GEMINI_2_FLASH);
3232

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

0 commit comments

Comments
 (0)