Three things landed together; the message names all of them, because a commit that mentions one is a commit nobody finds the other two in. **Figures.** Thirty-four JPEG 2000 files — 21 on questions, the rest unattached in the media library — are WebP now, with `questions.image_path`, `questions.explanation_image_path` and `media_assets.path` repointed together. Serving already converted them on the way out, so nothing was broken; this removes the step and makes what is stored the same thing that is served. The originals stay: they are the only copy of what came out of the PDF, they cost a few megabytes between them, and a conversion nobody can undo is not one to run against a live bank. Paths are found by what the columns say rather than by listing a bucket, because three tables record them and updating two would be worse than none. **The openai SDK is gone.** Ten call sites — one more than the map said, the Celery article drafter — every one of them a POST with a JSON body, and not one reading usage, cost, tool calls or logprobs. Every other call to the same proxy was already plain httpx: embeddings, the ChromaDB embedding function, speech both ways, model discovery, the vision probe. So this deletes an abstraction rather than swapping one for another, and leaves one HTTP client instead of two. `chat()` and `achat()` return the message content; a `ProxyError` carries the status and the first 500 characters of the body, which is where the proxy explains itself. Behaviour is preserved deliberately, including a 600-second fallback timeout for the four call sites that were running on the SDK's ten-minute default. Lowering that is a real change and belongs in its own commit. Proved against the live proxy on both services rather than only against mocks: a completion, an async completion, a real 400 the vision probe still classifies as a refusal, 407 models read from the catalogue, and a word read off an image. **Voice.** A chosen voice is honoured whatever serves it. The prefix check only accepted a locally served one, so a site adding a hosted voice would offer it in Settings, save the learner's choice, and then quietly read every question in the default voice. The list has always come from the database — adding a voice is a row in Settings → AI models, never a code change. And the sign-in page stops offering a locked door: `signup-policy` reports whether registration is open at all, and the Sign up link goes when it is not. The switch existed and the only way to discover it was to fill the form in. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
from app.models.user import User
|
|
from app.models.pdf_document import PDFDocument
|
|
from app.models.section import Section
|
|
from app.models.quiz import Quiz
|
|
from app.models.question import Question
|
|
from app.models.attempt import QuizAttempt, AttemptAnswer
|
|
from app.models.ai_model_config import AIModelConfig
|
|
from app.models.favorite import Favorite
|
|
from app.models.user_note import UserNote
|
|
from app.models.lab_reference import LabReference, LabReferenceCardLink
|
|
from app.models.article import Article, QuestionArticleLink
|
|
from app.models.flashcard import FlashcardDeck, Flashcard, FlashcardDeckRating, FlashcardQuestionLink, FlashcardArticleLink
|
|
from app.models.question_category import QuestionCategory, QuestionCategoryLink
|
|
from app.models.collection import UserCollection, UserCollectionQuestion
|
|
|
|
__all__ = [
|
|
"User",
|
|
"PDFDocument",
|
|
"Section",
|
|
"Quiz",
|
|
"Question",
|
|
"QuizAttempt",
|
|
"AttemptAnswer",
|
|
"AIModelConfig",
|
|
"Favorite",
|
|
"UserNote",
|
|
"LabReference",
|
|
"LabReferenceCardLink",
|
|
"Article",
|
|
"QuestionArticleLink",
|
|
"FlashcardDeck",
|
|
"Flashcard",
|
|
"FlashcardDeckRating",
|
|
"FlashcardQuestionLink",
|
|
"FlashcardArticleLink",
|
|
"QuestionCategory",
|
|
"QuestionCategoryLink",
|
|
"UserCollection",
|
|
"UserCollectionQuestion",
|
|
]
|
|
|
|
from app.models.feedback import QuestionFeedback # noqa: F401
|
|
from app.models.invite import InviteCode # noqa: F401
|
|
from app.models.draft_question import DraftBatch, DraftQuestion # noqa: F401
|
|
from app.models.login_link import LoginLink # noqa: F401
|