""" LLM-related utilities, templates, and text generation functions. """ import asyncio import logging from typing import Optional, Dict, Any from huggingface_hub import InferenceClient from .api_config import HF_TOKEN, TEXT_MODEL logger = logging.getLogger(__name__) # LLM prompt templates SEARCH_VIDEO_PROMPT_TEMPLATE = """# Instruction Your response MUST be a YAML object containing a title and description, consistent with what we can find on a video sharing platform. Format your YAML response with only those fields: "title" (a short string) and "description" (string caption of the scene). Do not add any other field. In the description field, describe in a very synthetic way the visuals of the first shot (first scene), eg "