← Về thư mục
skills/infographics/scripts/generate_infographic_ai.py
- ReviewResult · class · L39-L57 — class ReviewResult(NamedTuple)
- _normalize_review_text · function · L77-L79 — def _normalize_review_text(text: str) -> str
- _parse_score · function · L82-L96 — def _parse_score(text: str) -> Optional[float]
- _parse_verdict · function · L99-L111 — def _parse_verdict(text: str) -> Optional[str]
- _resolve_api_key · function · L114-L149 — def _resolve_api_key(explicit: Optional[str] = None) -> Optional[str]
- InfographicGenerator · class · L347-L1319 — class InfographicGenerator
- init · method · L414-L436 — def init(self, api_key: Optional[str] = None, verbose: bool = False)
- _log · method · L438-L441 — def _log(self, message: str)
- research_topic · method · L445-L553 — def research_topic(self, topic: str, infographic_type: Optional[str] = None) -> Dict[str, Any]
- web_search · method · L555-L627 — def web_search(self, query: str) -> Dict[str, Any]
- _enhance_prompt_with_research · method · L629-L651 — def _enhance_prompt_with_research(self, user_prompt: str, research_data: Dict[str, Any]) -> str
- _make_request · method · L655-L697 — def _make_request(self, model: str, messages: List[Dict[str, Any]], modalities: Optional[List[str]] = None) -> Dict[str, Any]
- _extract_image_from_response · method · L699-L755 — def _extract_image_from_response(self, response: Dict[str, Any]) -> Optional[bytes]
- _image_to_base64 · method · L757-L772 — def _image_to_base64(self, image_path: str) -> str
- _build_generation_prompt · method · L774-L818 — def _build_generation_prompt(self, user_prompt: str, infographic_type: Optional[str] = None, style: Optional[str] = None, palette: Optional[str] = None, background: str = "white", context_image_count: int = 0) -> str
- generate_image · method · L820-L880 — def generate_image(self, prompt: str, context_images: Optional[List[str]] = None) -> Optional[bytes]
- review_image · method · L882-L1044 — def review_image(self, image_path: str, original_prompt: str, infographic_type: Optional[str], iteration: int, doc_type: str = "default", max_iterations: int = 3) -> ReviewResult
- improve_prompt · method · L1046-L1100 — def improve_prompt(self, original_prompt: str, critique: str, infographic_type: Optional[str], style: Optional[str], palette: Optional[str], background: str, iteration: int, context_image_count: int = 0) -> str
- generate_iterative · method · L1102-L1319 — def generate_iterative(self, user_prompt: str, output_path: str, infographic_type: Optional[str] = None, style: Optional[str] = None, palette: Optional[str] = None, background: str = "white", iterations: int = 3, doc_type: str = "default", research: bool = False, context_images: Optional[List[str]] = None) -> Dict[str, Any]
- main · function · L1322-L1442 — def main()