Skip to content

Commit 7b7dc8c

Browse files
committed
refactor: rework LLM Chain into Symfony AI
2 parents 19535a6 + 5ee30df commit 7b7dc8c

File tree

436 files changed

+24106
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

436 files changed

+24106
-10
lines changed

.env

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# You only need to fill in the values when running the examples, see examples/
2+
3+
# For using GPT on OpenAI
4+
OPENAI_API_KEY=
5+
6+
# For using Claude on Anthropic
7+
ANTHROPIC_API_KEY=
8+
9+
# For using Mistral
10+
MISTRAL_API_KEY=
11+
12+
# For using Voyage
13+
VOYAGE_API_KEY=
14+
15+
# For using Replicate
16+
REPLICATE_API_KEY=
17+
18+
# For using Ollama
19+
OLLAMA_HOST_URL=
20+
21+
# For using GPT on Azure
22+
AZURE_OPENAI_BASEURL=
23+
AZURE_OPENAI_KEY=
24+
AZURE_OPENAI_GPT_DEPLOYMENT=
25+
AZURE_OPENAI_GPT_API_VERSION=
26+
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT=
27+
AZURE_OPENAI_EMBEDDINGS_API_VERSION=
28+
AZURE_OPENAI_WHISPER_DEPLOYMENT=
29+
AZURE_OPENAI_WHISPER_API_VERSION=
30+
31+
# For using Llama on Azure
32+
AZURE_LLAMA_BASEURL=
33+
AZURE_LLAMA_KEY=
34+
35+
# For using Bedrock
36+
AWS_ACCESS_KEY_ID=
37+
AWS_SECRET_ACCESS_KEY=
38+
AWS_DEFAULT_REGION=
39+
40+
# Hugging Face Access Token
41+
HUGGINGFACE_KEY=
42+
43+
# For using OpenRouter
44+
OPENROUTER_KEY=
45+
46+
# For using SerpApi (tool)
47+
SERP_API_KEY=
48+
49+
# For using Tavily (tool)
50+
TAVILY_API_KEY=
51+
52+
# For using Brave (tool)
53+
BRAVE_API_KEY=
54+
55+
# For using MongoDB Atlas (store)
56+
MONGODB_URI=
57+
58+
# For using Pinecone (store)
59+
PINECONE_API_KEY=
60+
PINECONE_HOST=
61+
62+
# Some examples are expensive to run, so we disable them by default
63+
RUN_EXPENSIVE_EXAMPLES=false
64+
65+
# For using Gemini
66+
GOOGLE_API_KEY=

.github/workflows/code-quality.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ jobs:
5151
run: |
5252
echo COLUMNS=120 >> $GITHUB_ENV
5353
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
54-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
55-
echo COMPOSER_VALIDATE='composer validate --strict' >> $GITHUB_ENV
54+
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
5655
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
5756
5857
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
@@ -75,4 +74,4 @@ jobs:
7574
run: |
7675
source .github/workflows/.utils.sh
7776
78-
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $COMPOSER_VALIDATE && $PHPSTAN)'"
77+
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPSTAN)'"

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
echo COLUMNS=120 >> $GITHUB_ENV
4646
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
47-
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
47+
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
4848
echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV
4949
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
5050

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.doctor-rst.cache
2+
.env.local
23
.php-cs-fixer.cache
3-
.phpunit.result.cache
4+
.phpunit.cache
5+
.transformers-cache
46

5-
/composer.lock
6-
/vendor
7+
composer.lock
8+
vendor

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
->setRiskyAllowed(true)
4343
->setFinder(
4444
(new PhpCsFixer\Finder())
45-
->in(__DIR__.'/src')
45+
->in([__DIR__.'/src', __DIR__.'/examples'])
4646
->append([__FILE__])
4747
->notPath('#/Fixtures/#')
4848
)

0 commit comments

Comments
 (0)