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

Commit 41ea0c1

Browse files
committed
feat: prepare for release 0.8
1 parent 485c97d commit 41ea0c1

19 files changed

+505
-343
lines changed

README.md

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,26 @@ composer require php-llm/llm-chain-bundle
1414
# config/packages/llm_chain.yaml
1515
llm_chain:
1616
platforms:
17+
default:
18+
openai:
19+
api_key: '%env(OPENAI_API_KEY)%'
1720
azure_gpt:
18-
type: 'azure'
19-
base_url: '%env(AZURE_OPENAI_BASEURL)%'
20-
deployment: '%env(AZURE_OPENAI_GPT)%'
21-
api_key: '%env(AZURE_OPENAI_KEY)%'
22-
version: '%env(AZURE_OPENAI_VERSION)%'
21+
azure:
22+
base_url: '%env(AZURE_OPENAI_BASEURL)%'
23+
deployment: '%env(AZURE_OPENAI_GPT)%'
24+
api_key: '%env(AZURE_OPENAI_KEY)%'
25+
version: '%env(AZURE_OPENAI_VERSION)%'
2326
azure_embeddings:
24-
type: 'azure'
25-
base_url: '%env(AZURE_OPENAI_BASEURL)%'
26-
deployment: '%env(AZURE_OPENAI_EMBEDDINGS)%'
27-
api_key: '%env(AZURE_OPENAI_KEY)%'
28-
version: '%env(AZURE_OPENAI_VERSION)%'
29-
openai:
30-
type: 'openai'
31-
api_key: '%env(OPENAI_API_KEY)%'
32-
llms:
33-
azure_gpt:
27+
azure:
28+
base_url: '%env(AZURE_OPENAI_BASEURL)%'
29+
deployment: '%env(AZURE_OPENAI_EMBEDDINGS)%'
30+
api_key: '%env(AZURE_OPENAI_KEY)%'
31+
version: '%env(AZURE_OPENAI_VERSION)%'
32+
chains:
33+
default:
3434
platform: 'azure_gpt'
35-
original_gpt:
36-
platform: 'openai'
37-
embeddings:
38-
azure_embeddings:
39-
platform: 'azure_embeddings'
40-
original_embeddings:
41-
platform: 'openai'
35+
model: 'gpt'
36+
version: 'gpt-3.5-turbo'
4237
stores:
4338
azure_search:
4439
engine: 'azure-search'
@@ -99,18 +94,18 @@ services:
9994
autowire: true
10095
autoconfigure: true
10196
102-
PhpLlm\LlmChain\ToolBox\Tool\Clock: ~
103-
PhpLlm\LlmChain\ToolBox\Tool\OpenMeteo: ~
104-
PhpLlm\LlmChain\ToolBox\Tool\SerpApi:
97+
PhpLlm\LlmChain\Chain\ToolBox\Tool\Clock: ~
98+
PhpLlm\LlmChain\Chain\ToolBox\Tool\OpenMeteo: ~
99+
PhpLlm\LlmChain\Chain\ToolBox\Tool\SerpApi:
105100
$apiKey: '%env(SERP_API_KEY)%'
106-
PhpLlm\LlmChain\ToolBox\Tool\SimilaritySearch: ~
107-
PhpLlm\LlmChain\ToolBox\Tool\Wikipedia: ~
108-
PhpLlm\LlmChain\ToolBox\Tool\YouTubeTranscriber: ~
101+
PhpLlm\LlmChain\Chain\ToolBox\Tool\SimilaritySearch: ~
102+
PhpLlm\LlmChain\Chain\ToolBox\Tool\Wikipedia: ~
103+
PhpLlm\LlmChain\Chain\ToolBox\Tool\YouTubeTranscriber: ~
109104
```
110105

111106
Custom tools can be registered by using the `#[AsTool]` attribute:
112107
```php
113-
use PhpLlm\LlmChain\ToolBox\AsTool;
108+
use PhpLlm\LlmChain\Chain\ToolBox\Attribute\AsTool;
114109
115110
#[AsTool('company_name', 'Provides the name of your company')]
116111
final class CompanyName

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=8.2",
14-
"php-llm/llm-chain": "0.7.*",
14+
"php-llm/llm-chain": "^0.8",
1515
"symfony/config": "^6.4 || ^7.0",
1616
"symfony/dependency-injection": "^6.4 || ^7.0",
1717
"symfony/framework-bundle": "^6.4 || ^7.0"

src/DependencyInjection/Configuration.php

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,50 @@ public function getConfigTreeBuilder(): TreeBuilder
1616

1717
$rootNode
1818
->children()
19-
->arrayNode('platforms')
20-
->normalizeKeys(false)
21-
->useAttributeAsKey('name')
22-
->arrayPrototype()
23-
->children()
24-
->enumNode('type')->values(['openai', 'azure'])->isRequired()->end()
25-
->scalarNode('api_key')->isRequired()->end()
26-
->scalarNode('base_url')->end()
27-
->scalarNode('deployment')->end()
28-
->scalarNode('version')->info('The used API version')->end()
19+
->arrayNode('platform')
20+
->children()
21+
->arrayNode('openai')
22+
->children()
23+
->scalarNode('api_key')->isRequired()->end()
24+
->end()
25+
->end()
26+
->arrayNode('azure')
27+
->children()
28+
->scalarNode('api_key')->isRequired()->end()
29+
->scalarNode('base_url')->isRequired()->end()
30+
->scalarNode('deployment')->isRequired()->end()
31+
->scalarNode('version')->info('The used API version')->end()
32+
->end()
2933
->end()
3034
->end()
3135
->end()
32-
->arrayNode('llms')
36+
->arrayNode('chains')
3337
->normalizeKeys(false)
3438
->useAttributeAsKey('name')
3539
->arrayPrototype()
3640
->children()
37-
->scalarNode('platform')->end()
41+
->arrayNode('model')
42+
->children()
43+
->scalarNode('name')->isRequired()->end()
44+
->scalarNode('version')->defaultNull()->end()
45+
->arrayNode('options')->end()
46+
->end()
47+
->end()
3848
->end()
3949
->end()
4050
->end()
41-
->arrayNode('embeddings')
51+
->arrayNode('embedder')
4252
->normalizeKeys(false)
4353
->useAttributeAsKey('name')
4454
->arrayPrototype()
4555
->children()
46-
->scalarNode('platform')->end()
56+
->arrayNode('model')
57+
->children()
58+
->scalarNode('name')->isRequired()->end()
59+
->scalarNode('version')->defaultNull()->end()
60+
->arrayNode('options')->end()
61+
->end()
62+
->end()
4763
->end()
4864
->end()
4965
->end()
@@ -71,6 +87,7 @@ public function getConfigTreeBuilder(): TreeBuilder
7187
->scalarNode('top_k')->end()
7288
->end()
7389
->end()
90+
->end()
7491
->end()
7592
;
7693

0 commit comments

Comments
 (0)