Skip to content

Commit

Permalink
Merge pull request #305 from biblioverse/improve-configuration
Browse files Browse the repository at this point in the history
Refactor AI Connectors, Translations and configuration
  • Loading branch information
SergioMendolia authored Jan 8, 2025
2 parents 7705f7d + b1a8a62 commit 554c1a7
Show file tree
Hide file tree
Showing 129 changed files with 2,768 additions and 1,178 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Explain your PR here
- [ ] Tests are passing
- [ ] New tests have been written
- [ ] Documentation has been updated
- [ ] Translations have been updated
- [ ] Breaking changes have been avoided or documented

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"knplabs/knp-menu-bundle": "^3.2",
"knplabs/knp-paginator-bundle": "^6.2",
"liip/imagine-bundle": "^2.10",
"orhanerday/open-ai": "^5.1",
"nikic/php-parser": "^5.4",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^2.0",
"rtheunissen/guzzle-log-middleware": "^2.0",
Expand Down
177 changes: 59 additions & 118 deletions composer.lock

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

1 change: 0 additions & 1 deletion config/packages/translation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ framework:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- en
- fr
# providers:
# crowdin:
# dsn: '%env(CROWDIN_DSN)%'
Expand Down
32 changes: 18 additions & 14 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,23 @@ parameters:
env(KOBO_READINGSERVICES_URL): 'https://readingservices.kobo.com'
ALLOW_BOOK_RELOCATION: '%env(bool:ALLOW_BOOK_RELOCATION)%'
env(ALLOW_BOOK_RELOCATION): true
OPEN_AI_API_KEY: '%env(OPEN_AI_API_KEY)%'
env(OPEN_AI_API_KEY): null
OPEN_AI_MODEL: '%env(OPEN_AI_MODEL)%'
env(OPEN_AI_MODEL): 'gpt-3.5-turbo'

TYPESENSE_KEY: '%env(TYPESENSE_KEY)%'
TYPESENSE_URL: '%env(TYPESENSE_URL)%'

OLLAMA_URL: '%env(OLLAMA_URL)%'
env(OLLAMA_URL): null
OLLAMA_MODEL: '%env(OLLAMA_MODEL)%'
env(OLLAMA_MODEL): 'llama3.2'
DATABASE_URL: '%env(DATABASE_URL)%'

WIKIPEDIA_API_TOKEN: '%env(WIKIPEDIA_API_TOKEN)%'
env(WIKIPEDIA_API_TOKEN): null

AI_CONTEXT_AMAZON_ENABLED: '%env(bool:AI_CONTEXT_AMAZON_ENABLED)%'
env(AI_CONTEXT_AMAZON_ENABLED): false
GENERIC_SYSTEM_PROMPT: '%env(GENERIC_SYSTEM_PROMPT)%'
env(GENERIC_SYSTEM_PROMPT): "As a highly skilled and experienced librarian AI model, I'm here to help you tag and summarize books as close to the original as possible. I will never make up any information. I will only use the information you provide me. I will communicate with you primarily using your preferred language."

AI_SUMMARY_PROMPT: '%env(AI_SUMMARY_PROMPT)%'
env(AI_SUMMARY_PROMPT): "Can you make a factual summary of the book {book} in around 150 words in french"

AI_CONTEXT_FULL_EPUB: '%env(bool:AI_CONTEXT_FULL_EPUB)%'
env(AI_CONTEXT_FULL_EPUB): false
AI_TAG_PROMPT: '%env(AI_TAG_PROMPT)%'
env(AI_TAG_PROMPT): "I want to tag a book. Can you cite the genres and tags for the following book: {book}?"

DATABASE_URL: '%env(DATABASE_URL)%'


services:
Expand Down Expand Up @@ -141,6 +137,9 @@ services:
$accessTokenExtractor: '@App\Security\KoboTokenExtractor'
$accessTokenHandler: '@App\Security\KoboTokenHandler'

App\Form\LabelTranslationFormExtension:
autoconfigure: true

when@dev:
services:
Symfony\Component\HttpKernel\Profiler\Profiler: '@profiler'
Expand All @@ -158,3 +157,8 @@ when@test:
public: true

Psr\Clock\ClockInterface: '@App\Tests\TestClock'

App\Tests\Mock\AbstractApiMock:
decorates: 'http_client'
decoration_inner_name: 'App\Tests\Mock\AbstrackApiMock.http_client'
arguments: ['@.inner']
Loading

0 comments on commit 554c1a7

Please sign in to comment.