Skip to content

chore: update to llm-chain 0.22 #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@ The setup is split into three parts, the Symfony application, the OpenAI configu
Checkout the repository, start the docker environment and install dependencies:

```shell
git clone [email protected]:php-llm/symfony-demo.git
cd symfony-demo
git clone [email protected]:php-llm/llm-chain-symfony-demo.git
cd llm-chain-symfony-demo
docker compose up -d
docker compose run composer install
```
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"ext-iconv": "*",
"codewithkyrian/chromadb-php": "^0.4.0",
"league/commonmark": "^2.7",
"php-llm/llm-chain-bundle": "^0.20.2",
"php-llm/llm-chain-bundle": "^0.22",
"runtime/frankenphp-symfony": "^0.2.0",
"symfony/asset": "7.3.*",
"symfony/asset-mapper": "7.3.*",
@@ -25,10 +25,10 @@
"symfony/runtime": "7.3.*",
"symfony/twig-bundle": "7.3.*",
"symfony/uid": "7.3.*",
"symfony/ux-icons": "^2.24",
"symfony/ux-live-component": "^2.24",
"symfony/ux-turbo": "^2.24",
"symfony/ux-typed": "^2.24",
"symfony/ux-icons": "^2.25",
"symfony/ux-live-component": "^2.25",
"symfony/ux-turbo": "^2.25",
"symfony/ux-typed": "^2.25",
"symfony/yaml": "7.3.*",
"twig/extra-bundle": "^3.21",
"twig/markdown-extra": "^3.21",
@@ -105,7 +105,7 @@
"bin/console lint:twig templates",
"bin/console lint:yaml config",
"bin/console lint:container",
"PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run",
"PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix",
"phpstan analyse",
"XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage"
]
55 changes: 32 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion config/packages/llm_chain.yaml
Original file line number Diff line number Diff line change
@@ -60,5 +60,6 @@ services:
# PhpLlm\LlmChain\Chain\Toolbox\Tool\SerpApi:
# $apiKey: '%env(SERP_API_KEY)%'
PhpLlm\LlmChain\Chain\Toolbox\Tool\Wikipedia: ~
PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch: ~
PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch:
$model: '@llm_chain.embedder.default.model'

4 changes: 3 additions & 1 deletion config/packages/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
when@dev:
web_profiler:
toolbar: true
toolbar:
enabled: true
ajax_replace: true
intercept_redirects: false

framework:
17 changes: 8 additions & 9 deletions src/Audio/Chat.php
Original file line number Diff line number Diff line change
@@ -4,15 +4,14 @@

namespace App\Audio;

use PhpLlm\LlmChain\Bridge\OpenAI\Whisper;
use PhpLlm\LlmChain\Bridge\OpenAI\Whisper\File;
use PhpLlm\LlmChain\ChainInterface;
use PhpLlm\LlmChain\Model\Message\Content\Audio;
use PhpLlm\LlmChain\Model\Message\Message;
use PhpLlm\LlmChain\Model\Message\MessageBag;
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
use PhpLlm\LlmChain\Model\Response\TextResponse;
use PhpLlm\LlmChain\PlatformInterface;
use PhpLlm\LlmChain\Chain\ChainInterface;
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Whisper;
use PhpLlm\LlmChain\Platform\Message\Content\Audio;
use PhpLlm\LlmChain\Platform\Message\Message;
use PhpLlm\LlmChain\Platform\Message\MessageBag;
use PhpLlm\LlmChain\Platform\PlatformInterface;
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
use PhpLlm\LlmChain\Platform\Response\TextResponse;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\RequestStack;

2 changes: 1 addition & 1 deletion src/Audio/TwigComponent.php
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

namespace App\Audio;

use PhpLlm\LlmChain\Model\Message\MessageInterface;
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveArg;
8 changes: 4 additions & 4 deletions src/Blog/Chat.php
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@

namespace App\Blog;

use PhpLlm\LlmChain\ChainInterface;
use PhpLlm\LlmChain\Model\Message\Message;
use PhpLlm\LlmChain\Model\Message\MessageBag;
use PhpLlm\LlmChain\Model\Response\TextResponse;
use PhpLlm\LlmChain\Chain\ChainInterface;
use PhpLlm\LlmChain\Platform\Message\Message;
use PhpLlm\LlmChain\Platform\Message\MessageBag;
use PhpLlm\LlmChain\Platform\Response\TextResponse;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\RequestStack;

8 changes: 4 additions & 4 deletions src/Blog/Command/QueryCommand.php
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@
namespace App\Blog\Command;

use Codewithkyrian\ChromaDB\Client;
use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings;
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
use PhpLlm\LlmChain\Model\Response\VectorResponse;
use PhpLlm\LlmChain\PlatformInterface;
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\Embeddings;
use PhpLlm\LlmChain\Platform\PlatformInterface;
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
use PhpLlm\LlmChain\Platform\Response\VectorResponse;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
6 changes: 3 additions & 3 deletions src/Blog/Embedder.php
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@

namespace App\Blog;

use PhpLlm\LlmChain\Document\Metadata;
use PhpLlm\LlmChain\Document\TextDocument;
use PhpLlm\LlmChain\Embedder as LlmChainEmbedder;
use PhpLlm\LlmChain\Store\Document\Metadata;
use PhpLlm\LlmChain\Store\Document\TextDocument;
use PhpLlm\LlmChain\Store\Embedder as LlmChainEmbedder;

final readonly class Embedder
{
2 changes: 1 addition & 1 deletion src/Blog/TwigComponent.php
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

namespace App\Blog;

use PhpLlm\LlmChain\Model\Message\MessageInterface;
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveArg;
43 changes: 0 additions & 43 deletions src/ProfilerSubscriber.php

This file was deleted.

14 changes: 7 additions & 7 deletions src/Video/TwigComponent.php
Original file line number Diff line number Diff line change
@@ -4,13 +4,13 @@

namespace App\Video;

use PhpLlm\LlmChain\Bridge\OpenAI\GPT;
use PhpLlm\LlmChain\Model\Message\Content\Image;
use PhpLlm\LlmChain\Model\Message\Message;
use PhpLlm\LlmChain\Model\Message\MessageBag;
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
use PhpLlm\LlmChain\Model\Response\TextResponse;
use PhpLlm\LlmChain\PlatformInterface;
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;
use PhpLlm\LlmChain\Platform\Message\Content\Image;
use PhpLlm\LlmChain\Platform\Message\Message;
use PhpLlm\LlmChain\Platform\Message\MessageBag;
use PhpLlm\LlmChain\Platform\PlatformInterface;
use PhpLlm\LlmChain\Platform\Response\AsyncResponse;
use PhpLlm\LlmChain\Platform\Response\TextResponse;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveArg;
8 changes: 4 additions & 4 deletions src/Wikipedia/Chat.php
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@

namespace App\Wikipedia;

use PhpLlm\LlmChain\ChainInterface;
use PhpLlm\LlmChain\Model\Message\Message;
use PhpLlm\LlmChain\Model\Message\MessageBag;
use PhpLlm\LlmChain\Model\Response\TextResponse;
use PhpLlm\LlmChain\Chain\ChainInterface;
use PhpLlm\LlmChain\Platform\Message\Message;
use PhpLlm\LlmChain\Platform\Message\MessageBag;
use PhpLlm\LlmChain\Platform\Response\TextResponse;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\RequestStack;

2 changes: 1 addition & 1 deletion src/Wikipedia/TwigComponent.php
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

namespace App\Wikipedia;

use PhpLlm\LlmChain\Model\Message\MessageInterface;
use PhpLlm\LlmChain\Platform\Message\MessageInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveArg;
Loading