Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit ce89797

Browse files
authored
refactor: rename Runtime to Platform (#34)
1 parent a9d5831 commit ce89797

19 files changed

+60
-60
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ composer require php-llm/llm-chain
2121

2222
When using Symfony Framework, check out the integration bundle [php-llm/llm-chain-bundle](https://github.com/php-llm/llm-chain-bundle).
2323

24-
Supported Models & Runtimes
25-
---------------------------
24+
Supported Models & Platforms
25+
----------------------------
2626

27-
Currently supported models and runtimes:
27+
Currently supported models and platforms:
2828

29-
| Vendor | Model | Runtime |
30-
|----------------|------------------------|----------------------------------|
31-
| **OpenAI** | - GPT<br/>- Embeddings | - OpenAI<br/>- Azure |
32-
| **Anthropic** | - Claude | - Anthropic |
29+
| Vendor | Model | Platform |
30+
|----------------|------------------------|----------------------|
31+
| **OpenAI** | - GPT<br/>- Embeddings | - OpenAI<br/>- Azure |
32+
| **Anthropic** | - Claude | - Anthropic |
3333

34-
Planned Models & Runtimes (not implemented yet):
34+
Planned Models & Platforms (not implemented yet):
3535

36-
| Vendor | Model | Runtime |
36+
| Vendor | Model | Platform |
3737
|----------------|------------------------|----------------------------------|
3838
| **Anthropic** | - Voyage | - GPC<br/>- AWS |
3939
| **Google** | - Gemini<br/>- Gemma | - GPC |

examples/chat-claude-anthropic.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

33
use PhpLlm\LlmChain\Anthropic\Model\Claude;
4-
use PhpLlm\LlmChain\Anthropic\Runtime\Anthropic;
4+
use PhpLlm\LlmChain\Anthropic\Platform\Anthropic;
55
use PhpLlm\LlmChain\Chain;
66
use PhpLlm\LlmChain\Message\Message;
77
use PhpLlm\LlmChain\Message\MessageBag;
88
use Symfony\Component\HttpClient\HttpClient;
99

1010
require_once dirname(__DIR__).'/vendor/autoload.php';
1111

12-
$runtime = new Anthropic(HttpClient::create(), getenv('ANTHROPIC_API_KEY'));
13-
$llm = new Claude($runtime);
12+
$platform = new Anthropic(HttpClient::create(), getenv('ANTHROPIC_API_KEY'));
13+
$llm = new Claude($platform);
1414

1515
$chain = new Chain($llm);
1616
$messages = new MessageBag(

examples/chat-gpt-azure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\Azure;
8+
use PhpLlm\LlmChain\OpenAI\Platform\Azure;
99
use Symfony\Component\HttpClient\HttpClient;
1010

1111
require_once dirname(__DIR__).'/vendor/autoload.php';
1212

13-
$runtime = new Azure(HttpClient::create(),
13+
$platform = new Azure(HttpClient::create(),
1414
getenv('AZURE_OPENAI_BASEURL'),
1515
getenv('AZURE_OPENAI_DEPLOYMENT'),
1616
getenv('AZURE_OPENAI_VERSION'),
1717
getenv('AZURE_OPENAI_KEY')
1818
);
19-
$llm = new Gpt($runtime, Version::gpt4oMini());
19+
$llm = new Gpt($platform, Version::gpt4oMini());
2020

2121
$chain = new Chain($llm);
2222
$messages = new MessageBag(

examples/chat-gpt-openai.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use Symfony\Component\HttpClient\HttpClient;
1010

1111
require_once dirname(__DIR__).'/vendor/autoload.php';
1212

13-
$runtime = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
14-
$llm = new Gpt($runtime, Version::gpt4oMini());
13+
$platform = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
14+
$llm = new Gpt($platform, Version::gpt4oMini());
1515

1616
$chain = new Chain($llm);
1717
$messages = new MessageBag(

examples/structured-output-math.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\StructuredOutput\ResponseFormatFactory;
1010
use PhpLlm\LlmChain\StructuredOutput\SchemaFactory;
1111
use PhpLlm\LlmChain\Tests\StructuredOutput\Data\MathReasoning;
@@ -16,8 +16,8 @@
1616

1717
require_once dirname(__DIR__).'/vendor/autoload.php';
1818

19-
$runtime = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
20-
$llm = new Gpt($runtime, Version::gpt4oMini());
19+
$platform = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
20+
$llm = new Gpt($platform, Version::gpt4oMini());
2121
$responseFormatFactory = new ResponseFormatFactory(SchemaFactory::create());
2222
$serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]);
2323

examples/toolbox-clock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\ToolBox\Tool\Clock;
1010
use PhpLlm\LlmChain\ToolBox\ToolAnalyzer;
1111
use PhpLlm\LlmChain\ToolBox\ToolBox;
@@ -14,8 +14,8 @@
1414

1515
require_once dirname(__DIR__).'/vendor/autoload.php';
1616

17-
$runtime = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
18-
$llm = new Gpt($runtime, Version::gpt4oMini());
17+
$platform = new OpenAI(HttpClient::create(), getenv('OPENAI_API_KEY'));
18+
$llm = new Gpt($platform, Version::gpt4oMini());
1919

2020
$clock = new Clock(new SymfonyClock());
2121
$toolBox = new ToolBox(new ToolAnalyzer(), [$clock]);

examples/toolbox-serpapi.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\ToolBox\Tool\SerpApi;
1010
use PhpLlm\LlmChain\ToolBox\ToolAnalyzer;
1111
use PhpLlm\LlmChain\ToolBox\ToolBox;
@@ -14,8 +14,8 @@
1414
require_once dirname(__DIR__).'/vendor/autoload.php';
1515

1616
$httpClient = HttpClient::create();
17-
$runtime = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18-
$llm = new Gpt($runtime, Version::gpt4oMini());
17+
$platform = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18+
$llm = new Gpt($platform, Version::gpt4oMini());
1919

2020
$serpApi = new SerpApi($httpClient, getenv('SERP_API_KEY'));
2121
$toolBox = new ToolBox(new ToolAnalyzer(), [$serpApi]);

examples/toolbox-weather.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\ToolBox\Tool\OpenMeteo;
1010
use PhpLlm\LlmChain\ToolBox\ToolAnalyzer;
1111
use PhpLlm\LlmChain\ToolBox\ToolBox;
@@ -14,8 +14,8 @@
1414
require_once dirname(__DIR__).'/vendor/autoload.php';
1515

1616
$httpClient = HttpClient::create();
17-
$runtime = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18-
$llm = new Gpt($runtime, Version::gpt4oMini());
17+
$platform = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18+
$llm = new Gpt($platform, Version::gpt4oMini());
1919

2020
$wikipedia = new OpenMeteo($httpClient);
2121
$toolBox = new ToolBox(new ToolAnalyzer(), [$wikipedia]);

examples/toolbox-wikipedia.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\ToolBox\Tool\Wikipedia;
1010
use PhpLlm\LlmChain\ToolBox\ToolAnalyzer;
1111
use PhpLlm\LlmChain\ToolBox\ToolBox;
@@ -14,8 +14,8 @@
1414
require_once dirname(__DIR__).'/vendor/autoload.php';
1515

1616
$httpClient = HttpClient::create();
17-
$runtime = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18-
$llm = new Gpt($runtime, Version::gpt4oMini());
17+
$platform = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18+
$llm = new Gpt($platform, Version::gpt4oMini());
1919

2020
$wikipedia = new Wikipedia($httpClient);
2121
$toolBox = new ToolBox(new ToolAnalyzer(), [$wikipedia]);

examples/toolbox-youtube.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpLlm\LlmChain\Message\MessageBag;
66
use PhpLlm\LlmChain\OpenAI\Model\Gpt;
77
use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version;
8-
use PhpLlm\LlmChain\OpenAI\Runtime\OpenAI;
8+
use PhpLlm\LlmChain\OpenAI\Platform\OpenAI;
99
use PhpLlm\LlmChain\ToolBox\Tool\YouTubeTranscriber;
1010
use PhpLlm\LlmChain\ToolBox\ToolAnalyzer;
1111
use PhpLlm\LlmChain\ToolBox\ToolBox;
@@ -14,8 +14,8 @@
1414
require_once dirname(__DIR__).'/vendor/autoload.php';
1515

1616
$httpClient = HttpClient::create();
17-
$runtime = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18-
$llm = new Gpt($runtime, Version::gpt4oMini());
17+
$platform = new OpenAI($httpClient, getenv('OPENAI_API_KEY'));
18+
$llm = new Gpt($platform, Version::gpt4oMini());
1919

2020
$transcriber = new YouTubeTranscriber($httpClient);
2121
$toolBox = new ToolBox(new ToolAnalyzer(), [$transcriber]);

0 commit comments

Comments
 (0)