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

Commit 2b74225

Browse files
committed
refactor: major structure refactoring
1 parent e7a5702 commit 2b74225

File tree

359 files changed

+4235
-2777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+4235
-2777
lines changed

README.md

Lines changed: 31 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ Those models are provided by different **platforms**, like OpenAI, Azure, Google
4545
#### Example Instantiation
4646

4747
```php
48-
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
49-
use PhpLlm\LlmChain\Bridge\OpenAI\GPT;
50-
use PhpLlm\LlmChain\Bridge\OpenAI\PlatformFactory;
48+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;use PhpLlm\LlmChain\Platform\Bridge\OpenAI\PlatformFactory;
5149

5250
// Platform: OpenAI
5351
$platform = PlatformFactory::create($_ENV['OPENAI_API_KEY']);
@@ -90,9 +88,7 @@ have different content types, like `Text`, `Image` or `Audio`.
9088
#### Example Chain call with messages
9189

9290
```php
93-
use PhpLlm\LlmChain\Chain;
94-
use PhpLlm\LlmChain\Model\Message\Message;
95-
use PhpLlm\LlmChain\Model\Message\MessageBag;
91+
use PhpLlm\LlmChain\Chain\Chain;use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;
9692

9793
// Platform & LLM instantiation
9894

@@ -219,8 +215,7 @@ partially support by LLMs like GPT.
219215
To leverage this, configure the `#[With]` attribute on the method arguments of your tool:
220216

221217
```php
222-
use PhpLlm\LlmChain\Chain\JsonSchema\Attribute\With;
223-
use PhpLlm\LlmChain\Chain\Toolbox\Attribute\AsTool;
218+
use PhpLlm\LlmChain\Chain\Toolbox\Attribute\AsTool;use PhpLlm\LlmChain\Platform\Contract\JsonSchema\Attribute\With;
224219

225220
#[AsTool('my_tool', 'Example tool with parameters requirements.')]
226221
final class MyTool
@@ -252,10 +247,10 @@ attribute to the class is not possible in those cases, but you can explicitly re
252247

253248
```php
254249
use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;
255-
use PhpLlm\LlmChain\Chain\Toolbox\MetadataFactory\MemoryFactory;
250+
use PhpLlm\LlmChain\Chain\Toolbox\ToolFactory\MemoryToolFactory;
256251
use Symfony\Component\Clock\Clock;
257252

258-
$metadataFactory = (new MemoryFactory())
253+
$metadataFactory = (new MemoryToolFactory())
259254
->addTool(Clock::class, 'clock', 'Get the current date and time', 'now');
260255
$toolbox = new Toolbox($metadataFactory, [new Clock()]);
261256
```
@@ -268,12 +263,12 @@ tools in the same chain - which even enables you to overwrite the pre-existing c
268263

269264
```php
270265
use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;
271-
use PhpLlm\LlmChain\Chain\Toolbox\MetadataFactory\ChainFactory;
272-
use PhpLlm\LlmChain\Chain\Toolbox\MetadataFactory\MemoryFactory;
273-
use PhpLlm\LlmChain\Chain\Toolbox\MetadataFactory\ReflectionFactory;
266+
use PhpLlm\LlmChain\Chain\Toolbox\ToolFactory\ChainFactory;
267+
use PhpLlm\LlmChain\Chain\Toolbox\ToolFactory\MemoryToolFactory;
268+
use PhpLlm\LlmChain\Chain\Toolbox\ToolFactory\ReflectionToolFactory;
274269

275-
$reflectionFactory = new ReflectionFactory(); // Register tools with #[AsTool] attribute
276-
$metadataFactory = (new MemoryFactory()) // Register or overwrite tools explicitly
270+
$reflectionFactory = new ReflectionToolFactory(); // Register tools with #[AsTool] attribute
271+
$metadataFactory = (new MemoryToolFactory()) // Register or overwrite tools explicitly
277272
->addTool(...);
278273
$toolbox = new Toolbox(new ChainFactory($metadataFactory, $reflectionFactory), [...]);
279274
```
@@ -287,14 +282,14 @@ Similar to third-party tools, you can also use a chain as a tool in another chai
287282
complex logic or to reuse a chain in multiple places or hide sub-chains from the LLM.
288283

289284
```php
290-
use PhpLlm\LlmChain\Chain\Toolbox\MetadataFactory\MemoryFactory;
285+
use PhpLlm\LlmChain\Chain\Toolbox\ToolFactory\MemoryToolFactory;
291286
use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;
292287
use PhpLlm\LlmChain\Chain\Toolbox\Tool\Chain;
293288

294289
// Chain was initialized before
295290

296291
$chainTool = new Chain($chain);
297-
$metadataFactory = (new MemoryFactory())
292+
$metadataFactory = (new MemoryToolFactory())
298293
->addTool($chainTool, 'research_agent', 'Meaningful description for sub-chain');
299294
$toolbox = new Toolbox($metadataFactory, [$chainTool]);
300295
```
@@ -362,12 +357,7 @@ For populating a vector store, LLM Chain provides the service `Embedder`, which
362357
`EmbeddingsModel` and one of `StoreInterface`, and works with a collection of `Document` objects as input:
363358

364359
```php
365-
use PhpLlm\LlmChain\Embedder;
366-
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
367-
use PhpLlm\LlmChain\Bridge\OpenAI\PlatformFactory;
368-
use PhpLlm\LlmChain\Bridge\Pinecone\Store;
369-
use Probots\Pinecone\Pinecone;
370-
use Symfony\Component\HttpClient\HttpClient;
360+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;use PhpLlm\LlmChain\Platform\Bridge\OpenAI\PlatformFactory;use PhpLlm\LlmChain\Store\Bridge\Pinecone\Store;use PhpLlm\LlmChain\Store\Embedder;use Probots\Pinecone\Pinecone;
371361

372362
$embedder = new Embedder(
373363
PlatformFactory::create($_ENV['OPENAI_API_KEY']),
@@ -380,8 +370,7 @@ $embedder->embed($documents);
380370
The collection of `Document` instances is usually created by text input of your domain entities:
381371

382372
```php
383-
use PhpLlm\LlmChain\Document\Metadata;
384-
use PhpLlm\LlmChain\Document\TextDocument;
373+
use PhpLlm\LlmChain\Store\Document\Metadata;use PhpLlm\LlmChain\Store\Document\TextDocument;
385374

386375
foreach ($entities as $entity) {
387376
$documents[] = new TextDocument(
@@ -399,12 +388,7 @@ In the end the chain is used in combination with a retrieval tool on top of the
399388
`SimilaritySearch` tool provided by the library:
400389

401390
```php
402-
use PhpLlm\LlmChain\Chain;
403-
use PhpLlm\LlmChain\Model\Message\Message;
404-
use PhpLlm\LlmChain\Model\Message\MessageBag;
405-
use PhpLlm\LlmChain\Chain\Toolbox\ChainProcessor;
406-
use PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch;
407-
use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;
391+
use PhpLlm\LlmChain\Chain\Chain;use PhpLlm\LlmChain\Chain\Toolbox\ChainProcessor;use PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch;use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;
408392

409393
// Initialize Platform & Models
410394

@@ -452,15 +436,7 @@ the response back to PHP objects.
452436
To achieve this, a specific chain processor needs to be registered:
453437
454438
```php
455-
use PhpLlm\LlmChain\Chain;
456-
use PhpLlm\LlmChain\Model\Message\Message;
457-
use PhpLlm\LlmChain\Model\Message\MessageBag;
458-
use PhpLlm\LlmChain\Chain\StructuredOutput\ChainProcessor;
459-
use PhpLlm\LlmChain\Chain\StructuredOutput\ResponseFormatFactory;
460-
use PhpLlm\LlmChain\Tests\Chain\StructuredOutput\Data\MathReasoning;
461-
use Symfony\Component\Serializer\Encoder\JsonEncoder;
462-
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
463-
use Symfony\Component\Serializer\Serializer;
439+
use PhpLlm\LlmChain\Chain\Chain;use PhpLlm\LlmChain\Chain\StructuredOutput\ChainProcessor;use PhpLlm\LlmChain\Chain\StructuredOutput\ResponseFormatFactory;use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;use PhpLlm\LlmChain\Tests\Chain\StructuredOutput\Data\MathReasoning;use Symfony\Component\Serializer\Encoder\JsonEncoder;use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;use Symfony\Component\Serializer\Serializer;
464440
465441
// Initialize Platform and LLM
466442
@@ -482,8 +458,7 @@ dump($response->getContent()); // returns an instance of `MathReasoning` class
482458
Also PHP array structures as `response_format` are supported, which also requires the chain processor mentioned above:
483459
484460
```php
485-
use PhpLlm\LlmChain\Model\Message\Message;
486-
use PhpLlm\LlmChain\Model\Message\MessageBag;
461+
use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;
487462
488463
// Initialize Platform, LLM and Chain with processors and Clock tool
489464
@@ -519,9 +494,7 @@ Since LLMs usually generate a response word by word, most of them also support s
519494
Events. LLM Chain supports that by abstracting the conversion and returning a Generator as content of the response.
520495
521496
```php
522-
use PhpLlm\LlmChain\Chain;
523-
use PhpLlm\LlmChain\Message\Message;
524-
use PhpLlm\LlmChain\Message\MessageBag;
497+
use PhpLlm\LlmChain\Chain\Chain;use PhpLlm\LlmChain\Message\Message;use PhpLlm\LlmChain\Message\MessageBag;
525498
526499
// Initialize Platform and LLM
527500
@@ -552,9 +525,7 @@ needs to be used.
552525
Some LLMs also support images as input, which LLM Chain supports as `Content` type within the `UserMessage`:
553526
554527
```php
555-
use PhpLlm\LlmChain\Model\Message\Content\Image;
556-
use PhpLlm\LlmChain\Model\Message\Message;
557-
use PhpLlm\LlmChain\Model\Message\MessageBag;
528+
use PhpLlm\LlmChain\Platform\Message\Content\Image;use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;
558529
559530
// Initialize Platform, LLM & Chain
560531
@@ -580,9 +551,7 @@ $response = $chain->call($messages);
580551
Similar to images, some LLMs also support audio as input, which is just another `Content` type within the `UserMessage`:
581552
582553
```php
583-
use PhpLlm\LlmChain\Model\Message\Content\Audio;
584-
use PhpLlm\LlmChain\Model\Message\Message;
585-
use PhpLlm\LlmChain\Model\Message\MessageBag;
554+
use PhpLlm\LlmChain\Platform\Message\Content\Audio;use PhpLlm\LlmChain\Platform\Message\Message;use PhpLlm\LlmChain\Platform\Message\MessageBag;
586555
587556
// Initialize Platform, LLM & Chain
588557
@@ -607,7 +576,7 @@ therefore LLM Chain implements a `EmbeddingsModel` interface with various models
607576
The standalone usage results in an `Vector` instance:
608577
609578
```php
610-
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
579+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;
611580
612581
// Initialize Platform
613582
@@ -656,7 +625,7 @@ The behavior of the Chain is extendable with services that implement `InputProce
656625
interface. They are provided while instantiating the Chain instance:
657626
658627
```php
659-
use PhpLlm\LlmChain\Chain;
628+
use PhpLlm\LlmChain\Chain\Chain;
660629
661630
// Initialize Platform, LLM and processors
662631
@@ -669,11 +638,9 @@ $chain = new Chain($platform, $model, $inputProcessors, $outputProcessors);
669638
able to mutate both on top of the `Input` instance provided.
670639
671640
```php
672-
use PhpLlm\LlmChain\Chain\Input;
673-
use PhpLlm\LlmChain\Chain\InputProcessor;
674-
use PhpLlm\LlmChain\Model\Message\AssistantMessage
641+
use PhpLlm\LlmChain\Chain\Input;use PhpLlm\LlmChain\Chain\InputProcessorInterface;use PhpLlm\LlmChain\Platform\Message\AssistantMessage;
675642
676-
final class MyProcessor implements InputProcessor
643+
final class MyProcessor implements InputProcessorInterface
677644
{
678645
public function processInput(Input $input): void
679646
{
@@ -694,11 +661,9 @@ final class MyProcessor implements InputProcessor
694661
mutate or replace the given response:
695662
696663
```php
697-
use PhpLlm\LlmChain\Chain\Output;
698-
use PhpLlm\LlmChain\Chain\OutputProcessor;
699-
use PhpLlm\LlmChain\Model\Message\AssistantMessage
664+
use PhpLlm\LlmChain\Chain\Output;use PhpLlm\LlmChain\Chain\OutputProcessorInterface;
700665
701-
final class MyProcessor implements OutputProcessor
666+
final class MyProcessor implements OutputProcessorInterface
702667
{
703668
public function processOutput(Output $out): void
704669
{
@@ -717,13 +682,9 @@ provided, in case the processor implemented the `ChainAwareProcessor` interface,
717682
`ChainAwareTrait`:
718683
719684
```php
720-
use PhpLlm\LlmChain\Chain\ChainAwareProcessor;
721-
use PhpLlm\LlmChain\Chain\ChainAwareTrait;
722-
use PhpLlm\LlmChain\Chain\Output;
723-
use PhpLlm\LlmChain\Chain\OutputProcessor;
724-
use PhpLlm\LlmChain\Model\Message\AssistantMessage
685+
use PhpLlm\LlmChain\Chain\ChainAwareProcessorInterface;use PhpLlm\LlmChain\Chain\ChainAwareTrait;use PhpLlm\LlmChain\Chain\Output;use PhpLlm\LlmChain\Chain\OutputProcessorInterface;
725686
726-
final class MyProcessor implements OutputProcessor, ChainAwareProcessor
687+
final class MyProcessor implements OutputProcessorInterface, ChainAwareProcessorInterface
727688
{
728689
use ChainAwareTrait;
729690
@@ -741,11 +702,9 @@ LLM Chain comes out of the box with an integration for [HuggingFace](https://hug
741702
hosting and sharing all kinds of models, including LLMs, embeddings, image generation, and classification models.
742703
743704
You can just instantiate the Platform with the corresponding HuggingFace bridge and use it with the `task` option:
705+
744706
```php
745-
use PhpLlm\LlmChain\Bridge\HuggingFace\Model;
746-
use PhpLlm\LlmChain\Bridge\HuggingFace\PlatformFactory;
747-
use PhpLlm\LlmChain\Bridge\HuggingFace\Task;
748-
use PhpLlm\LlmChain\Model\Message\Content\Image;
707+
use PhpLlm\LlmChain\Bridge\HuggingFace\Model;use PhpLlm\LlmChain\Platform\Bridge\HuggingFace\PlatformFactory;use PhpLlm\LlmChain\Platform\Bridge\HuggingFace\Task;use PhpLlm\LlmChain\Platform\Message\Content\Image;
749708
750709
$platform = PlatformFactory::create($apiKey);
751710
$model = new Model('facebook/detr-resnet-50');
@@ -789,9 +748,7 @@ and comes with an extra setup, see [TransformersPHP's Getting Starter](https://t
789748
The usage with LLM Chain is similar to the HuggingFace integration, and also requires the `task` option to be set:
790749

791750
```php
792-
use Codewithkyrian\Transformers\Pipelines\Task;
793-
use PhpLlm\LlmChain\Bridge\TransformersPHP\Model;
794-
use PhpLlm\LlmChain\Bridge\TransformersPHP\PlatformFactory;
751+
use Codewithkyrian\Transformers\Pipelines\Task;use PhpLlm\LlmChain\Bridge\TransformersPHP\Model;use PhpLlm\LlmChain\Platform\Bridge\TransformersPHP\PlatformFactory;
795752

796753
$platform = PlatformFactory::create();
797754
$model = new Model('Xenova/LaMini-Flan-T5-783M');

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"mongodb/mongodb": "^1.21",
4747
"php-cs-fixer/shim": "^3.70",
4848
"phpstan/phpstan": "^2.0",
49+
"phpstan/phpstan-symfony": "^2.0",
4950
"phpstan/phpstan-webmozart-assert": "^2.0",
5051
"phpunit/phpunit": "^11.5",
5152
"probots-io/pinecone-php": "^1.0",

examples/anthropic/chat.php

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

3-
use PhpLlm\LlmChain\Bridge\Anthropic\Claude;
4-
use PhpLlm\LlmChain\Bridge\Anthropic\PlatformFactory;
5-
use PhpLlm\LlmChain\Chain;
6-
use PhpLlm\LlmChain\Model\Message\Message;
7-
use PhpLlm\LlmChain\Model\Message\MessageBag;
3+
use PhpLlm\LlmChain\Chain\Chain;
4+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\Claude;
5+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\PlatformFactory;
6+
use PhpLlm\LlmChain\Platform\Message\Message;
7+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
88
use Symfony\Component\Dotenv\Dotenv;
99

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

examples/anthropic/stream.php

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

3-
use PhpLlm\LlmChain\Bridge\Anthropic\Claude;
4-
use PhpLlm\LlmChain\Bridge\Anthropic\PlatformFactory;
5-
use PhpLlm\LlmChain\Chain;
6-
use PhpLlm\LlmChain\Model\Message\Message;
7-
use PhpLlm\LlmChain\Model\Message\MessageBag;
3+
use PhpLlm\LlmChain\Chain\Chain;
4+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\Claude;
5+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\PlatformFactory;
6+
use PhpLlm\LlmChain\Platform\Message\Message;
7+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
88
use Symfony\Component\Dotenv\Dotenv;
99

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

examples/anthropic/toolcall.php

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

3-
use PhpLlm\LlmChain\Bridge\Anthropic\Claude;
4-
use PhpLlm\LlmChain\Bridge\Anthropic\PlatformFactory;
5-
use PhpLlm\LlmChain\Chain;
3+
use PhpLlm\LlmChain\Chain\Chain;
64
use PhpLlm\LlmChain\Chain\Toolbox\ChainProcessor;
75
use PhpLlm\LlmChain\Chain\Toolbox\Tool\Wikipedia;
86
use PhpLlm\LlmChain\Chain\Toolbox\Toolbox;
9-
use PhpLlm\LlmChain\Model\Message\Message;
10-
use PhpLlm\LlmChain\Model\Message\MessageBag;
7+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\Claude;
8+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\PlatformFactory;
9+
use PhpLlm\LlmChain\Platform\Message\Message;
10+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
1111
use Symfony\Component\Dotenv\Dotenv;
1212
use Symfony\Component\HttpClient\HttpClient;
1313

examples/azure/audio-transcript.php

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

3-
use PhpLlm\LlmChain\Bridge\Azure\OpenAI\PlatformFactory;
4-
use PhpLlm\LlmChain\Bridge\OpenAI\Whisper;
5-
use PhpLlm\LlmChain\Model\Message\Content\Audio;
3+
use PhpLlm\LlmChain\Platform\Bridge\Azure\OpenAI\PlatformFactory;
4+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Whisper;
5+
use PhpLlm\LlmChain\Platform\Message\Content\Audio;
66
use Symfony\Component\Dotenv\Dotenv;
77

88
require_once dirname(__DIR__, 2).'/vendor/autoload.php';

examples/azure/chat-gpt.php

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

3-
use PhpLlm\LlmChain\Bridge\Azure\OpenAI\PlatformFactory;
4-
use PhpLlm\LlmChain\Bridge\OpenAI\GPT;
5-
use PhpLlm\LlmChain\Chain;
6-
use PhpLlm\LlmChain\Model\Message\Message;
7-
use PhpLlm\LlmChain\Model\Message\MessageBag;
3+
use PhpLlm\LlmChain\Chain\Chain;
4+
use PhpLlm\LlmChain\Platform\Bridge\Azure\OpenAI\PlatformFactory;
5+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;
6+
use PhpLlm\LlmChain\Platform\Message\Message;
7+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
88
use Symfony\Component\Dotenv\Dotenv;
99

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

examples/azure/chat-llama.php

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

3-
use PhpLlm\LlmChain\Bridge\Azure\Meta\PlatformFactory;
4-
use PhpLlm\LlmChain\Bridge\Meta\Llama;
5-
use PhpLlm\LlmChain\Chain;
6-
use PhpLlm\LlmChain\Model\Message\Message;
7-
use PhpLlm\LlmChain\Model\Message\MessageBag;
3+
use PhpLlm\LlmChain\Chain\Chain;
4+
use PhpLlm\LlmChain\Platform\Bridge\Azure\Meta\PlatformFactory;
5+
use PhpLlm\LlmChain\Platform\Bridge\Meta\Llama;
6+
use PhpLlm\LlmChain\Platform\Message\Message;
7+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
88
use Symfony\Component\Dotenv\Dotenv;
99

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

examples/azure/embeddings.php

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

3-
use PhpLlm\LlmChain\Bridge\Azure\OpenAI\PlatformFactory;
4-
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
5-
use PhpLlm\LlmChain\Model\Response\VectorResponse;
3+
use PhpLlm\LlmChain\Platform\Bridge\Azure\OpenAI\PlatformFactory;
4+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;
5+
use PhpLlm\LlmChain\Platform\Response\VectorResponse;
66
use Symfony\Component\Dotenv\Dotenv;
77

88
require_once dirname(__DIR__, 2).'/vendor/autoload.php';

examples/bedrock/chat-claude.php

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

3-
use PhpLlm\LlmChain\Bridge\Anthropic\Claude;
4-
use PhpLlm\LlmChain\Bridge\Bedrock\PlatformFactory;
5-
use PhpLlm\LlmChain\Chain;
6-
use PhpLlm\LlmChain\Model\Message\Message;
7-
use PhpLlm\LlmChain\Model\Message\MessageBag;
3+
use PhpLlm\LlmChain\Chain\Chain;
4+
use PhpLlm\LlmChain\Platform\Bridge\Anthropic\Claude;
5+
use PhpLlm\LlmChain\Platform\Bridge\Bedrock\PlatformFactory;
6+
use PhpLlm\LlmChain\Platform\Message\Message;
7+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
88
use Symfony\Component\Dotenv\Dotenv;
99

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

0 commit comments

Comments
 (0)