bugfix speech-to-text and implement avatar and personal greeting
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 53s

This commit is contained in:
2026-02-16 20:11:09 +01:00
parent 8f5bfa3cbc
commit 84cd052ded
8 changed files with 284 additions and 19 deletions

View File

@@ -5,12 +5,13 @@ import logging
from fastapi import APIRouter, Depends
from fastapi.responses import StreamingResponse
from sqlalchemy import select, func
from sqlalchemy.ext.asyncio import AsyncSession
from app.auth import get_current_user
from app.database import get_db
from app.models import User
from app.schemas import ChatRequest
from app.models import Instruction, User
from app.schemas import ChatRequest, DashboardOut
from app.services.instruction_service import get_system_prompt
from app.services.llm_service import chat_stream
@@ -19,6 +20,21 @@ logger = logging.getLogger("fluentgerman.chat")
router = APIRouter(prefix="/api/chat", tags=["chat"])
@router.get("/dashboard", response_model=DashboardOut)
async def dashboard(
user: User = Depends(get_current_user),
db: AsyncSession = Depends(get_db),
):
"""Return personalised dashboard data: username + latest instruction date."""
result = await db.execute(
select(func.max(Instruction.created_at)).where(
(Instruction.user_id == user.id) | Instruction.user_id.is_(None)
)
)
latest = result.scalar_one_or_none()
return DashboardOut(username=user.username, latest_instruction_at=latest)
@router.post("/")
async def chat(
body: ChatRequest,