← Về thư mục
scripts/generate_skill_image.py
- ScriptError · class · L180-L181 — class ScriptError(RuntimeError)
- find_api_key · function · L184-L213 — def find_api_key(explicit: str | None) -> str
- resolve_skill · function · L216-L227 — def resolve_skill(name: str) -> Path
- fair_share · function · L230-L256 — def fair_share(sizes: dict[Path, int], budget: int) -> dict[Path, int]
- collect_skill_text · function · L259-L313 — def collect_skill_text(skill_dir: Path, max_chars: int) -> tuple[str, list[str]]
- chat_completion · function · L316-L344 — def chat_completion( api_key: str, model: str, system: str, user: str, timeout: float ) -> tuple[str, float | None]
- distil_diagram_prompt · function · L347-L352 — def distil_diagram_prompt( skill_dir: Path, document: str, api_key: str, model: str, timeout: float ) -> tuple[str, float | None]
- encode_reference · function · L355-L371 — def encode_reference(source: str) -> str
- post_json · function · L378-L420 — def post_json(url: str, api_key: str, payload: dict, timeout: float) -> Any
- output_paths · function · L423-L438 — def output_paths(base: Path, media_type: str, count: int, warn: bool = True) -> list[Path]
- save_images · function · L441-L465 — def save_images(result: dict, base: Path) -> list[Path]
- generate_for_skill · function · L468-L513 — def generate_for_skill( skill_dir: Path | None, args: argparse.Namespace, api_key: str, output: Path, verbose: bool, ) -> dict[str, Any]
- all_skill_dirs · function · L516-L520 — def all_skill_dirs() -> list[Path]
- run_batch · function · L523-L597 — def run_batch(skill_dirs: list[Path], args: argparse.Namespace, api_key: str) -> int
- work · function · L548-L559 — def work(item: tuple[Path, Path]) -> tuple[Path, dict | None, str | None]
- build_parser · function · L600-L728 — def build_parser() -> argparse.ArgumentParser
- default_output · function · L731-L735 — def default_output(skill_dir: Path | None) -> Path
- validate · function · L738-L752 — def validate(args: argparse.Namespace) -> None
- build_payload · function · L755-L774 — def build_payload(prompt: str, args: argparse.Namespace) -> dict
- main · function · L777-L865 — def main(argv: list[str] | None = None) -> int