diff --git a/composer.json b/composer.json index b81ef3a..6e80704 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "ext-iconv": "*", "codewithkyrian/chromadb-php": "^0.3.0", "league/commonmark": "^2.6", - "php-llm/llm-chain-bundle": "^0.18", + "php-llm/llm-chain-bundle": "^0.19", "runtime/frankenphp-symfony": "^0.2.0", "symfony/asset": "7.2.*", "symfony/asset-mapper": "7.2.*", diff --git a/composer.lock b/composer.lock index 96982ee..fea2523 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a22ceb12255d2617d5c64f93df0ee8b8", + "content-hash": "9c52bc8e2d7885ea3ce5b42101c4fc7b", "packages": [ { "name": "codewithkyrian/chromadb-php", @@ -1146,16 +1146,16 @@ }, { "name": "php-llm/llm-chain", - "version": "0.18.0", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/php-llm/llm-chain.git", - "reference": "6a5dbe767ed05512cd82cf7cab2d2f14aed5ef3c" + "reference": "a588afeff45d0369161180c2555d608cb1a2ad81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-llm/llm-chain/zipball/6a5dbe767ed05512cd82cf7cab2d2f14aed5ef3c", - "reference": "6a5dbe767ed05512cd82cf7cab2d2f14aed5ef3c", + "url": "https://api.github.com/repos/php-llm/llm-chain/zipball/a588afeff45d0369161180c2555d608cb1a2ad81", + "reference": "a588afeff45d0369161180c2555d608cb1a2ad81", "shasum": "" }, "require": { @@ -1225,27 +1225,27 @@ "description": "A slim PHP component with tooling around LLMs.", "support": { "issues": "https://github.com/php-llm/llm-chain/issues", - "source": "https://github.com/php-llm/llm-chain/tree/0.18.0" + "source": "https://github.com/php-llm/llm-chain/tree/0.19.0" }, - "time": "2025-03-13T23:29:22+00:00" + "time": "2025-03-20T21:45:05+00:00" }, { "name": "php-llm/llm-chain-bundle", - "version": "0.18.0", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/php-llm/llm-chain-bundle.git", - "reference": "53fdc4eb706501a921322aa717b05d28166ec874" + "reference": "3aa39fd4cec2b714ed6b74dfb6b3568f2d512f4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-llm/llm-chain-bundle/zipball/53fdc4eb706501a921322aa717b05d28166ec874", - "reference": "53fdc4eb706501a921322aa717b05d28166ec874", + "url": "https://api.github.com/repos/php-llm/llm-chain-bundle/zipball/3aa39fd4cec2b714ed6b74dfb6b3568f2d512f4f", + "reference": "3aa39fd4cec2b714ed6b74dfb6b3568f2d512f4f", "shasum": "" }, "require": { "php": ">=8.2", - "php-llm/llm-chain": "^0.18", + "php-llm/llm-chain": "^0.19", "symfony/config": "^6.4 || ^7.0", "symfony/dependency-injection": "^6.4 || ^7.0", "symfony/framework-bundle": "^6.4 || ^7.0", @@ -1280,9 +1280,9 @@ "description": "Symfony integration bundle for php-llm/llm-chain", "support": { "issues": "https://github.com/php-llm/llm-chain-bundle/issues", - "source": "https://github.com/php-llm/llm-chain-bundle/tree/0.18.0" + "source": "https://github.com/php-llm/llm-chain-bundle/tree/0.19.0" }, - "time": "2025-03-13T23:47:22+00:00" + "time": "2025-03-20T22:50:38+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -6591,16 +6591,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.72.0", + "version": "v3.73.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "f5131b7a7d0103919a1b478a2763bd76c98e472e" + "reference": "6bcfe9ff734019315cf9c6ea4f43cbcd87d1cc82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f5131b7a7d0103919a1b478a2763bd76c98e472e", - "reference": "f5131b7a7d0103919a1b478a2763bd76c98e472e", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/6bcfe9ff734019315cf9c6ea4f43cbcd87d1cc82", + "reference": "6bcfe9ff734019315cf9c6ea4f43cbcd87d1cc82", "shasum": "" }, "require": { @@ -6637,9 +6637,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.72.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.73.1" }, - "time": "2025-03-13T11:26:00+00:00" + "time": "2025-03-19T23:42:33+00:00" }, { "name": "phpstan/phpstan", @@ -7024,16 +7024,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.12", + "version": "11.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d42785840519401ed2113292263795eb4c0f95da" + "reference": "9d6046153c2893b521784069e6b5249ce7d2acae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d42785840519401ed2113292263795eb4c0f95da", - "reference": "d42785840519401ed2113292263795eb4c0f95da", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9d6046153c2893b521784069e6b5249ce7d2acae", + "reference": "9d6046153c2893b521784069e6b5249ce7d2acae", "shasum": "" }, "require": { @@ -7053,14 +7053,14 @@ "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", - "sebastian/code-unit": "^3.0.2", + "sebastian/code-unit": "^3.0.3", "sebastian/comparator": "^6.3.1", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.0", "sebastian/exporter": "^6.3.0", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", - "sebastian/type": "^5.1.0", + "sebastian/type": "^5.1.2", "sebastian/version": "^5.0.2", "staabm/side-effects-detector": "^1.0.5" }, @@ -7105,7 +7105,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.12" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.14" }, "funding": [ { @@ -7121,7 +7121,7 @@ "type": "tidelift" } ], - "time": "2025-03-07T07:31:03+00:00" + "time": "2025-03-19T13:45:48+00:00" }, { "name": "sebastian/cli-parser", @@ -7182,16 +7182,16 @@ }, { "name": "sebastian/code-unit", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", - "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", "shasum": "" }, "require": { @@ -7227,7 +7227,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" }, "funding": [ { @@ -7235,7 +7235,7 @@ "type": "github" } ], - "time": "2024-12-12T09:59:06+00:00" + "time": "2025-03-19T07:56:08+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -7940,16 +7940,16 @@ }, { "name": "sebastian/type", - "version": "5.1.0", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" + "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", - "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", + "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", "shasum": "" }, "require": { @@ -7985,7 +7985,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/type/tree/5.1.2" }, "funding": [ { @@ -7993,7 +7993,7 @@ "type": "github" } ], - "time": "2024-09-17T13:12:04+00:00" + "time": "2025-03-18T13:35:50+00:00" }, { "name": "sebastian/version", diff --git a/config/packages/llm_chain.yaml b/config/packages/llm_chain.yaml index ad0d4cb..333b5df 100644 --- a/config/packages/llm_chain.yaml +++ b/config/packages/llm_chain.yaml @@ -22,7 +22,11 @@ llm_chain: name: 'GPT' version: 'gpt-4o-mini' tools: - - 'PhpLlm\LlmChain\Chain\ToolBox\Tool\SimilaritySearch' + - 'PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch' + - service: 'clock' + name: 'clock' + description: 'Provides the current date and time.' + method: 'now' youtube: model: name: 'GPT' @@ -36,13 +40,18 @@ llm_chain: temperature: 0.5 system_prompt: 'Please answer the users question based on Wikipedia and provide a link to the article.' tools: - - 'PhpLlm\LlmChain\Chain\ToolBox\Tool\Wikipedia' + - 'PhpLlm\LlmChain\Chain\Toolbox\Tool\Wikipedia' audio: model: name: 'GPT' version: 'gpt-4o-mini' system_prompt: 'You are a friendly chatbot that likes to have a conversation with users and asks them some questions.' - tools: false + tools: + # Chain in chain 🤯 + - service: 'llm_chain.chain.blog' + name: 'symfony_blog' + description: 'Can answer questions based on the Symfony blog.' + is_chain: true store: chroma_db: symfonycon: @@ -63,10 +72,10 @@ services: autowire: true autoconfigure: true - # PhpLlm\LlmChain\Chain\ToolBox\Tool\Clock: ~ - # PhpLlm\LlmChain\Chain\ToolBox\Tool\OpenMeteo: ~ - # PhpLlm\LlmChain\Chain\ToolBox\Tool\SerpApi: + # PhpLlm\LlmChain\Chain\Toolbox\Tool\Clock: ~ + # PhpLlm\LlmChain\Chain\Toolbox\Tool\OpenMeteo: ~ + # 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\Wikipedia: ~ + PhpLlm\LlmChain\Chain\Toolbox\Tool\SimilaritySearch: ~