Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(api): expose match_materials_to_script in /terms endpoint
feat commit 552f056 added match_materials_to_script to VideoParams and
wired it through task.py, but VideoTermsParams was not updated and the
/terms controller still calls generate_terms() without match_script_order.

As a result the /terms REST endpoint always generates relevance-ordered
terms, even when callers set match_materials_to_script=true, and the
chronological prompt branch in generate_terms() is never reachable
through the API.

Add match_materials_to_script: bool = False to VideoTermsParams and
pass it as match_script_order to generate_terms() in the controller.
Default is False so existing callers are unaffected.
  • Loading branch information
kapilvus committed Jun 22, 2026
commit 540e3de5cad3d57c72bb9e7b6d5563848a56fd49
1 change: 1 addition & 0 deletions app/controllers/v1/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def generate_video_terms(request: Request, body: VideoTermsRequest):
video_subject=body.video_subject,
video_script=body.video_script,
amount=body.amount,
match_script_order=body.match_materials_to_script,
)
response = {"video_terms": video_terms}
return utils.get_response(200, response)
Expand Down
4 changes: 3 additions & 1 deletion app/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class VideoTermsParams:
{
"video_subject": "",
"video_script": "",
"amount": 5
"amount": 5,
"match_materials_to_script": false
}
"""

Expand All @@ -177,6 +178,7 @@ class VideoTermsParams:
"春天的花海,如诗如画般展现在眼前。万物复苏的季节里,大地披上了一袭绚丽多彩的盛装。金黄的迎春、粉嫩的樱花、洁白的梨花、艳丽的郁金香……"
)
amount: Optional[int] = 5
match_materials_to_script: bool = False


class VideoSocialMetadataParams:
Expand Down
Loading