You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+31-74Lines changed: 31 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,7 @@ Those models are provided by different **platforms**, like OpenAI, Azure, Google
45
45
#### Example Instantiation
46
46
47
47
```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;
able to mutate both on top of the `Input` instance provided.
670
639
671
640
```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;
675
642
676
-
final class MyProcessor implements InputProcessor
643
+
final class MyProcessor implements InputProcessorInterface
677
644
{
678
645
public function processInput(Input $input): void
679
646
{
@@ -694,11 +661,9 @@ final class MyProcessor implements InputProcessor
694
661
mutate or replace the given response:
695
662
696
663
```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;
700
665
701
-
final class MyProcessor implements OutputProcessor
666
+
final class MyProcessor implements OutputProcessorInterface
702
667
{
703
668
public function processOutput(Output $out): void
704
669
{
@@ -717,13 +682,9 @@ provided, in case the processor implemented the `ChainAwareProcessor` interface,
717
682
`ChainAwareTrait`:
718
683
719
684
```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;
725
686
726
-
final class MyProcessor implements OutputProcessor, ChainAwareProcessor
687
+
final class MyProcessor implements OutputProcessorInterface, ChainAwareProcessorInterface
727
688
{
728
689
use ChainAwareTrait;
729
690
@@ -741,11 +702,9 @@ LLM Chain comes out of the box with an integration for [HuggingFace](https://hug
741
702
hosting and sharing all kinds of models, including LLMs, embeddings, image generation, and classification models.
742
703
743
704
You can just instantiate the Platform with the corresponding HuggingFace bridge and use it with the `task` option:
705
+
744
706
```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;
749
708
750
709
$platform = PlatformFactory::create($apiKey);
751
710
$model = new Model('facebook/detr-resnet-50');
@@ -789,9 +748,7 @@ and comes with an extra setup, see [TransformersPHP's Getting Starter](https://t
0 commit comments