Skip to content

Commit c5e5b1c

Browse files
committed
chore: update to llm-chain 0.22
1 parent ffdbb3b commit c5e5b1c

18 files changed

+83
-182
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ The setup is split into three parts, the Symfony application, the OpenAI configu
3737
Checkout the repository, start the docker environment and install dependencies:
3838

3939
```shell
40-
git clone [email protected]:php-llm/symfony-demo.git
41-
cd symfony-demo
40+
git clone [email protected]:php-llm/llm-chain-symfony-demo.git
41+
cd llm-chain-symfony-demo
4242
docker compose up -d
4343
docker compose run composer install
4444
```

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ext-iconv": "*",
1010
"codewithkyrian/chromadb-php": "^0.4.0",
1111
"league/commonmark": "^2.7",
12-
"php-llm/llm-chain-bundle": "^0.20.2",
12+
"php-llm/llm-chain-bundle": "^0.22",
1313
"runtime/frankenphp-symfony": "^0.2.0",
1414
"symfony/asset": "7.3.*",
1515
"symfony/asset-mapper": "7.3.*",
@@ -25,10 +25,10 @@
2525
"symfony/runtime": "7.3.*",
2626
"symfony/twig-bundle": "7.3.*",
2727
"symfony/uid": "7.3.*",
28-
"symfony/ux-icons": "^2.24",
29-
"symfony/ux-live-component": "^2.24",
30-
"symfony/ux-turbo": "^2.24",
31-
"symfony/ux-typed": "^2.24",
28+
"symfony/ux-icons": "^2.25",
29+
"symfony/ux-live-component": "^2.25",
30+
"symfony/ux-turbo": "^2.25",
31+
"symfony/ux-typed": "^2.25",
3232
"symfony/yaml": "7.3.*",
3333
"twig/extra-bundle": "^3.21",
3434
"twig/markdown-extra": "^3.21",
@@ -105,7 +105,7 @@
105105
"bin/console lint:twig templates",
106106
"bin/console lint:yaml config",
107107
"bin/console lint:container",
108-
"PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run",
108+
"PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix",
109109
"phpstan analyse",
110110
"XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage"
111111
]

composer.lock

Lines changed: 32 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/packages/llm_chain.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ services:
6060
# PhpLlm\LlmChain\Chain\Toolbox\Tool\SerpApi:
6161
# $apiKey: '%env(SERP_API_KEY)%'
6262
PhpLlm\LlmChain\Chain\Toolbox\Tool\Wikipedia: ~
63-
PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch: ~
63+
PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch:
64+
$model: '@llm_chain.embedder.default.model'
6465

config/packages/web_profiler.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
when@dev:
22
web_profiler:
3-
toolbar: true
3+
toolbar:
4+
enabled: true
5+
ajax_replace: true
46
intercept_redirects: false
57

68
framework:

src/Audio/Chat.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
namespace App\Audio;
66

7-
use PhpLlm\LlmChain\Bridge\OpenAI\Whisper;
8-
use PhpLlm\LlmChain\Bridge\OpenAI\Whisper\File;
9-
use PhpLlm\LlmChain\ChainInterface;
10-
use PhpLlm\LlmChain\Model\Message\Content\Audio;
11-
use PhpLlm\LlmChain\Model\Message\Message;
12-
use PhpLlm\LlmChain\Model\Message\MessageBag;
13-
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
14-
use PhpLlm\LlmChain\Model\Response\TextResponse;
15-
use PhpLlm\LlmChain\PlatformInterface;
7+
use PhpLlm\LlmChain\Chain\ChainInterface;
8+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Whisper;
9+
use PhpLlm\LlmChain\Platform\Message\Content\Audio;
10+
use PhpLlm\LlmChain\Platform\Message\Message;
11+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
12+
use PhpLlm\LlmChain\Platform\PlatformInterface;
13+
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
14+
use PhpLlm\LlmChain\Platform\Response\TextResponse;
1615
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1716
use Symfony\Component\HttpFoundation\RequestStack;
1817

src/Audio/TwigComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace App\Audio;
66

7-
use PhpLlm\LlmChain\Model\Message\MessageInterface;
7+
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
88
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
99
use Symfony\UX\LiveComponent\Attribute\LiveAction;
1010
use Symfony\UX\LiveComponent\Attribute\LiveArg;

src/Blog/Chat.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace App\Blog;
66

7-
use PhpLlm\LlmChain\ChainInterface;
8-
use PhpLlm\LlmChain\Model\Message\Message;
9-
use PhpLlm\LlmChain\Model\Message\MessageBag;
10-
use PhpLlm\LlmChain\Model\Response\TextResponse;
7+
use PhpLlm\LlmChain\Chain\ChainInterface;
8+
use PhpLlm\LlmChain\Platform\Message\Message;
9+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
10+
use PhpLlm\LlmChain\Platform\Response\TextResponse;
1111
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1212
use Symfony\Component\HttpFoundation\RequestStack;
1313

src/Blog/Command/QueryCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
namespace App\Blog\Command;
66

77
use Codewithkyrian\ChromaDB\Client;
8-
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
9-
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
10-
use PhpLlm\LlmChain\Model\Response\VectorResponse;
11-
use PhpLlm\LlmChain\PlatformInterface;
8+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;
9+
use PhpLlm\LlmChain\Platform\PlatformInterface;
10+
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
11+
use PhpLlm\LlmChain\Platform\Response\VectorResponse;
1212
use Symfony\Component\Console\Attribute\AsCommand;
1313
use Symfony\Component\Console\Command\Command;
1414
use Symfony\Component\Console\Input\InputInterface;

src/Blog/Embedder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace App\Blog;
66

7-
use PhpLlm\LlmChain\Document\Metadata;
8-
use PhpLlm\LlmChain\Document\TextDocument;
9-
use PhpLlm\LlmChain\Embedder as LlmChainEmbedder;
7+
use PhpLlm\LlmChain\Store\Document\Metadata;
8+
use PhpLlm\LlmChain\Store\Document\TextDocument;
9+
use PhpLlm\LlmChain\Store\Embedder as LlmChainEmbedder;
1010

1111
final readonly class Embedder
1212
{

src/Blog/TwigComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace App\Blog;
66

7-
use PhpLlm\LlmChain\Model\Message\MessageInterface;
7+
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
88
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
99
use Symfony\UX\LiveComponent\Attribute\LiveAction;
1010
use Symfony\UX\LiveComponent\Attribute\LiveArg;

src/ProfilerSubscriber.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Video/TwigComponent.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
namespace App\Video;
66

7-
use PhpLlm\LlmChain\Bridge\OpenAI\GPT;
8-
use PhpLlm\LlmChain\Model\Message\Content\Image;
9-
use PhpLlm\LlmChain\Model\Message\Message;
10-
use PhpLlm\LlmChain\Model\Message\MessageBag;
11-
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
12-
use PhpLlm\LlmChain\Model\Response\TextResponse;
13-
use PhpLlm\LlmChain\PlatformInterface;
7+
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;
8+
use PhpLlm\LlmChain\Platform\Message\Content\Image;
9+
use PhpLlm\LlmChain\Platform\Message\Message;
10+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
11+
use PhpLlm\LlmChain\Platform\PlatformInterface;
12+
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
13+
use PhpLlm\LlmChain\Platform\Response\TextResponse;
1414
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
1515
use Symfony\UX\LiveComponent\Attribute\LiveAction;
1616
use Symfony\UX\LiveComponent\Attribute\LiveArg;

src/Wikipedia/Chat.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace App\Wikipedia;
66

7-
use PhpLlm\LlmChain\ChainInterface;
8-
use PhpLlm\LlmChain\Model\Message\Message;
9-
use PhpLlm\LlmChain\Model\Message\MessageBag;
10-
use PhpLlm\LlmChain\Model\Response\TextResponse;
7+
use PhpLlm\LlmChain\Chain\ChainInterface;
8+
use PhpLlm\LlmChain\Platform\Message\Message;
9+
use PhpLlm\LlmChain\Platform\Message\MessageBag;
10+
use PhpLlm\LlmChain\Platform\Response\TextResponse;
1111
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1212
use Symfony\Component\HttpFoundation\RequestStack;
1313

src/Wikipedia/TwigComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace App\Wikipedia;
66

7-
use PhpLlm\LlmChain\Model\Message\MessageInterface;
7+
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
88
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
99
use Symfony\UX\LiveComponent\Attribute\LiveAction;
1010
use Symfony\UX\LiveComponent\Attribute\LiveArg;

0 commit comments

Comments
 (0)