feat(manadeck): implement AI deck generation with Google Gemini

- Add AiService using Google Gemini Flash 2.0 for card generation
- Support all card types: text, flashcard, quiz, mixed
- Implement full generateDeckWithAI endpoint with:
  - Credit validation and consumption
  - Structured JSON output with response schema
  - Deck and card creation in PostgreSQL
  - Comprehensive error handling
- Add @google/genai dependency
- Update .env.example with GOOGLE_GENAI_API_KEY
- Support difficulty levels (beginner/intermediate/advanced)
- Support multiple languages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-25 02:59:46 +01:00
parent be9df4aa85
commit 4bdb5dea85
7 changed files with 717 additions and 84 deletions

View file

@ -20,8 +20,9 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@manacore/manadeck-database": "workspace:*",
"@google/genai": "^1.14.0",
"@mana-core/nestjs-integration": "git+https://github.com/Memo-2023/mana-core-nestjs-package.git",
"@manacore/manadeck-database": "workspace:*",
"@nestjs/axios": "^4.0.1",
"@nestjs/common": "^11.0.1",
"@nestjs/config": "^4.0.2",