Skip to content

fix(api): bound tutor uploads and search inputs (C-5) - #254

Merged
sandragjacinto merged 1 commit into
mainfrom
fix/c5-input-limits
Nov 10, 2026
Merged

sandragjacinto merged 1 commit into
mainfrom
fix/c5-input-limits

Conversation

@sandragjacinto

Copy link
Copy Markdown
Collaborator

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.

Description

Why?

How?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My code is tested.
  • I have updated the documentation accordingly.

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
sandragjacinto merged commit 8ce0845 into main Nov 10, 2026
3 of 4 checks passed
@sandragjacinto
sandragjacinto deleted the fix/c5-input-limits branch November 10, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant