Repository navigation
fix(api): bound tutor uploads and search inputs (C-5) - #254
Merged
Merged
Conversation
Tutor file routes (/tutor/files/content, /tutor/mas_files/content):
- at most 5 files (400 TOO_MANY_FILES) of 10 MB each (413 FILE_TOO_LARGE),
checked before extraction from the size Starlette records, or by reading
in 1 MB chunks when it is unknown; the client allows 3 files of 5 MB
- extracted text capped at 150,000 characters shared between the files,
with a warning log when it is cut
- lang is Literal["en","fr"] on /files/content, /syllabus and the feedback
body; /mas_files/content also accepts "english"/"french", which the MAS
client sends
Search:
- nb_results le=100 on /search/collections/{collection},
/tutor/search_extracts and EnhancedSearchQuery
- relevance_factor in [0, 1], influence_factor in [0, 10]
- /search/documents/by_ids takes list[UUID] (a non-UUID was a DB 500) and,
like the bibliography export, at most 500 ids
- search_multi_inputs takes at most 10 queries (400 TOO_MANY_QUERIES,
summaries max_length=10) and runs at most 4 at a time behind a semaphore
openapi.json regenerated: inputs tightened only, plus documented 400/413.
sandragjacinto
force-pushed
the
fix/c5-input-limits
branch
from
November 10, 2026 10:30
cf32ed1 to
96ba98a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tutor file routes (/tutor/files/content, /tutor/mas_files/content):
Search:
openapi.json regenerated: inputs tightened only, plus documented 400/413.
Description
Why?
How?
Screenshots (if appropriate):
Types of changes
Checklist: