Spaces:
Running
Running
| # app.py | |
| """Main PPT Generator with 3-AI collaboration system""" | |
| import os | |
| import re | |
| import json | |
| import time | |
| import logging | |
| import gradio as gr | |
| import requests | |
| from typing import List, Dict, Generator | |
| from datetime import datetime | |
| # Import separated modules | |
| from constants import ( | |
| EXAMPLE_TOPICS, AUDIENCE_TYPES, DESIGN_THEMES, | |
| STYLE_TEMPLATES, PPT_TEMPLATES, SLIDE_TITLE_TRANSLATIONS | |
| ) | |
| from content_utils import ( | |
| parse_executor_response, extract_relevant_content_from_executor, | |
| extract_slide_section_from_executor, parse_slide_section, | |
| extract_speaker_notes_from_section, read_uploaded_file, | |
| generate_dynamic_slides, brave_search, generate_slide_content, | |
| generate_presentation_notes, generate_closing_notes, | |
| generate_conclusion_phrase, generate_prompt_with_llm, | |
| generate_image, create_slide_preview_html, create_pptx_file, | |
| PROCESS_FLOW_AVAILABLE | |
| ) | |
| from ui_components import ( | |
| create_custom_slides_ui, load_example, update_audience_info, | |
| update_theme_preview, update_template_info, update_custom_slides_visibility, | |
| clear_all, get_css, get_usage_instructions | |
| ) | |
| # Logging setup | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger(__name__) | |
| # Environment variables | |
| REPLICATE_API_TOKEN = os.getenv("RAPI_TOKEN") | |
| FRIENDLI_TOKEN = os.getenv("FRIENDLI_TOKEN") | |
| BRAVE_API_TOKEN = os.getenv("BAPI_TOKEN") | |
| API_URL = "https://api.friendli.ai/dedicated/v1/chat/completions" | |
| BRAVE_SEARCH_URL = "https://api.search.brave.com/res/v1/web/search" | |
| MODEL_ID = "dep89a2fld32mcm" | |
| TEST_MODE = os.getenv("TEST_MODE", "false").lower() == "true" | |
| # Global variables | |
| current_slides_data = [] | |
| current_topic = "" | |
| current_template = "" | |
| current_theme = "" | |
| uploaded_content = "" | |
| current_language = "English" | |
| conversation_history = [] | |
| # ===== ํต์ฌ: 3์ ํ์ ์์คํ ํด๋์ค ===== | |
| class PPTCreationSystem: | |
| def __init__(self): | |
| self.token = FRIENDLI_TOKEN | |
| self.bapi_token = BRAVE_API_TOKEN | |
| self.api_url = API_URL | |
| self.brave_url = BRAVE_SEARCH_URL | |
| self.model_id = MODEL_ID | |
| self.test_mode = TEST_MODE or (self.token == "YOUR_FRIENDLI_TOKEN") | |
| if self.test_mode: | |
| logger.warning("ํ ์คํธ ๋ชจ๋๋ก ์คํ๋ฉ๋๋ค.") | |
| if self.bapi_token == "YOUR_BRAVE_API_TOKEN": | |
| logger.warning("Brave API ํ ํฐ์ด ์ค์ ๋์ง ์์์ต๋๋ค.") | |
| def create_headers(self): | |
| """API ํค๋ ์์ฑ""" | |
| return { | |
| "Authorization": f"Bearer {self.token}", | |
| "Content-Type": "application/json" | |
| } | |
| def create_brave_headers(self): | |
| """Brave API ํค๋ ์์ฑ""" | |
| return { | |
| "Accept": "application/json", | |
| "Accept-Encoding": "gzip", | |
| "X-Subscription-Token": self.bapi_token | |
| } | |
| def create_supervisor_initial_prompt(self, ppt_topic: str) -> str: | |
| """๊ฐ๋ ์ AI ์ด๊ธฐ ํ๋กฌํํธ ์์ฑ - PPT ๊ตฌ์กฐ ์ค๊ณ""" | |
| return f"""๋น์ ์ ์ ๋ฌธ์ ์ธ PPT ๊ตฌ์กฐ๋ฅผ ์ค๊ณํ๋ ๊ฐ๋ ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ์ด ์ฃผ์ ์ ๋ํ ์ ๋ฌธ์ ์ธ PPT๋ฅผ ๋ง๋ค๊ธฐ ์ํด: | |
| 1. **PPT ์ ์ฒด ๊ตฌ์กฐ ์ค๊ณ** | |
| - ๋ชฉ์ ๊ณผ ํต์ฌ ๋ฉ์์ง ์ ์ | |
| - ํ๊ฒ ์ฒญ์ค ๋ถ์ ๋ฐ ํค ์ค์ | |
| - ์ ์ฒด ์ฌ๋ผ์ด๋ ๊ฐ์ ๋ฐ ํ๋ฆ ์ค๊ณ (10-15์ฅ ๊ถ์ฅ) | |
| 2. **์น์ ๋ณ ๊ตฌ์ฑ ์ ์** | |
| - ๋์ ๋ถ (ํ์ง, ๋ชฉ์ฐจ, ๋ฐฐ๊ฒฝ) | |
| - ๋ณธ๋ก (ํต์ฌ ๋ด์ฉ 3-4๊ฐ ์น์ ) | |
| - ๊ฒฐ๋ก ๋ถ (์์ฝ, ์์ฌ์ , Q&A) | |
| 3. **์กฐ์ฌ๊ฐ ํ์ํ ํต์ฌ ํค์๋** | |
| ์ด ์ฃผ์ ์ PPT๋ฅผ ์ํด ์กฐ์ฌ๊ฐ ํ์ํ 5-7๊ฐ์ ๊ตฌ์ฒด์ ์ธ ํค์๋๋ ๊ฒ์์ด๋ฅผ ์ ์ํ์ธ์. | |
| ํค์๋๋ ๋ค์ ํ์์ผ๋ก ์ ์ํ์ธ์: | |
| [๊ฒ์ ํค์๋]: ํค์๋1, ํค์๋2, ํค์๋3, ํค์๋4, ํค์๋5""" | |
| def create_researcher_prompt(self, ppt_topic: str, supervisor_guidance: str, search_results: Dict[str, List[Dict]]) -> str: | |
| """์กฐ์ฌ์ AI ํ๋กฌํํธ ์์ฑ - PPT ์ฝํ ์ธ ์กฐ์ฌ""" | |
| search_summary = "" | |
| all_results = [] | |
| for keyword, results in search_results.items(): | |
| search_summary += f"\n\n**{keyword}์ ๋ํ ๊ฒ์ ๊ฒฐ๊ณผ:**\n" | |
| for i, result in enumerate(results[:10], 1): # ์์ 10๊ฐ๋ง ํ์ | |
| search_summary += f"{i}. {result.get('title', 'N/A')} (์ ๋ขฐ๋: {result.get('credibility_score', 0):.2f})\n" | |
| search_summary += f" - {result.get('description', 'N/A')}\n" | |
| search_summary += f" - ์ถ์ฒ: {result.get('url', 'N/A')}\n" | |
| if result.get('published'): | |
| search_summary += f" - ๊ฒ์์ผ: {result.get('published')}\n" | |
| all_results.extend(results) | |
| # ๋ชจ์ ๊ฐ์ง | |
| contradictions = self.detect_contradictions(all_results) | |
| contradiction_text = "" | |
| if contradictions: | |
| contradiction_text = "\n\n**๋ฐ๊ฒฌ๋ ์ ๋ณด ๋ชจ์:**\n" | |
| for cont in contradictions[:3]: # ์ต๋ 3๊ฐ๋ง ํ์ | |
| contradiction_text += f"- {cont['type']}: {cont['source1']} vs {cont['source2']}\n" | |
| return f"""๋น์ ์ PPT ์ฝํ ์ธ ๋ฅผ ์ํ ์ ๋ณด๋ฅผ ์กฐ์ฌํ๊ณ ์ ๋ฆฌํ๋ ์กฐ์ฌ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ๊ฐ๋ ์ AI์ ๊ตฌ์กฐ ์ค๊ณ: | |
| {supervisor_guidance} | |
| ๋ธ๋ ์ด๋ธ ๊ฒ์ ๊ฒฐ๊ณผ (์ ๋ขฐ๋ ์ ์ ํฌํจ): | |
| {search_summary} | |
| {contradiction_text} | |
| ์ ๊ฒ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํ์ผ๋ก PPT์ ํฌํจํ ํต์ฌ ์ฝํ ์ธ ๋ฅผ ์ ๋ฆฌํ์ธ์: | |
| 1. **์๊ฐ์ ์๋ฃ ๊ฐ๋ฅํ ํต๊ณ/์์น** | |
| - ๊ทธ๋ํ๋ ์ฐจํธ๋ก ํํ ๊ฐ๋ฅํ ๋ฐ์ดํฐ | |
| - ์ธํฌ๊ทธ๋ํฝ์ผ๋ก ๋ณํ ๊ฐ๋ฅํ ์ ๋ณด | |
| 2. **ํต์ฌ ์ธ์ฌ์ดํธ์ ํธ๋ ๋** | |
| - ์ฒญ์ค์ ๊ด์ฌ์ ๋ ์ ์๋ ์ต์ ์ ๋ณด | |
| - ์ ๊ณ ๋ํฅ๊ณผ ๋ฏธ๋ ์ ๋ง | |
| 3. **์ฌ๋ก ์ฐ๊ตฌ ๋ฐ ์ฑ๊ณต ์คํ ๋ฆฌ** | |
| - ์ค์ ์ ์ฉ ์ฌ๋ก | |
| - ๋ฒค์น๋งํฌํ ์ ์๋ ๋ชจ๋ฒ ์ฌ๋ก | |
| 4. **์ ๋ฌธ๊ฐ ์๊ฒฌ ๋ฐ ์ธ์ฉ๊ตฌ** | |
| - ๊ถ์ ์๋ ์ถ์ฒ์ ์๊ฒฌ | |
| - PPT์ ์ธ์ฉํ ์ ์๋ ๋ช ์ธ | |
| 5. **์๊ฐ ์๋ฃ ์ถ์ฒ** | |
| - ๊ฐ ์ฌ๋ผ์ด๋์ ์ ํฉํ ์ด๋ฏธ์ง/์์ด์ฝ ์ ์ | |
| - ๋ํ๋ ๋ค์ด์ด๊ทธ๋จ ์์ด๋์ด""" | |
| def create_supervisor_execution_prompt(self, ppt_topic: str, research_summary: str) -> str: | |
| """๊ฐ๋ ์ AI์ ์คํ ์ง์ ํ๋กฌํํธ - PPT ์ ์ ์ง์""" | |
| return f"""๋น์ ์ PPT ์ ์์ ์ด๊ดํ๋ ๊ฐ๋ ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ์กฐ์ฌ์ AI๊ฐ ์ ๋ฆฌํ ์ฝํ ์ธ : | |
| {research_summary} | |
| ์ ์กฐ์ฌ ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ์คํ์ AI์๊ฒ ๊ตฌ์ฒด์ ์ธ PPT ์ ์ ์ง์๋ฅผ ๋ด๋ ค์ฃผ์ธ์: | |
| 1. **์ฌ๋ผ์ด๋๋ณ ์์ธ ๊ตฌ์ฑ** | |
| - ๊ฐ ์ฌ๋ผ์ด๋์ ์ ๋ชฉ๊ณผ ํต์ฌ ๋ฉ์์ง | |
| - ํฌํจํ ๊ตฌ์ฒด์ ์ธ ์ฝํ ์ธ ์ง์ | |
| - ์๊ฐ ์๋ฃ ๋ฐฐ์น ๋ฐฉ์ | |
| 2. **๋์์ธ ๊ฐ์ด๋๋ผ์ธ** | |
| - ์ ์ฒด์ ์ธ ํค๊ณผ ์คํ์ผ (์ ๋ฌธ์ /์ฐฝ์์ /๋ฏธ๋๋ฉ ๋ฑ) | |
| - ์์ ํ๋ ํธ ์ ์ | |
| - ํฐํธ ๋ฐ ๋ ์ด์์ ์์น | |
| 3. **์คํ ๋ฆฌํ ๋ง ์ ๋ต** | |
| - ๋์ ๋ถ์์ ์ฒญ์ค์ ๊ด์ฌ์ ๋๋ ๋ฐฉ๋ฒ | |
| - ํต์ฌ ๋ฉ์์ง ์ ๋ฌ ์์ | |
| - ๊ฒฐ๋ก ๋ถ์ ์ํฉํธ ์๋ ๋ง๋ฌด๋ฆฌ | |
| 4. **์๊ฐํ ์ง์นจ** | |
| - ๊ฐ ๋ฐ์ดํฐ์ ์ต์ ์๊ฐํ ๋ฐฉ๋ฒ | |
| - ๋ณต์กํ ๊ฐ๋ ์ ๋จ์ํ ๋ฐฉ์ | |
| - ์ ๋๋ฉ์ด์ ํจ๊ณผ ์ ์""" | |
| def create_executor_prompt(self, ppt_topic: str, supervisor_guidance: str, research_summary: str) -> str: | |
| """์คํ์ AI ํ๋กฌํํธ ์์ฑ - PPT ์ฌ๋ผ์ด๋ ์์ฑ""" | |
| return f"""๋น์ ์ ์ค์ PPT ์ฌ๋ผ์ด๋ ๋ด์ฉ์ ์์ฑํ๋ ์คํ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ์กฐ์ฌ์ AI๊ฐ ์ ๋ฆฌํ ์ฝํ ์ธ : | |
| {research_summary} | |
| ๊ฐ๋ ์ AI์ ์ ์ ์ง์: | |
| {supervisor_guidance} | |
| ์ ์ ๋ณด๋ฅผ ๋ฐํ์ผ๋ก ์ค์ PPT ์ฌ๋ผ์ด๋๋ฅผ ์์ฑํ์ธ์: | |
| 1. **๊ฐ ์ฌ๋ผ์ด๋๋ฅผ ๋ค์ ํ์์ผ๋ก ์์ฑ**: | |
| [์ฌ๋ผ์ด๋ X] | |
| ์ ๋ชฉ: | |
| ๋ถ์ ๋ชฉ: (์ ํ์ฌํญ) | |
| โข ๐ฏ ์ฒซ ๋ฒ์งธ ํต์ฌ ํฌ์ธํธ | |
| โข ๐ก ๋ ๋ฒ์งธ ํต์ฌ ํฌ์ธํธ | |
| โข ๐ ์ธ ๋ฒ์งธ ํต์ฌ ํฌ์ธํธ | |
| โข โ ๋ค ๋ฒ์งธ ํต์ฌ ํฌ์ธํธ | |
| โข ๐ ๋ค์ฏ ๋ฒ์งธ ํต์ฌ ํฌ์ธํธ | |
| ๋ฐํ์ ๋ ธํธ: (์ค์ ๋ฐํํ ๋ ์ฌ์ฉํ ๊ตฌ์ด์ฒด ์คํฌ๋ฆฝํธ - ์ต์ 3-4๋ฌธ์ฅ) | |
| 2. **์์ฑ ์์น** | |
| - ํ ์ฌ๋ผ์ด๋์ ํ๋์ ํต์ฌ ๋ฉ์์ง | |
| - ํ ์คํธ๋ ์ต์ํ, ์๊ฐ์ ์์ ๊ทน๋ํ | |
| - 6x6 ๊ท์น ์ค์ (6์ค ์ดํ, ์ค๋น 6๋จ์ด ์ดํ) | |
| - ์ ๋ฌธ์ ์ด๋ฉด์๋ ์ดํดํ๊ธฐ ์ฌ์ด ์ธ์ด ์ฌ์ฉ | |
| - ๊ฐ ๋ถ๋ฆฟ ํฌ์ธํธ๋ ๋ฐ๋์ ์ด๋ชจ์ง๋ก ์์ | |
| 3. **๋ฐํ์ ๋ ธํธ ์์ฑ ์ง์นจ** | |
| - ์ฌ๋ผ์ด๋ ๋ด์ฉ์ ์์ฐ์ค๋ฝ๊ฒ ์ค๋ช ํ๋ ๊ตฌ์ด์ฒด ์ฌ์ฉ | |
| - ๊ฐ ํฌ์ธํธ๋ฅผ ํ์ด์ ์ค๋ช ํ๊ณ ์ฐ๊ฒฐ | |
| - ์ฒญ์ค๊ณผ ์ํตํ๋ ๋๋์ ๋ํ์ฒด ("์ฌ๋ฌ๋ถ", "์ฐ๋ฆฌ๊ฐ", "ํจ๊ป") | |
| - ์ต์ 3-4๋ฌธ์ฅ์ผ๋ก ํ๋ถํ๊ฒ ์์ฑ | |
| - ์์: "์, ์ด์ ์ฐ๋ฆฌ๊ฐ ์ฃผ๋ชฉํด์ผ ํ ํต์ฌ ํฌ์ธํธ๋ค์ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ฒซ ๋ฒ์งธ๋ก ์์ฅ ๊ท๋ชจ๋ฅผ ๋ณด์๋ฉด..." | |
| 4. **ํ์ ํฌํจ ์ฌ๋ผ์ด๋** | |
| - ํ์ง (์ ๋ชฉ, ๋ถ์ ๋ชฉ, ๋ฐํ์/๋ ์ง) | |
| - ๋ชฉ์ฐจ | |
| - ํต์ฌ ๋ด์ฉ ์ฌ๋ผ์ด๋๋ค | |
| - ์์ฝ/๊ฒฐ๋ก | |
| - Q&A/๊ฐ์ฌ ์ฌ๋ผ์ด๋""" | |
| def create_supervisor_review_prompt(self, ppt_topic: str, executor_response: str, research_summary: str) -> str: | |
| """๊ฐ๋ ์ AI์ ๊ฒํ ํ๋กฌํํธ - PPT ๊ฒํ ๋ฐ ํผ๋๋ฐฑ""" | |
| return f"""๋น์ ์ PPT ํ์ง์ ๊ฒํ ํ๊ณ ๊ฐ์ ์ ์ ์ ์ํ๋ ๊ฐ๋ ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ์กฐ์ฌ์ AI๊ฐ ์ ๊ณตํ ์ฝํ ์ธ : | |
| {research_summary} | |
| ์คํ์ AI์ PPT ์ด์: | |
| {executor_response} | |
| ์ PPT ์ด์์ ๊ฒํ ํ๊ณ ๋ค์ ๊ด์ ์์ ๊ตฌ์ฒด์ ์ธ ํผ๋๋ฐฑ์ ์ ๊ณตํ์ธ์: | |
| 1. **์ฝํ ์ธ ํ์ง** | |
| - ์กฐ์ฌ ๋ด์ฉ์ด ์ถฉ๋ถํ ๋ฐ์๋์๋์ง | |
| - ๊ฐ ์ฌ๋ผ์ด๋์ ๋ฉ์์ง๊ฐ ๋ช ํํ์ง | |
| - ๋ ผ๋ฆฌ์ ํ๋ฆ์ด ์์ฐ์ค๋ฌ์ด์ง | |
| 2. **์๊ฐ์ ํจ๊ณผ** | |
| - ํ ์คํธ์ ์๊ฐ ์์์ ๊ท ํ | |
| - ์ฌ๋ผ์ด๋๋ณ ์ผ๊ด์ฑ | |
| - ์ฒญ์ค์ ์ดํด๋ฅผ ๋๋ ๊ตฌ์ฑ์ธ์ง | |
| 3. **๋ฐํ ์ค๋น๋** | |
| - ๋ฐํ์ ๋ ธํธ์ ์ถฉ์ค์ฑ | |
| - ์์ ์ง๋ฌธ์ ๋ํ ๋๋น | |
| - ์๊ฐ ๋ฐฐ๋ถ์ ์ ์ ์ฑ | |
| 4. **๊ฐ์ ํ์์ฌํญ** | |
| - ๊ตฌ์ฒด์ ์ธ ์์ ์ง์์ฌํญ | |
| - ์ถ๊ฐํด์ผ ํ ๋ด์ฉ | |
| - ์ญ์ ํ๊ฑฐ๋ ๊ฐ์ํํ ๋ถ๋ถ | |
| 5. **์ต์ข ์ ๊ฒ์ฌํญ** | |
| - ์คํ๋ ๋ฌธ๋ฒ ์ค๋ฅ | |
| - ๋ฐ์ดํฐ์ ์ ํ์ฑ | |
| - ์ ๋ฌธ์ฑ๊ณผ ์ ๋ขฐ์ฑ""" | |
| def create_executor_final_prompt(self, ppt_topic: str, initial_response: str, supervisor_feedback: str, research_summary: str) -> str: | |
| """์คํ์ AI ์ต์ข PPT ํ๋กฌํํธ""" | |
| return f"""๋น์ ์ ์ต์ข PPT๋ฅผ ์์ฑํ๋ ์คํ์ AI์ ๋๋ค. | |
| PPT ์ฃผ์ : {ppt_topic} | |
| ์กฐ์ฌ์ AI์ ์ฝํ ์ธ : | |
| {research_summary} | |
| ๋น์ ์ ์ด๊ธฐ PPT ์ด์: | |
| {initial_response} | |
| ๊ฐ๋ ์ AI์ ํผ๋๋ฐฑ: | |
| {supervisor_feedback} | |
| ์ ํผ๋๋ฐฑ์ ์์ ํ ๋ฐ์ํ์ฌ ์ต์ข PPT๋ฅผ ์์ฑํ์ธ์: | |
| 1. **๊ฐ์ ์ฌํญ ๋ฐ์** | |
| - ๊ฐ๋ ์์ ๋ชจ๋ ํผ๋๋ฐฑ ์ ์ฉ | |
| - ์คํ ๋ฆฌ๋ผ์ธ ๊ฐํ | |
| - ์๊ฐ์ ์ผ๊ด์ฑ ํ๋ณด | |
| 2. **๋ฐํ์ ๋ ธํธ ๊ฐํ** | |
| - ๊ฐ ์ฌ๋ผ์ด๋๋ง๋ค ํ๋ถํ ๊ตฌ์ด์ฒด ๋ฐํ ์คํฌ๋ฆฝํธ ์์ฑ | |
| - ์ต์ 4-5๋ฌธ์ฅ์ผ๋ก ์์ธํ๊ฒ | |
| - ์ค์ ๋ฐํ ์ํฉ์ ๊ฐ์ ํ ์์ฐ์ค๋ฌ์ด ๋ํ์ฒด | |
| - ์์: "์, ์ด์ ์์ฅ ํํฉ์ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ฌ๋ฌ๋ถ๋ ์์๋ค์ํผ ์ต๊ทผ ๋์งํธ ์ ํ์ด ๊ฐ์ํ๋๋ฉด์..." | |
| 3. **์ต์ข ํ์ง ์ฒดํฌ** | |
| - ์ ๋ฌธ์ฑ๊ณผ ์์ฑ๋ ํฅ์ | |
| - ์คํ ๋ฐ ๋ฌธ๋ฒ ๊ฒํ | |
| - ๋ ผ๋ฆฌ์ ํ๋ฆ ์ฌํ์ธ | |
| 4. **ํ๋ ์ ํ ์ด์ ์ค๋น** | |
| - ๊ฐ ์ฌ๋ผ์ด๋๋ณ ๋ฐํ ์คํฌ๋ฆฝํธ ์ถ๊ฐ | |
| - ์์ ์ง๋ฌธ๊ณผ ๋ต๋ณ ์ค๋น | |
| - ์๊ฐ ๋ฐฐ๋ถ ์ ์ (20๋ถ ๋ฐํ ๊ธฐ์ค) | |
| 5. **์ถ๊ฐ ์๋ฃ** | |
| - ๋ฐฑ์ ์ฌ๋ผ์ด๋ ์ ์ | |
| - ์ฐธ๊ณ ์๋ฃ ๋ชฉ๋ก | |
| - ์ธ์์ฉ ํธ๋์์ ๋ฒ์ ์ ์""" | |
| def extract_keywords(self, supervisor_response: str) -> List[str]: | |
| """๊ฐ๋ ์ ์๋ต์์ ํค์๋ ์ถ์ถ""" | |
| keywords = [] | |
| # [๊ฒ์ ํค์๋]: ํ์์ผ๋ก ํค์๋ ์ฐพ๊ธฐ | |
| keyword_match = re.search(r'\[๊ฒ์ ํค์๋\]:\s*(.+)', supervisor_response, re.IGNORECASE) | |
| if keyword_match: | |
| keyword_str = keyword_match.group(1) | |
| keywords = [k.strip() for k in keyword_str.split(',') if k.strip()] | |
| # ํค์๋๊ฐ ์์ผ๋ฉด ๊ธฐ๋ณธ ํค์๋ ์์ฑ | |
| if not keywords: | |
| keywords = ["industry trends", "market analysis", "case studies", "best practices", "future outlook"] | |
| return keywords[:7] # ์ต๋ 7๊ฐ๋ก ์ ํ | |
| def generate_synonyms(self, keyword: str) -> List[str]: | |
| """ํค์๋์ ๋์์ด/์ ์ฌ์ด ์์ฑ""" | |
| synonyms = { | |
| "trend": ["tendency", "direction", "movement", "pattern"], | |
| "analysis": ["evaluation", "assessment", "study", "research"], | |
| "strategy": ["approach", "plan", "tactics", "methodology"], | |
| "market": ["industry", "sector", "business", "commerce"], | |
| "innovation": ["breakthrough", "advancement", "revolution", "disruption"], | |
| "growth": ["expansion", "development", "progress", "advancement"], | |
| "presentation": ["pitch", "proposal", "demonstration", "showcase"], | |
| "data": ["statistics", "metrics", "analytics", "insights"], | |
| "technology": ["tech", "digital", "IT", "innovation"], | |
| "business": ["enterprise", "corporate", "commercial", "company"] | |
| } | |
| # ํค์๋ ์ ๊ทํ | |
| keyword_lower = keyword.lower() | |
| # ์ง์ ๋งค์นญ๋๋ ๋์์ด๊ฐ ์์ผ๋ฉด ๋ฐํ | |
| if keyword_lower in synonyms: | |
| return synonyms[keyword_lower][:2] # ์ต๋ 2๊ฐ | |
| # ๋ถ๋ถ ๋งค์นญ ํ์ธ | |
| for key, values in synonyms.items(): | |
| if key in keyword_lower or keyword_lower in key: | |
| return values[:2] | |
| # ๋์์ด๊ฐ ์์ผ๋ฉด ๋น ๋ฆฌ์คํธ | |
| return [] | |
| def calculate_credibility_score(self, result: Dict) -> float: | |
| """๊ฒ์ ๊ฒฐ๊ณผ์ ์ ๋ขฐ๋ ์ ์ ๊ณ์ฐ (0-1)""" | |
| score = 0.5 # ๊ธฐ๋ณธ ์ ์ | |
| url = result.get('url', '') | |
| title = result.get('title', '') | |
| description = result.get('description', '') | |
| # URL ๊ธฐ๋ฐ ์ ์ | |
| trusted_domains = [ | |
| '.edu', '.gov', '.org', 'wikipedia.org', 'harvard.edu', | |
| 'mckinsey.com', 'deloitte.com', 'pwc.com', 'gartner.com', | |
| 'forrester.com', 'statista.com', 'bloomberg.com', 'reuters.com' | |
| ] | |
| for domain in trusted_domains: | |
| if domain in url: | |
| score += 0.2 | |
| break | |
| # HTTPS ์ฌ์ฉ ์ฌ๋ถ | |
| if url.startswith('https://'): | |
| score += 0.1 | |
| # ์ ๋ชฉ๊ณผ ์ค๋ช ์ ๊ธธ์ด (๋๋ฌด ์งง์ผ๋ฉด ์ ๋ขฐ๋ ๊ฐ์) | |
| if len(title) > 20: | |
| score += 0.05 | |
| if len(description) > 50: | |
| score += 0.05 | |
| # ๊ด๊ณ /์คํธ ํค์๋ ์ฒดํฌ | |
| spam_keywords = ['buy now', 'sale', 'discount', 'click here', '100% free'] | |
| if any(spam in (title + description).lower() for spam in spam_keywords): | |
| score -= 0.3 | |
| # ๋ ์ง ์ ๋ณด๊ฐ ์์ผ๋ฉด ๊ฐ์ฐ์ | |
| if any(year in description for year in ['2024', '2023', '2022']): | |
| score += 0.1 | |
| return max(0, min(1, score)) # 0-1 ๋ฒ์๋ก ์ ํ | |
| def detect_contradictions(self, results: List[Dict]) -> List[Dict]: | |
| """๊ฒ์ ๊ฒฐ๊ณผ ๊ฐ ๋ชจ์ ๊ฐ์ง""" | |
| contradictions = [] | |
| # ๊ฐ๋จํ ๋ชจ์ ๊ฐ์ง ํจํด | |
| opposite_pairs = [ | |
| ("increase", "decrease"), | |
| ("improve", "worsen"), | |
| ("effective", "ineffective"), | |
| ("success", "failure"), | |
| ("benefit", "harm"), | |
| ("positive", "negative"), | |
| ("growth", "decline") | |
| ] | |
| # ๊ฒฐ๊ณผ๋ค์ ๋น๊ต | |
| for i in range(len(results)): | |
| for j in range(i + 1, len(results)): | |
| desc1 = results[i].get('description', '').lower() | |
| desc2 = results[j].get('description', '').lower() | |
| # ๋ฐ๋ ๊ฐ๋ ์ด ํฌํจ๋์ด ์๋์ง ํ์ธ | |
| for word1, word2 in opposite_pairs: | |
| if (word1 in desc1 and word2 in desc2) or (word2 in desc1 and word1 in desc2): | |
| # ๊ฐ์ ์ฃผ์ ์ ๋ํด ๋ฐ๋ ์๊ฒฌ์ธ์ง ํ์ธ | |
| common_words = set(desc1.split()) & set(desc2.split()) | |
| if len(common_words) > 5: # ๊ณตํต ๋จ์ด๊ฐ 5๊ฐ ์ด์์ด๋ฉด ๊ฐ์ ์ฃผ์ ๋ก ๊ฐ์ฃผ | |
| contradictions.append({ | |
| 'source1': results[i]['url'], | |
| 'source2': results[j]['url'], | |
| 'type': f"{word1} vs {word2}", | |
| 'desc1': results[i]['description'][:100], | |
| 'desc2': results[j]['description'][:100] | |
| }) | |
| return contradictions | |
| def brave_search(self, query: str) -> List[Dict]: | |
| """Brave Search API ํธ์ถ""" | |
| if self.test_mode or self.bapi_token == "YOUR_BRAVE_API_TOKEN": | |
| # ํ ์คํธ ๋ชจ๋์์๋ ์๋ฎฌ๋ ์ด์ ๋ ๊ฒฐ๊ณผ ๋ฐํ | |
| test_results = [] | |
| for i in range(5): | |
| test_results.append({ | |
| "title": f"{query} - Industry Report {i+1}", | |
| "description": f"Comprehensive analysis of {query} including market trends, key statistics, and future projections for strategic planning.", | |
| "url": f"https://report{i+1}.com/{query.replace(' ', '-')}", | |
| "credibility_score": 0.7 + (i * 0.05) | |
| }) | |
| return test_results | |
| try: | |
| params = { | |
| "q": query, | |
| "count": 20, # 20๊ฐ๋ก ์ฆ๊ฐ | |
| "safesearch": "moderate", | |
| "freshness": "pw" # Past week for recent results | |
| } | |
| response = requests.get( | |
| self.brave_url, | |
| headers=self.create_brave_headers(), | |
| params=params, | |
| timeout=10 | |
| ) | |
| if response.status_code == 200: | |
| data = response.json() | |
| results = [] | |
| for item in data.get("web", {}).get("results", [])[:20]: | |
| result = { | |
| "title": item.get("title", ""), | |
| "description": item.get("description", ""), | |
| "url": item.get("url", ""), | |
| "published": item.get("published", "") | |
| } | |
| # ์ ๋ขฐ๋ ์ ์ ๊ณ์ฐ | |
| result["credibility_score"] = self.calculate_credibility_score(result) | |
| results.append(result) | |
| # ์ ๋ขฐ๋ ์ ์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ | |
| results.sort(key=lambda x: x['credibility_score'], reverse=True) | |
| return results | |
| else: | |
| logger.error(f"Brave API ์ค๋ฅ: {response.status_code}") | |
| return [] | |
| except Exception as e: | |
| logger.error(f"Brave ๊ฒ์ ์ค ์ค๋ฅ: {str(e)}") | |
| return [] | |
| def simulate_streaming(self, text: str, role: str) -> Generator[str, None, None]: | |
| """ํ ์คํธ ๋ชจ๋์์ ์คํธ๋ฆฌ๋ฐ ์๋ฎฌ๋ ์ด์ """ | |
| words = text.split() | |
| for i in range(0, len(words), 3): | |
| chunk = " ".join(words[i:i+3]) | |
| yield chunk + " " | |
| time.sleep(0.05) | |
| def call_llm_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]: | |
| """์คํธ๋ฆฌ๋ฐ LLM API ํธ์ถ""" | |
| # ํ ์คํธ ๋ชจ๋ | |
| if self.test_mode: | |
| logger.info(f"ํ ์คํธ ๋ชจ๋ ์คํธ๋ฆฌ๋ฐ - Role: {role}") | |
| test_responses = { | |
| "supervisor_initial": """์ ๋ฌธ์ ์ธ PPT ๊ตฌ์กฐ๋ฅผ ์ค๊ณํ๊ฒ ์ต๋๋ค. | |
| ## 1. PPT ์ ์ฒด ๊ตฌ์กฐ ์ค๊ณ | |
| **๋ชฉ์ **: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ํต์ฌ ์์์ ์ฑ๊ณต ์ ๋ต์ ๋ช ํํ๊ฒ ์ ๋ฌ | |
| **ํ๊ฒ ์ฒญ์ค**: ๊ฒฝ์์ง ๋ฐ ์์ฌ๊ฒฐ์ ์ | |
| **ํค**: ์ ๋ฌธ์ ์ด๊ณ ์ค๋๋ ฅ ์๋ ๋น์ฆ๋์ค ์คํ์ผ | |
| **์ ์ฒด ์ฌ๋ผ์ด๋**: 12์ฅ | |
| ## 2. ์น์ ๋ณ ๊ตฌ์ฑ | |
| ### ๋์ ๋ถ (3์ฅ) | |
| - ์ฌ๋ผ์ด๋ 1: ํ์ง - ์ํฉํธ ์๋ ์ ๋ชฉ๊ณผ ๋น์ฃผ์ผ | |
| - ์ฌ๋ผ์ด๋ 2: ๋ชฉ์ฐจ - ์ ์ฒด ํ๋ฆ ์ ์ | |
| - ์ฌ๋ผ์ด๋ 3: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ํ์์ฑ | |
| ### ๋ณธ๋ก (7์ฅ) | |
| **์น์ 1: ํํฉ ๋ถ์ (2์ฅ)** | |
| - ์ฌ๋ผ์ด๋ 4: ์ฐ์ ๋ณ ๋์งํธํ ํํฉ | |
| - ์ฌ๋ผ์ด๋ 5: ์ฃผ์ ๋์ ๊ณผ์ | |
| **์น์ 2: ํต์ฌ ์ ๋ต (3์ฅ)** | |
| - ์ฌ๋ผ์ด๋ 6: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ํ๋ ์์ํฌ | |
| - ์ฌ๋ผ์ด๋ 7: ๊ธฐ์ ์คํ ๋ฐ ์ธํ๋ผ | |
| - ์ฌ๋ผ์ด๋ 8: ๋ณํ ๊ด๋ฆฌ ์ ๋ต | |
| **์น์ 3: ์ฑ๊ณต ์ฌ๋ก (2์ฅ)** | |
| - ์ฌ๋ผ์ด๋ 9: ๊ธ๋ก๋ฒ ์ฑ๊ณต ์ฌ๋ก | |
| - ์ฌ๋ผ์ด๋ 10: ROI ๋ฐ ์ฑ๊ณผ ์งํ | |
| ### ๊ฒฐ๋ก ๋ถ (2์ฅ) | |
| - ์ฌ๋ผ์ด๋ 11: ํต์ฌ ์์ฌ์ ๋ฐ ๊ถ๊ณ ์ฌํญ | |
| - ์ฌ๋ผ์ด๋ 12: Q&A | |
| ## 3. ๋น์ฃผ์ผ ์ ๋ต | |
| - ์์: ๊ธฐ์ ๋ธ๋ฃจ(#003366) + ์ ์ผํธ ์ค๋ ์ง(#FF6B35) | |
| - ์์ด์ฝ: ๋ชจ๋ํ๊ณ ํ๋ซํ ๋์์ธ | |
| - ์ฐจํธ: ๋ฐ์ดํฐ ์๊ฐํ ์ค์ฌ | |
| [๊ฒ์ ํค์๋]: digital transformation trends 2024, DX success cases, digital transformation ROI, change management digital, industry 4.0 statistics""", | |
| "researcher": """PPT ์ฝํ ์ธ ๋ฅผ ์ํ ํต์ฌ ์ ๋ณด๋ฅผ ์ ๋ฆฌํ์ต๋๋ค. | |
| ## 1. ์๊ฐ์ ์๋ฃ ๊ฐ๋ฅํ ํต๊ณ/์์น (์ ๋ขฐ๋ ๋์) | |
| **๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ํฌ์ ํํฉ** | |
| - 2024๋ ๊ธ๋ก๋ฒ DX ํฌ์ ๊ท๋ชจ: $3.4์กฐ (์ ๋ขฐ๋: 0.92) | |
| - ์ฐํ๊ท ์ฑ์ฅ๋ฅ (CAGR): 16.5% (2023-2027) | |
| - ์ถ์ฒ: IDC Digital Transformation Spending Guide | |
| **์ฐ์ ๋ณ ๋์งํธํ ์์ค** | |
| - ๊ธ์ต: 78% ๋์งํธํ ์๋ฃ (์ ๋ขฐ๋: 0.88) | |
| - ์ ์กฐ: 52% ์งํ ์ค (์ ๋ขฐ๋: 0.85) | |
| - ํฌ์ค์ผ์ด: 61% ๊ฐ์ํ ๋จ๊ณ | |
| - ์ถ์ฒ: McKinsey Global Institute | |
| ## 2. ํต์ฌ ์ธ์ฌ์ดํธ์ ํธ๋ ๋ (์ ๋ขฐ๋ ๋์) | |
| **2024๋ ์ฃผ์ ํธ๋ ๋** | |
| 1. AI/ML ํตํฉ: 87%์ ๊ธฐ์ ์ด AI๋ฅผ DX ํต์ฌ ์์๋ก ์ฑํ (์ ๋ขฐ๋: 0.90) | |
| 2. ํด๋ผ์ฐ๋ ์ฐ์ : 94%๊ฐ ํ์ด๋ธ๋ฆฌ๋ ํด๋ผ์ฐ๋ ์ ๋ต ์ถ์ง | |
| 3. ๋ฐ์ดํฐ ์ค์ฌ: ์ค์๊ฐ ๋ถ์์ด ๊ฒฝ์๋ ฅ์ ํต์ฌ | |
| - ์ถ์ฒ: Gartner Technology Trends 2024 | |
| ## 3. ์ฌ๋ก ์ฐ๊ตฌ ๋ฐ ์ฑ๊ณต ์คํ ๋ฆฌ (์ ๋ขฐ๋ ๋์) | |
| **Amazon ์ฌ๋ก** | |
| - ๋ฌผ๋ฅ ์๋ํ๋ก ๋ฐฐ์ก ์๊ฐ 40% ๋จ์ถ (์ ๋ขฐ๋: 0.87) | |
| - AI ๊ธฐ๋ฐ ์ถ์ฒ์ผ๋ก ๋งค์ถ 35% ์ฆ๊ฐ | |
| - ์ถ์ฒ: Amazon Annual Report 2023 | |
| **Starbucks ๋์งํธ ํ์ ** | |
| - ๋ชจ๋ฐ์ผ ์ฃผ๋ฌธ ๋น์ค: ์ ์ฒด ๋งค์ถ์ 26% (์ ๋ขฐ๋: 0.85) | |
| - ๊ฐ์ธํ ๋ง์ผํ ์ผ๋ก ๊ณ ๊ฐ ์ถฉ์ฑ๋ 23% ํฅ์ | |
| - ์ถ์ฒ: Starbucks Investor Relations | |
| ## 4. ์ ๋ฌธ๊ฐ ์๊ฒฌ ๋ฐ ์ธ์ฉ๊ตฌ | |
| > "๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ๊ธฐ์ ์ด ์๋ ์ฌ๋๊ณผ ๋ฌธํ์ ๋ณํ๋ค" | |
| - Satya Nadella, Microsoft CEO | |
| > "2025๋ ๊น์ง ๋์งํธ ๋ฆฌ๋์ ํ๋ฐ์ฃผ์์ ๊ฒฉ์ฐจ๋ 2๋ฐฐ ์ด์ ๋ฒ์ด์ง ๊ฒ" | |
| - Michael Porter, Harvard Business School | |
| ## 5. ์๊ฐ ์๋ฃ ์ถ์ฒ | |
| **์ฌ๋ผ์ด๋๋ณ ๋น์ฃผ์ผ ์ ์** | |
| - ํ์ง: ๋คํธ์ํฌ ์ฐ๊ฒฐ ์ด๋ฏธ์ง + ๋์ ์ธ ๋ฐ์ดํฐ ํ๋ฆ | |
| - ํต๊ณ: ์ธํฐ๋ํฐ๋ธํ ๋์๋ณด๋ ์คํ์ผ ์ฐจํธ | |
| - ํ๋ ์์ํฌ: ๊ณ์ธต์ ๋ค์ด์ด๊ทธ๋จ + ์์ด์ฝ | |
| - ์ฌ๋ก: ๊ธฐ์ ๋ก๊ณ + ํต์ฌ ์งํ ์ธํฌ๊ทธ๋ํฝ | |
| - ํ์๋ผ์ธ: ๋ก๋๋งต ํํ์ ๋จ๊ณ๋ณ ์งํ๋ | |
| **์์ด์ฝ ์ธํธ** | |
| - ๊ธฐ์ : ํด๋ผ์ฐ๋, AI, ๋ฐ์ดํฐ, ๋ณด์ | |
| - ๋น์ฆ๋์ค: ์ฑ์ฅ, ํ์ , ํ์ , ํจ์จ์ฑ | |
| - ์ฌ๋: ๋ฆฌ๋์ญ, ํ์ํฌ, ์คํฌ, ๋ฌธํ""", | |
| "supervisor_execution": """์กฐ์ฌ ๋ด์ฉ์ ๋ฐํ์ผ๋ก PPT ์ ์์ ์ํ ๊ตฌ์ฒด์ ์ธ ์ง์์ฌํญ์ ๋๋ค. | |
| ## 1. ์ฌ๋ผ์ด๋๋ณ ์์ธ ๊ตฌ์ฑ | |
| **์ฌ๋ผ์ด๋ 1: ํ์ง** | |
| - ์ ๋ชฉ: "๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ : ๋ฏธ๋๋ฅผ ํฅํ ๋์ฝ" | |
| - ๋ถ์ ๋ชฉ: "์ฑ๊ณต์ ์ธ DX ์ ๋ต๊ณผ ์คํ ๋ฐฉ์" | |
| - ๋น์ฃผ์ผ: ์ฐ๊ฒฐ๋ ๋์งํธ ๋คํธ์ํฌ ๋ฐฐ๊ฒฝ | |
| - ์กฐ์ฌ ์๋ฃ ํ์ฉ: $3.4์กฐ ์์ฅ ๊ท๋ชจ ๊ฐ์กฐ | |
| **์ฌ๋ผ์ด๋ 4: ์ฐ์ ๋ณ ํํฉ** | |
| - ์กฐ์ฌ๋ ํต๊ณ ํ์ฉ: ๊ธ์ต(78%), ์ ์กฐ(52%), ํฌ์ค์ผ์ด(61%) | |
| - ์ํ ์ฐจํธ + ์งํ ๋ฐ ์กฐํฉ | |
| - ๊ฐ ์ฐ์ ๋ณ ๋ํ ์์ด์ฝ ๋ฐฐ์น | |
| **์ฌ๋ผ์ด๋ 7: ๊ธฐ์ ์คํ** | |
| - AI/ML(87% ์ฑํ๋ฅ ) ์ค์ฌ์ผ๋ก ๊ตฌ์ฑ | |
| - ํด๋ผ์ฐ๋(94%) ํ์ด๋ธ๋ฆฌ๋ ์ ๋ต ์๊ฐํ | |
| - ๊ณ์ธต์ ๋ค์ด์ด๊ทธ๋จ ์ฌ์ฉ | |
| **์ฌ๋ผ์ด๋ 9: ์ฑ๊ณต ์ฌ๋ก** | |
| - Amazon๊ณผ Starbucks ์ฌ๋ก ๋๋น | |
| - ํต์ฌ ์ฑ๊ณผ ์งํ ์ธํฌ๊ทธ๋ํฝ | |
| - Before/After ๋น๊ต ํ์ | |
| ## 2. ๋์์ธ ๊ฐ์ด๋๋ผ์ธ | |
| **์์ ํ๋ ํธ** | |
| - ์ฃผ์์: ๋ค์ด๋น ๋ธ๋ฃจ (#1E3A8A) | |
| - ๋ณด์กฐ์์: ์ค์นด์ด ๋ธ๋ฃจ (#3B82F6) | |
| - ๊ฐ์กฐ์์: ์ค๋ ์ง (#F59E0B) | |
| - ๋ฐฐ๊ฒฝ: ํ์ดํธ/๋ผ์ดํธ ๊ทธ๋ ์ด | |
| **ํ์ดํฌ๊ทธ๋ํผ** | |
| - ์ ๋ชฉ: Montserrat Bold (32-40pt) | |
| - ๋ณธ๋ฌธ: Open Sans Regular (18-24pt) | |
| - ๊ฐ์กฐ: Open Sans Semi-Bold | |
| **๋ ์ด์์ ์์น** | |
| - ์ฌ๋ฐฑ ์ถฉ๋ถํ ํ์ฉ (40% ์ด์) | |
| - ์ข์ฐ ๋์นญ ๋๋ ํฉ๊ธ๋น์จ | |
| - ํ ์ฌ๋ผ์ด๋ ํ ๋ฉ์์ง ์์น | |
| ## 3. ์คํ ๋ฆฌํ ๋ง ์ ๋ต | |
| **๋์ ๋ถ ์ ๋ต** | |
| - ์ถฉ๊ฒฉ์ ์ธ ํต๊ณ๋ก ์์ ($3.4์กฐ ์์ฅ) | |
| - "์ ์ง๊ธ์ธ๊ฐ?" ์ง๋ฌธ ์ ๊ธฐ | |
| - ์ฒญ์ค์ pain point ๊ณต๊ฐ | |
| **์ ๊ฐ ๋ฐฉ์** | |
| - ๋ฌธ์ โ ํด๊ฒฐ์ฑ โ ์ฆ๊ฑฐ โ ํ๋ | |
| - ๊ฐ ์น์ ๊ฐ ์์ฐ์ค๋ฌ์ด ์ ํ | |
| - ์ฌ๋ก๋ฅผ ํตํ ๊ตฌ์ฒดํ | |
| **ํด๋ผ์ด๋งฅ์ค** | |
| - ROI ๋ฐ์ดํฐ๋ก ์ค๋๋ ฅ ๊ทน๋ํ | |
| - ์ฑ๊ณต ๊ธฐ์ ๊ณผ์ ๊ฒฉ์ฐจ ์๊ฐํ | |
| - ํ๋ ์ด๊ตฌ ๋ฉ์์ง | |
| ## 4. ์๊ฐํ ์ง์นจ | |
| **๋ฐ์ดํฐ ์๊ฐํ** | |
| - ์ฐ์ ๋ณ ํํฉ: ๋ฐฉ์ฌํ ์ฐจํธ | |
| - ์ฑ์ฅ๋ฅ : ์์น ๊ณก์ ๊ทธ๋ํ | |
| - ROI: ๊ณ์ฐ๊ธฐ ์คํ์ผ ์ธํฌ๊ทธ๋ํฝ | |
| - ํ๋ก์ธ์ค: ์ํํ ๋ค์ด์ด๊ทธ๋จ | |
| **์ ๋๋ฉ์ด์ ํจ๊ณผ** | |
| - ์ฌ๋ผ์ด๋ ์ ํ: Morph ํจ๊ณผ | |
| - ์ฐจํธ ๋ฑ์ฅ: ์์ฐจ์ ๋น๋์ | |
| - ๊ฐ์กฐ ํฌ์ธํธ: ์ค์ธ/ํ์ด๋ผ์ดํธ | |
| - ๊ณผ๋ํ ํจ๊ณผ ์ง์""", | |
| "executor": """PPT ์ฌ๋ผ์ด๋๋ฅผ ์์ฑํฉ๋๋ค. | |
| [์ฌ๋ผ์ด๋ 1] ํ์ง | |
| ์ ๋ชฉ: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ : ๋ฏธ๋๋ฅผ ํฅํ ๋์ฝ | |
| ๋ถ์ ๋ชฉ: ์ฑ๊ณต์ ์ธ DX ์ ๋ต๊ณผ ์คํ ๋ฐฉ์ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๋ฐํ์: [์ด๋ฆ] | |
| - ๋ ์ง: 2024๋ 3์ | |
| - ๊ธฐ์ ๋ช /๋ก๊ณ | |
| ๋ฐํ์ ๋ ธํธ: ์ฒญ์ค์ ์ฃผ๋ชฉ์ ๋ ์ ์๋๋ก ์์ ๊ฐ ์๊ฒ ์์. $3.4์กฐ ๊ท๋ชจ์ ๊ฑฐ๋ํ ๋ณํ์ ๋ฌผ๊ฒฐ์์ ๊ฐ์กฐ | |
| ์๊ฐ ์๋ฃ: ๋์งํธ ๋คํธ์ํฌ๊ฐ ์ฐ๊ฒฐ๋ ์ง๊ตฌ๋ณธ ์ด๋ฏธ์ง, ๋์ ์ธ ๋ฐ์ดํฐ ํ๋ฆ ํจ๊ณผ | |
| [์ฌ๋ผ์ด๋ 2] ๋ชฉ์ฐจ | |
| ์ ๋ชฉ: Agenda | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ํ์ฌ | |
| - ์ฐ์ ๋ณ ๋์งํธํ ํํฉ๊ณผ ๊ณผ์ | |
| - ์ฑ๊ณต์ ์ํ ํต์ฌ ์ ๋ต | |
| - ๊ธ๋ก๋ฒ ์ฑ๊ณต ์ฌ๋ก์ ๊ตํ | |
| - ๊ฒฐ๋ก ๋ฐ ๋ค์ ๋จ๊ณ | |
| ๋ฐํ์ ๋ ธํธ: ์ ์ฒด 20๋ถ ๋ฐํ ์ค ๊ฐ ์น์ ๋ณ ์๊ฐ ๋ฐฐ๋ถ ์ค๋ช | |
| ์๊ฐ ์๋ฃ: ๋ฒํธ๊ฐ ๋งค๊ฒจ์ง ์์ด์ฝ๊ณผ ์งํ ํ์ ๋ฐ | |
| [์ฌ๋ผ์ด๋ 3] ๋์ | |
| ์ ๋ชฉ: ์ ์ง๊ธ ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ธ๊ฐ? | |
| ํต์ฌ ๋ด์ฉ: | |
| - 2024๋ ๊ธ๋ก๋ฒ DX ํฌ์: $3.4์กฐ | |
| - ๋์งํธ ๋ฆฌ๋ ๊ธฐ์ ์ ์์ต์ฑ: ํ๊ท ๋๋น 2.5๋ฐฐ | |
| - ํฌ๋ฐ๋ฏน ์ดํ ๋์งํธ ์ฑํ ๊ฐ์ํ: 10๋ โ2๋ | |
| - "๋ณํํ๊ฑฐ๋ ๋ํ๋๊ฑฐ๋" - ์์กด์ ๋ฌธ์ | |
| ๋ฐํ์ ๋ ธํธ: ์์ฅ ๊ท๋ชจ์ ๊ธด๊ธ์ฑ์ ๊ฐ์กฐํ์ฌ ์ฒญ์ค์ ๊ด์ฌ ์ ๋ | |
| ์๊ฐ ์๋ฃ: ๊ธ์์นํ๋ ๊ทธ๋ํ์ ์๊ณ ์์ด์ฝ์ผ๋ก ์๊ธํจ ํํ | |
| [์ฌ๋ผ์ด๋ 4] ์ฐ์ ๋ณ ํํฉ | |
| ์ ๋ชฉ: ์ฐ์ ๋ณ ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ํํฉ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๊ธ์ต: 78% (์ ๋ ๊ทธ๋ฃน) | |
| - ํฌ์ค์ผ์ด: 61% (๋น ๋ฅธ ์ถ๊ฒฉ) | |
| - ์ ์กฐ: 52% (๊พธ์คํ ์งํ) | |
| - ์๋งค: 45% (๊ฐ์ํ ํ์) | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ์ฐ์ ์ ํน์ฑ๊ณผ ๋์ ๊ณผ์ ๊ฐ๋จํ ์ธ๊ธ | |
| ์๊ฐ ์๋ฃ: ๋๋ ์ฐจํธ์ ์ฐ์ ๋ณ ์์ด์ฝ, ์งํ๋ฅ ๋ฐ | |
| [์ฌ๋ผ์ด๋ 5] ์ฃผ์ ๋์ ๊ณผ์ | |
| ์ ๋ชฉ: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ 5๋ ์ฅ๋ฒฝ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๋ ๊ฑฐ์ ์์คํ ์ ๋ณต์ก์ฑ (67%) | |
| - ๋ณํ ์ ํญ๊ณผ ๋ฌธํ์ ๊ด์ฑ (54%) | |
| - ๋์งํธ ์ธ์ฌ ๋ถ์กฑ (48%) | |
| - ๋ถ๋ช ํํ ROI (41%) | |
| - ์ฌ์ด๋ฒ ๋ณด์ ์ฐ๋ ค (38%) | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ์ฅ๋ฒฝ์ ๋ํ ๊ทน๋ณต ๋ฐฉ์ ๋ฏธ๋ฆฌ ์ค๋น | |
| ์๊ฐ ์๋ฃ: ์ฅ๋ฒฝ์ ๋ํ๋ด๋ ๋ฒฝ๋ ์์ด์ฝ๊ณผ ๋ฐฑ๋ถ์จ ํ์ | |
| [์ฌ๋ผ์ด๋ 6] DX ํ๋ ์์ํฌ | |
| ์ ๋ชฉ: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ฑ๊ณต ํ๋ ์์ํฌ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ์ ๋ต: ๋น์ฆ๋์ค ๋ชฉํ ์ ๋ ฌ | |
| - ๊ธฐ์ : AI/ํด๋ผ์ฐ๋/๋ฐ์ดํฐ | |
| - ํ๋ก์ธ์ค: ์ ์์ผ ๋ฐฉ๋ฒ๋ก | |
| - ๋ฌธํ: ํ์ ๊ณผ ์คํ ์ฅ๋ ค | |
| - ๊ฑฐ๋ฒ๋์ค: ์ง์์ ๊ฐ์ | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ์์๊ฐ ์ํธ ์ฐ๊ฒฐ๋์ด ์์์ ๊ฐ์กฐ | |
| ์๊ฐ ์๋ฃ: 5๊ฐํ ๋ค์ด์ด๊ทธ๋จ, ๊ฐ ๊ผญ์ง์ ์ ์์ด์ฝ ๋ฐฐ์น | |
| [์ฌ๋ผ์ด๋ 7] ๊ธฐ์ ์คํ | |
| ์ ๋ชฉ: 2024 ํต์ฌ ๊ธฐ์ ์คํ | |
| ํต์ฌ ๋ด์ฉ: | |
| - AI/ML ์ฑํ๋ฅ : 87% | |
| - ํด๋ผ์ฐ๋ ์ ๋ต: 94% ํ์ด๋ธ๋ฆฌ๋ | |
| - ๋ฐ์ดํฐ ๋ถ์: ์ค์๊ฐ ์ฒ๋ฆฌ | |
| - ๋ณด์: Zero Trust ์ํคํ ์ฒ | |
| - ํตํฉ: API ์ฐ์ ์ ๊ทผ | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ๊ธฐ์ ์ ๋น์ฆ๋์ค ๊ฐ์น ์ฐ๊ฒฐ | |
| ์๊ฐ ์๋ฃ: ๊ณ์ธต์ ๊ธฐ์ ์คํ ๋ค์ด์ด๊ทธ๋จ | |
| [์ฌ๋ผ์ด๋ 8] ๋ณํ ๊ด๋ฆฌ | |
| ์ ๋ชฉ: ์ฌ๋ ์ค์ฌ์ ๋ณํ ๊ด๋ฆฌ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๋ฆฌ๋์ญ์ ๋ช ํํ ๋น์ ๊ณต์ | |
| - ๋จ๊ณ๋ณ ๊ต์ก ํ๋ก๊ทธ๋จ | |
| - ๋น ๋ฅธ ์ฑ๊ณผ๋ก ๋ชจ๋ฉํ ๊ตฌ์ถ | |
| - ์ง์์ ์ปค๋ฎค๋์ผ์ด์ | |
| - ๋ณด์ ์ฒด๊ณ ์ฐ๊ณ | |
| ๋ฐํ์ ๋ ธํธ: Satya Nadella ์ธ์ฉ๊ตฌ ํ์ฉ | |
| ์๊ฐ ์๋ฃ: ๋ณํ ๊ณก์ ๊ณผ ์ฌ๋ ์์ด์ฝ | |
| [์ฌ๋ผ์ด๋ 9] ์ฑ๊ณต ์ฌ๋ก | |
| ์ ๋ชฉ: ๊ธ๋ก๋ฒ DX ์ฑ๊ณต ์คํ ๋ฆฌ | |
| ํต์ฌ ๋ด์ฉ: | |
| - Amazon: ๋ฌผ๋ฅ ์๋ํ โ ๋ฐฐ์ก 40% ๋จ์ถ | |
| - Starbucks: ๋ชจ๋ฐ์ผ ์ฃผ๋ฌธ โ ๋งค์ถ 26% | |
| - Netflix: AI ์ถ์ฒ โ ์์ฒญ ์๊ฐ 80% ์ฆ๊ฐ | |
| - Tesla: OTA ์ ๋ฐ์ดํธ โ ์๋น์ค ๋น์ฉ 70% ์ ๊ฐ | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ์ฌ๋ก์ ํต์ฌ ์ฑ๊ณต ์์ธ ๊ฐ์กฐ | |
| ์๊ฐ ์๋ฃ: ๊ธฐ์ ๋ก๊ณ ์ ํต์ฌ ์งํ ์ธํฌ๊ทธ๋ํฝ | |
| [์ฌ๋ผ์ด๋ 10] ROI ๋ถ์ | |
| ์ ๋ชฉ: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ๋ช ํํ ROI | |
| ํต์ฌ ๋ด์ฉ: | |
| - ์ด์ ํจ์จ์ฑ: 30-40% ๊ฐ์ | |
| - ๊ณ ๊ฐ ๋ง์กฑ๋: NPS 25% ์์น | |
| - ์ ๊ท ์์ต์: ์ ์ฒด ๋งค์ถ์ 15% | |
| - ํฌ์ ํ์ ๊ธฐ๊ฐ: ํ๊ท 2.5๋ | |
| ๋ฐํ์ ๋ ธํธ: ๊ตฌ์ฒด์ ์ธ ์์น๋ก ํฌ์ ์ ๋น์ฑ ์ ์ฆ | |
| ์๊ฐ ์๋ฃ: ROI ๊ณ์ฐ๊ธฐ ์คํ์ผ์ ์ธํฌ๊ทธ๋ํฝ | |
| [์ฌ๋ผ์ด๋ 11] ํต์ฌ ์์ฌ์ | |
| ์ ๋ชฉ: ์ฑ๊ณต์ ์ธ DX๋ฅผ ์ํ 5๊ฐ์ง ์ ์ธ | |
| ํต์ฌ ๋ด์ฉ: | |
| - ์๊ฒ ์์ํ๋ ํฌ๊ฒ ์๊ฐํ๋ผ | |
| - ๊ธฐ์ ๋ณด๋ค ๋ฌธํ ๋ณํ์ ํฌ์ํ๋ผ | |
| - ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ ์ ์ผ์ํํ๋ผ | |
| - ์คํจ๋ฅผ ๋๋ ค์ํ์ง ๋ง๊ณ ๋น ๋ฅด๊ฒ ๋ฐฐ์๋ผ | |
| - ๊ณ ๊ฐ ์ค์ฌ์ผ๋ก ๋ชจ๋ ๊ฒ์ ์ฌ์ค๊ณํ๋ผ | |
| ๋ฐํ์ ๋ ธํธ: ๊ฐ ์ ์ธ์ ๋ํ ์ค์ฒ ๋ฐฉ์ ์ค๋น | |
| ์๊ฐ ์๋ฃ: ์ฒดํฌ๋ฆฌ์คํธ ์คํ์ผ์ ์์ด์ฝ | |
| [์ฌ๋ผ์ด๋ 12] Q&A | |
| ์ ๋ชฉ: Questions & Discussion | |
| ํต์ฌ ๋ด์ฉ: | |
| - ๊ฐ์ฌํฉ๋๋ค | |
| - ์ง๋ฌธ๊ณผ ํ ๋ก ํ์ | |
| - ์ฐ๋ฝ์ฒ: [์ด๋ฉ์ผ/์ ํ] | |
| - ์ถ๊ฐ ์๋ฃ: [์น์ฌ์ดํธ/QR์ฝ๋] | |
| ๋ฐํ์ ๋ ธํธ: ์์ ์ง๋ฌธ 3-5๊ฐ ๋ฏธ๋ฆฌ ์ค๋น | |
| ์๊ฐ ์๋ฃ: ๋ฌผ์ํ ์์ด์ฝ๊ณผ ์ฐ๋ฝ์ฒ ์ ๋ณด""", | |
| "supervisor_review": """์คํ์ AI์ PPT ์ด์์ ๊ฒํ ํ์ต๋๋ค. ์ ๋ฐ์ ์ผ๋ก ์ ๊ตฌ์ฑ๋์์ผ๋ ๋ค์ ๊ฐ์ ์ฌํญ์ ์ ์ํฉ๋๋ค. | |
| ## ๊ฐ์ | |
| - ์กฐ์ฌ๋ ํต๊ณ์ ์์น๊ฐ ํจ๊ณผ์ ์ผ๋ก ํ์ฉ๋จ | |
| - ์คํ ๋ฆฌ๋ผ์ธ์ด ๋ ผ๋ฆฌ์ ์ด๊ณ ์ค๋๋ ฅ ์์ | |
| - ๊ฐ ์ฌ๋ผ์ด๋์ ํต์ฌ ๋ฉ์์ง๊ฐ ๋ช ํํจ | |
| - ์๊ฐ ์๋ฃ ์ ์์ด ๊ตฌ์ฒด์ ์ | |
| ## ๊ฐ์ ํ์์ฌํญ | |
| ### 1. ์ํฉํธ ๊ฐํ | |
| **์ฌ๋ผ์ด๋ 3 ๊ฐ์ ** | |
| - ํ์ฌ: ํต๊ณ ๋์ด | |
| - ๊ฐ์ : "๊ท์ฌ๋ ๋์งํธ ๋ฆฌ๋์ ๋๊น, ํ๋ฐ์ฃผ์์ ๋๊น?"๋ผ๋ ๋๋ฐ์ ์ง๋ฌธ ์ถ๊ฐ | |
| - ์ฒญ์ค ์ฐธ์ฌ๋ฅผ ์ํ ์ธํฐ๋ํฐ๋ธ ์์ ๊ณ ๋ ค | |
| **์ฌ๋ผ์ด๋ 5 ๊ฐ์ ** | |
| - ํ์ฌ: ์ฅ๋ฒฝ๋ง ์ ์ | |
| - ๊ฐ์ : ๊ฐ ์ฅ๋ฒฝ๋ณ "Quick Win" ์๋ฃจ์ ํ ์ค ์ถ๊ฐ | |
| - ํฌ๋ง์ ๋ฉ์์ง๋ก ๊ท ํ ๋ง์ถ๊ธฐ | |
| ### 2. ์คํ ๋ฆฌํ ๋ง ๊ฐํ | |
| **์ ํ ๋ฌธ๊ตฌ ์ถ๊ฐ** | |
| - ์ฌ๋ผ์ด๋ ๊ฐ ์ฐ๊ฒฐ ๋ฌธ๊ตฌ ํ์ | |
| - ์: "์ด์ ์ด๋ฌํ ํํฉ์ ์ด๋ป๊ฒ ๊ฐ์ ํ ์ ์์๊น์?" | |
| **๊ฐ์ ์ ์ฐ๊ฒฐ** | |
| - ์ซ์์ ํต๊ณ ์ธ์ ์ธ๊ฐ์ ์คํ ๋ฆฌ ์ถ๊ฐ | |
| - ๋ณํ๋ฅผ ๊ฒช์ ์ง์/๊ณ ๊ฐ์ ์ค์ ๊ฒฝํ๋ด | |
| ### 3. ๋น์ฃผ์ผ ์ผ๊ด์ฑ | |
| **์์ ์ฌ์ฉ ์ ์ ** | |
| - ๊ฐ์กฐ์(์ค๋ ์ง) ๊ณผ๋ ์ฌ์ฉ ์์ | |
| - ๊ฐ ์น์ ๋ณ ์์ ํค ๊ตฌ๋ถ | |
| - ๋ฐ์ดํฐ ์๊ฐํ ์์ ํ๋ ํธ ํต์ผ | |
| **์์ด์ฝ ์คํ์ผ** | |
| - ๋ชจ๋ ์์ด์ฝ ๋์ผ ์คํ์ผ๋ก ํต์ผ | |
| - ๋ผ์ธ ๋๊ป, ๋ชจ์๋ฆฌ ์ฒ๋ฆฌ ์ผ๊ด์ฑ | |
| ### 4. ๋ฐํ ์ค๋น ๊ฐํ | |
| **์๊ฐ ๋ฐฐ๋ถ ๋ช ์** | |
| - ๊ฐ ์ฌ๋ผ์ด๋๋ณ ์์ ์์ ์๊ฐ ์ถ๊ฐ | |
| - ์ ์ฒด 20๋ถ ๊ธฐ์ค ์์ธ ๋ฐฐ๋ถ | |
| **์ ํ ์คํฌ๋ฆฝํธ** | |
| - ์ฌ๋ผ์ด๋ ๊ฐ ์์ฐ์ค๋ฌ์ด ์ ํ ๋ฉํธ ์ค๋น | |
| - ์ฒญ์ค ๋ฐ์ ์ฒดํฌ ํฌ์ธํธ ์ค์ | |
| ### 5. ์ถ๊ฐ ๊ถ์ฅ์ฌํญ | |
| **๋ฐฑ์ ์ฌ๋ผ์ด๋ ์ค๋น** | |
| - ์์ธ ๊ธฐ์ ์คํ | |
| - ์ถ๊ฐ ์ฌ๋ก ์ฐ๊ตฌ | |
| - ์ ์ข ๋ณ ๋ง์ถค ์ ๋ต | |
| - ์์ธ ROI ๊ณ์ฐ ๋ฐฉ๋ฒ | |
| **์ธ์ ์๋ฃ** | |
| - 3์ฌ๋ผ์ด๋/ํ์ด์ง ํ์ | |
| - ๋ฉ๋ชจ ๊ณต๊ฐ ํฌํจ | |
| - ํต์ฌ ์์น ์์ฝ ํ์ด์ง | |
| ์ด๋ฌํ ๊ฐ์ ์ฌํญ์ ๋ฐ์ํ๋ฉด ๋์ฑ ์์ฑ๋ ๋๊ณ ์ค๋๋ ฅ ์๋ PPT๊ฐ ๋ ๊ฒ์ ๋๋ค.""", | |
| "executor_final": """๊ฐ๋ ์ AI์ ํผ๋๋ฐฑ์ ์์ ํ ๋ฐ์ํ ์ต์ข PPT๋ฅผ ์์ฑํฉ๋๋ค. | |
| # ๐ฏ ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ : ๋ฏธ๋๋ฅผ ํฅํ ๋์ฝ | |
| ## ์ต์ข ์์ฑ PPT (๋ฐํ ์๊ฐ: 20๋ถ) | |
| --- | |
| [์ฌ๋ผ์ด๋ 1] ํ์ง (30์ด) | |
| **์ ๋ชฉ**: ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ : ๋ฏธ๋๋ฅผ ํฅํ ๋์ฝ | |
| **๋ถ์ ๋ชฉ**: ์ฑ๊ณต์ ์ธ DX ์ ๋ต๊ณผ ์คํ ๋ฐฉ์ | |
| **๋น์ฃผ์ผ**: | |
| - ๋ฐฐ๊ฒฝ: ์ฐ๊ฒฐ๋ ๋์งํธ ๋คํธ์ํฌ์ ๋ฐ์ดํฐ ํ๋ฆ | |
| - ์ค์: ํ์ฌ ๋ก๊ณ | |
| - ํ๋จ: ๋ฐํ์ ์ ๋ณด ๋ฐ ๋ ์ง | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "์๋ ํ์ญ๋๊น. ์ค๋ ์ฌ๋ฌ๋ถ๊ณผ ํจ๊ป $3.4์กฐ ๊ท๋ชจ์ ๋์งํธ ํ๋ช , ๊ทธ ์ค์ฌ์์ ์ฐ๋ฆฌ๊ฐ ์ด๋ป๊ฒ ์ฑ๊ณตํ ์ ์์์ง ๋ ผ์ํ๊ณ ์ ํฉ๋๋ค." | |
| --- | |
| [์ฌ๋ผ์ด๋ 2] ๋ชฉ์ฐจ (30์ด) | |
| **์ ๋ชฉ**: ์ค๋์ ์ฌ์ | |
| **ํต์ฌ ๋ด์ฉ**: | |
| 1. ๐ ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ํ์ฌ (3๋ถ) | |
| 2. ๐ญ ์ฐ์ ๋ณ ํํฉ๊ณผ ๋์ ๊ณผ์ (3๋ถ) | |
| 3. ๐ฏ ์ฑ๊ณต ์ ๋ต๊ณผ ํ๋ ์์ํฌ (5๋ถ) | |
| 4. ๐ ๊ธ๋ก๋ฒ ์ฑ๊ณต ์ฌ๋ก (4๋ถ) | |
| 5. ๐ก ํต์ฌ ์์ฌ์ ๊ณผ ์คํ ๋ฐฉ์ (4๋ถ) | |
| 6. ๐ค Q&A (1๋ถ) | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "20๋ถ๊ฐ์ ์ฌ์ ์ ํตํด ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ํ์ฌ์ ๋ฏธ๋, ๊ทธ๋ฆฌ๊ณ ์คํ ๋ฐฉ์์ ํจ๊ป ํ์ํ๊ฒ ์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: ์งํ ๋จ๊ณ๋ฅผ ๋ณด์ฌ์ฃผ๋ ๋ก๋๋งต ์คํ์ผ ๋์์ธ | |
| --- | |
| [์ฌ๋ผ์ด๋ 3] ๋์ ์ ์ง๋ฌธ (1๋ถ 30์ด) | |
| **์ ๋ชฉ**: ๊ท์ฌ๋ ๋์งํธ ๋ฆฌ๋์ ๋๊น, ํ๋ฐ์ฃผ์์ ๋๊น? | |
| **ํต์ฌ ๋ด์ฉ**: | |
| - ๐ 2024๋ ๊ธ๋ก๋ฒ DX ์์ฅ: **$3.4์กฐ** | |
| - ๐ ๋์งํธ ๋ฆฌ๋์ ์์ต์ฑ: ํ๊ท ๋๋น **2.5๋ฐฐ** | |
| - โฐ ๋ณํ์ ์๋: 10๋ โ **2๋ ** (ํฌ๋ฐ๋ฏน ๊ฐ์ํ) | |
| - โก ํต์ฌ ์ง๋ฌธ: "์ฐ๋ฆฌ๋ ๋ณํ๋ฅผ ์ฃผ๋ํ๊ณ ์๋๊ฐ?" | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "์ ์ ์๊ฐํด๋ณด์ญ์์ค. ๊ท์ฌ๋ ์ด ๊ฑฐ๋ํ ๋ณํ์ ๋ฌผ๊ฒฐ์ ํ๊ณ ์์ต๋๊น, ์๋๋ฉด ๋ค์ฒ์ ธ ์์ต๋๊น?" | |
| **์๊ฐ ์๋ฃ**: | |
| - ์๋จ: ๋๋ฐ์ ์ง๋ฌธ ํฌ๊ฒ ํ์ | |
| - ์ค์: ๋ฆฌ๋ vs ํ๋ฐ์ฃผ์ ๋๋น ์ธํฌ๊ทธ๋ํฝ | |
| - ์ ํ: ์ฒญ์ค ์ฐธ์ฌ๋ฅผ ์ํ 3์ด pause | |
| --- | |
| [์ฌ๋ผ์ด๋ 4] ์ฐ์ ๋ณ ๋์งํธํ ํํฉ (1๋ถ 30์ด) | |
| **์ ๋ชฉ**: ๋น์ ์ ์ฐ์ ์ ์ด๋์ ์์นํฉ๋๊น? | |
| **ํต์ฌ ๋ด์ฉ**: | |
| - ๐ฆ ๊ธ์ต: 78% - "๋์งํธ์ด ์๋ก์ด ํ์ค" | |
| - ๐ฅ ํฌ์ค์ผ์ด: 61% - "์๊ฒฉ์๋ฃ๊ฐ ์ผ์์ผ๋ก" | |
| - ๐ญ ์ ์กฐ: 52% - "์ค๋งํธ ํฉํ ๋ฆฌ๋ก ์งํ" | |
| - ๐๏ธ ์๋งค: 45% - "์ด๋์ฑ๋์ด ์์กด ์กฐ๊ฑด" | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "๊ธ์ต์ ์ ์ด๋ฏธ 78%๊ฐ ๋์งํธํ๋์์ต๋๋ค. ๊ท์ฌ์ ์ฐ์ ์ ์ด๋ป์ต๋๊น? ์ด์ ๊ฐ ์ฐ์ ์ ์ฑ๊ณต ๋น๊ฒฐ์ ์ดํด๋ณด๊ฒ ์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ๋ ์ด์ค ํธ๋ ํํ์ ์งํ๋ ํ์ | |
| - ๊ฐ ์ฐ์ ๋ณ ๋ํ ์์ด์ฝ๊ณผ ์งํ๋ฅ | |
| - ์ ์ข ๋ณ ๋ํ ๊ธฐ์ ๋ก๊ณ ์๊ฒ ํ์ | |
| --- | |
| [์ฌ๋ผ์ด๋ 5] 5๋ ์ฅ๋ฒฝ๊ณผ ํด๊ฒฐ์ฑ (2๋ถ) | |
| **์ ๋ชฉ**: ์ฅ๋ฒฝ์ ๊ธฐํ๋ก: 5๋ ๋์ ๊ณผ์ ์ Quick Win | |
| **ํต์ฌ ๋ด์ฉ**: | |
| - ๐ง ๋ ๊ฑฐ์ ์์คํ (67%) โ "๋จ๊ณ์ ํ๋ํ ์ ๋ต" | |
| - ๐ซ ๋ณํ ์ ํญ (54%) โ "์์ ์ฑ๊ณต ์คํ ๋ฆฌ ํ์ฐ" | |
| - ๐ฅ ์ธ์ฌ ๋ถ์กฑ (48%) โ "์ ์คํฌ๋ง + ์ธ๋ถ ํํธ๋์ญ" | |
| - ๐ฐ ๋ถ๋ช ํํ ROI (41%) โ "ํ์ผ๋ฟ ํ๋ก์ ํธ๋ก ์ฆ๋ช " | |
| - ๐ ๋ณด์ ์ฐ๋ ค (38%) โ "Security by Design ์์น" | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "๋ชจ๋ ์ฅ๋ฒฝ์๋ ํด๊ฒฐ์ฑ ์ด ์์ต๋๋ค. ์ค์ํ ๊ฒ์ ์ด๋์๋ถํฐ ์์ํ ๊ฒ์ธ๊ฐ์ ๋๋ค." | |
| **์ ํ ๋ฉํธ**: "๊ทธ๋ ๋ค๋ฉด ์ด๋ฌํ ์ฅ๋ฒฝ์ ๋์ด ์ฑ๊ณตํ๊ธฐ ์ํ ๊ฒ์ฆ๋ ํ๋ ์์ํฌ๋ฅผ ์๊ฐํ๊ฒ ์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ์ฅ๋ฒฝโํด๊ฒฐ์ฑ ํ์ดํ ์ ๋๋ฉ์ด์ | |
| - ๊ฐ ํญ๋ชฉ๋ณ ์์ฐจ์ ๋ฑ์ฅ ํจ๊ณผ | |
| --- | |
| [์ฌ๋ผ์ด๋ 6] DX ์ฑ๊ณต ํ๋ ์์ํฌ (2๋ถ) | |
| **์ ๋ชฉ**: ๊ฒ์ฆ๋ ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ํ๋ ์์ํฌ | |
| **ํต์ฌ ๋ด์ฉ**: | |
| ๐ฏ **์ ๋ต**: ๋น์ฆ๋์ค ๋ชฉํ์ 100% ์ ๋ ฌ | |
| ๐ง **๊ธฐ์ **: AI(87%) + ํด๋ผ์ฐ๋(94%) + ๋ฐ์ดํฐ | |
| ๐ฅ **๋ฌธํ**: ํ์ DNA ์ฃผ์ | |
| โ๏ธ **ํ๋ก์ธ์ค**: ์ ์์ผ + DevOps | |
| ๐ **๊ฑฐ๋ฒ๋์ค**: ์ธก์ ๊ฐ๋ฅํ KPI | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "์ด 5๊ฐ์ง ์์๋ ํฑ๋๋ฐํด์ฒ๋ผ ๋ง๋ฌผ๋ ค ์์ต๋๋ค. ํ๋๋ผ๋ ๋น ์ง๋ฉด ์ ์ฒด๊ฐ ์๋ํ์ง ์์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ์ค์: 5๊ฐํ ๋ค์ด์ด๊ทธ๋จ | |
| - ๊ฐ ์์ ๊ฐ ์ฐ๊ฒฐ์ ์ผ๋ก ์ํธ์์กด์ฑ ํํ | |
| - ํธ๋ฒ ํจ๊ณผ๋ก ๊ฐ ์์ ์์ธ ์ค๋ช | |
| --- | |
| [์ฌ๋ผ์ด๋ 7] 2024 ๊ธฐ์ ์คํ (1๋ถ 30์ด) | |
| **์ ๋ชฉ**: ๋ฏธ๋๋ฅผ ๋ง๋๋ ๊ธฐ์ ์คํ | |
| **ํต์ฌ ๋ด์ฉ**: | |
| **Layer 1 - ์ธํ๋ผ** | |
| - โ๏ธ ํ์ด๋ธ๋ฆฌ๋ ํด๋ผ์ฐ๋ (94% ์ฑํ) | |
| **Layer 2 - ๋ฐ์ดํฐ** | |
| - ๐ ์ค์๊ฐ ๋ถ์ ํ๋ซํผ | |
| **Layer 3 - ์ธํ ๋ฆฌ์ ์ค** | |
| - ๐ค AI/ML (87% ํตํฉ) | |
| **Layer 4 - ๊ฒฝํ** | |
| - ๐ฑ ์ด๋์ฑ๋ ์ธํฐํ์ด์ค | |
| **Layer 5 - ๋ณด์** | |
| - ๐ Zero Trust ์ํคํ ์ฒ | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "๊ฐ ๋ ์ด์ด๋ ๊ทธ ์์ ๋ ์ด์ด๋ฅผ ์ง์ํฉ๋๋ค. ํํํ ๊ธฐ์ด ์์ด๋ ํ์ ๋ ์์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ํผ๋ผ๋ฏธ๋ ํํ์ ๊ธฐ์ ์คํ | |
| - ๊ฐ ๋ ์ด์ด๋ณ ๋ํ ๊ธฐ์ ๋ก๊ณ | |
| --- | |
| [์ฌ๋ผ์ด๋ 8] ์ธ๊ฐ ์ค์ฌ ๋ณํ ๊ด๋ฆฌ (1๋ถ 30์ด) | |
| **์ ๋ชฉ**: ๊ธฐ์ ์ด ์๋ ์ฌ๋์ด ๋ง๋๋ ๋ณํ | |
| **ํต์ฌ ๋ด์ฉ**: | |
| > "๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ๊ธฐ์ ์ด ์๋ ์ฌ๋๊ณผ ๋ฌธํ์ ๋ณํ๋ค" | |
| > - Satya Nadella, Microsoft CEO | |
| - ๐ฏ **๋น์ **: ๋ช ํํ๊ณ ๊ณ ๋ฌด์ ์ธ ๋ฏธ๋์ | |
| - ๐ **๊ต์ก**: ์ง์์ ํ์ต ๋ฌธํ | |
| - ๐ **์ฑ๊ณผ**: ์์ ์น๋ฆฌ์ ์ถ์ | |
| - ๐ฌ **์ํต**: ์๋ฐฉํฅ ํผ๋๋ฐฑ ๋ฃจํ | |
| - ๐ **๋ณด์**: ํ์ ์ ๋ํ ์ธ์ผํฐ๋ธ | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "๊ฐ์ฅ ์์ ๊ธฐ์ ๋ ์ฌ๋์ด ๋ฐ์๋ค์ด์ง ์์ผ๋ฉด ๋ฌด์ฉ์ง๋ฌผ์ ๋๋ค." | |
| **์ ํ ๋ฉํธ**: "์ด์ ์ด๋ฌํ ์์น๋ค์ด ์ค์ ๋ก ์ด๋ค ์ฑ๊ณผ๋ฅผ ๋ง๋ค์ด๋๋์ง ๋ณด์๊ฒ ์ต๋๋ค." | |
| **์๊ฐ ์๋ฃ**: ์ฌ๋ ์ค์ฌ์ ์ํ ๋ค์ด์ด๊ทธ๋จ | |
| --- | |
| [์ฌ๋ผ์ด๋ 9] ๊ธ๋ก๋ฒ ์ฑ๊ณต ์คํ ๋ฆฌ (2๋ถ) | |
| **์ ๋ชฉ**: ์ซ์๋ก ์ฆ๋ช ๋ DX ์ฑ๊ณต ์ฌ๋ก | |
| **ํต์ฌ ๋ด์ฉ**: | |
| ๐ฆ **Amazon**: ๋ฌผ๋ฅ ์๋ํ โ ๋ฐฐ์ก ์๊ฐ **40% ๋จ์ถ** | |
| โ **Starbucks**: ๋ชจ๋ฐ์ผ ์ฃผ๋ฌธ โ ๋งค์ถ์ **26% ์ฐจ์ง** | |
| ๐ฌ **Netflix**: AI ์ถ์ฒ โ ์์ฒญ ์๊ฐ **80% ์ฆ๊ฐ** | |
| ๐ **Tesla**: OTA ์ ๋ฐ์ดํธ โ ์๋น์ค ๋น์ฉ **70% ์ ๊ฐ** | |
| **๊ณตํต ์ฑ๊ณต ์์ธ**: | |
| - ๊ณ ๊ฐ ๊ฒฝํ ์ต์ฐ์ | |
| - ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ | |
| - ์ง์์ ํ์ ๋ฌธํ | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "์ด๋ค์ ๊ณตํต์ ์ ๋ฌด์์ผ๊น์? ๊ธฐ์ ์ ๋ชฉ์ ์ด ์๋ ์๋จ์ผ๋ก ํ์ฉํ๋ค๋ ์ ์ ๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ๊ฐ ๊ธฐ์ ๋ณ Before/After ๋๋น | |
| - ํต์ฌ ์งํ ํฌ๊ฒ ๊ฐ์กฐ | |
| --- | |
| [์ฌ๋ผ์ด๋ 10] ROI์ ์ง์ค (2๋ถ) | |
| **์ ๋ชฉ**: ํฌ์ ๋๋น ์์ต, ์จ๊ฒจ์ง ๊ฐ์น๊น์ง | |
| **์ ๋์ ํจ๊ณผ**: | |
| - ๐ฐ ์ด์ ํจ์จ์ฑ: **30-40% ๊ฐ์ ** | |
| - ๐ ๊ณ ๊ฐ ๋ง์กฑ๋: NPS **25ํฌ์ธํธ ์์น** | |
| - ๐ ์ ๊ท ์์ต: ์ ์ฒด ๋งค์ถ์ **15% ์ฐฝ์ถ** | |
| - โฑ๏ธ ํฌ์ ํ์: ํ๊ท **2.5๋ ** | |
| **์ ์ฑ์ ํจ๊ณผ**: | |
| - ์ง์ ๋ง์กฑ๋ ํฅ์ | |
| - ๋ธ๋๋ ์ด๋ฏธ์ง ์ ๊ณ | |
| - ๋ฏธ๋ ๋์๋ ฅ ํ๋ณด | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "ROI๋ ๋จ์ํ ์ซ์๋ก๋ง ์ธก์ ๋์ง ์์ต๋๋ค. ์กฐ์ง์ ๋ฏธ๋ ๊ฒฝ์๋ ฅ์ด ์ง์ ํ ๊ฐ์น์ ๋๋ค." | |
| **์๊ฐ ์๋ฃ**: | |
| - ROI ๊ณ์ฐ๊ธฐ ์ธํฐํ์ด์ค | |
| - ์ ๋/์ ์ฑ ํจ๊ณผ ๊ท ํ ํ์ | |
| --- | |
| [์ฌ๋ผ์ด๋ 11] ์คํ์ ์ํ 5๊ฐ์ง ์ ์ธ (2๋ถ) | |
| **์ ๋ชฉ**: ๋ด์ผ๋ถํฐ ์์ํ ์ ์๋ 5๊ฐ์ง ํ๋ | |
| **ํต์ฌ ์ ์ธ**: | |
| 1. ๐ฑ **Start Small, Think Big** | |
| - "ํ์ผ๋ฟ ํ๋ก์ ํธ๋ก ์์ํ๋ ์ ์ฌ ํ์ฐ ๊ณํ ์๋ฆฝ" | |
| 2. ๐ฅ **Culture First, Technology Second** | |
| - "์ต๊ณ ์ ๊ธฐ์ ๋ ๋ฌธํ๊ฐ ๋ท๋ฐ์นจ๋์ง ์์ผ๋ฉด ์คํจ" | |
| 3. ๐ **Data-Driven Everything** | |
| - "์ถ์ธก์ด ์๋ ๋ฐ์ดํฐ๋ก ์์ฌ๊ฒฐ์ " | |
| 4. ๐ **Fail Fast, Learn Faster** | |
| - "์คํจ๋ฅผ ๋๋ ค์ํ์ง ๋ง๊ณ ๋น ๋ฅด๊ฒ ํผ๋ฒ" | |
| 5. ๐ฏ **Customer at the Center** | |
| - "๋ชจ๋ ๋ณํ์ ์ค์ฌ์ ๊ณ ๊ฐ ๊ฐ์น" | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "์ด ์ค ๋จ ํ๋๋ง์ด๋ผ๋ ๋ด์ผ๋ถํฐ ์ค์ฒํ๋ค๋ฉด, 1๋ ํ ์กฐ์ง์ ์์ ํ ๋ฌ๋ผ์ ธ ์์ ๊ฒ์ ๋๋ค." | |
| **์๊ฐ ์๋ฃ**: ์ฒดํฌ๋ฐ์ค ์คํ์ผ, ํ๋์ฉ ์ฒดํฌ๋๋ ์ ๋๋ฉ์ด์ | |
| --- | |
| [์ฌ๋ผ์ด๋ 12] ๋ง๋ฌด๋ฆฌ ๋ฐ Q&A (1๋ถ) | |
| **์ ๋ชฉ**: ํจ๊ป ๋ง๋๋ ๋์งํธ ๋ฏธ๋ | |
| **ํต์ฌ ๋ด์ฉ**: | |
| ๐ **๊ฐ์ฌํฉ๋๋ค** | |
| ๐ญ **์๊ฐํด๋ณผ ์ง๋ฌธ๋ค**: | |
| - ์ฐ๋ฆฌ ์กฐ์ง์ ๋์งํธ ์ฑ์๋๋? | |
| - ๊ฐ์ฅ ๋จผ์ ํด๊ฒฐํด์ผ ํ ๊ณผ์ ๋? | |
| - ์ฒซ ๋ฒ์งธ ํ์ผ๋ฟ ํ๋ก์ ํธ๋? | |
| ๐ง ์ฐ๋ฝ์ฒ: [์ด๋ฉ์ผ] | |
| ๐ฑ LinkedIn: [ํ๋กํ] | |
| ๐ ์ถ๊ฐ ์๋ฃ: [QR ์ฝ๋] | |
| **๋ฐํ์ ๋ ธํธ**: | |
| "๋์งํธ ํธ๋์คํฌ๋ฉ์ด์ ์ ๋ชฉ์ ์ง๊ฐ ์๋ ์ฌ์ ์ ๋๋ค. ๊ทธ ์ฌ์ ์ ํจ๊ปํ๊ฒ ๋์ด ์๊ด์ ๋๋ค." | |
| **์๊ฐ ์๋ฃ**: QR ์ฝ๋์ ์ฐ๋ฝ์ฒ ์ ๋ณด | |
| --- | |
| ## ๐ ๋ฐฑ์ ์ฌ๋ผ์ด๋ (ํ์์ ํ์ฉ) | |
| [๋ฐฑ์ 1] ์ฐ์ ๋ณ ์์ธ ์ ๋ต | |
| [๋ฐฑ์ 2] ๊ธฐ์ ์คํ ์์ธ ์คํ | |
| [๋ฐฑ์ 3] ์ถ๊ฐ ์ฑ๊ณต ์ฌ๋ก (๊ตญ๋ด ๊ธฐ์ ) | |
| [๋ฐฑ์ 4] ROI ๊ณ์ฐ ๋ฐฉ๋ฒ๋ก | |
| [๋ฐฑ์ 5] ๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต | |
| ## ๐ค ์์ Q&A ๋ฐ ๋ต๋ณ ์ค๋น | |
| **Q1: ์ฐ๋ฆฌ ๊ฐ์ ์ค๊ฒฌ๊ธฐ์ ๋ ๊ฐ๋ฅํ๊ฐ์?** | |
| A: ์คํ๋ ค ์ค๊ฒฌ๊ธฐ์ ์ด ๋ ๋น ๋ฅด๊ฒ ๋ณํํ ์ ์์ต๋๋ค. ์์ ํ์ผ๋ฟ๋ถํฐ ์์ํ์ธ์. | |
| **Q2: ์์ฐ์ด ์ ํ์ ์ธ๋ฐ ์ด๋ป๊ฒ ์์ํ๋์?** | |
| A: ํด๋ผ์ฐ๋ ๊ธฐ๋ฐ SaaS๋ฅผ ํ์ฉํ๋ฉด ์ด๊ธฐ ํฌ์๋ฅผ ์ต์ํํ ์ ์์ต๋๋ค. | |
| **Q3: ์ง์๋ค์ ์ ํญ์ด ์ฌํ๋ฐ ์ด๋ป๊ฒ ๊ทน๋ณตํ๋์?** | |
| A: ๋ณํ์ ์ํ์๋ฅผ ๋จผ์ ๋ง๋ค๊ณ , ๊ทธ๋ค์ด ์ ๋์ฌ๊ฐ ๋๊ฒ ํ์ธ์. | |
| --- | |
| *์ด PPT๋ 20๋ถ ๋ฐํ๋ฅผ ๊ธฐ์ค์ผ๋ก ์์ฑ๋์์ผ๋ฉฐ, ์ฒญ์ค๊ณผ์ ์ํธ์์ฉ์ ๊ทน๋ํํ๋๋ก ์ค๊ณ๋์์ต๋๋ค.*""" | |
| } | |
| # ํ๋กฌํํธ ๋ด์ฉ์ ๋ฐ๋ผ ์ ์ ํ ์๋ต ์ ํ | |
| if role == "supervisor" and "์กฐ์ฌ์ AI๊ฐ ์ ๋ฆฌํ" in messages[0]["content"]: | |
| response = test_responses["supervisor_execution"] | |
| elif role == "supervisor" and messages[0]["content"].find("์คํ์ AI์ PPT ์ด์") > -1: | |
| response = test_responses["supervisor_review"] | |
| elif role == "supervisor": | |
| response = test_responses["supervisor_initial"] | |
| elif role == "researcher": | |
| response = test_responses["researcher"] | |
| elif role == "executor" and "์ต์ข PPT" in messages[0]["content"]: | |
| response = test_responses["executor_final"] | |
| else: | |
| response = test_responses["executor"] | |
| yield from self.simulate_streaming(response, role) | |
| return | |
| # ์ค์ API ํธ์ถ | |
| try: | |
| system_prompts = { | |
| "supervisor": "๋น์ ์ ์ ๋ฌธ์ ์ธ PPT ๊ตฌ์กฐ๋ฅผ ์ค๊ณํ๊ณ ์ง๋ํ๋ ๊ฐ๋ ์ AI์ ๋๋ค.", | |
| "researcher": "๋น์ ์ PPT ์ฝํ ์ธ ๋ฅผ ์ํ ์ ๋ณด๋ฅผ ์กฐ์ฌํ๊ณ ์ ๋ฆฌํ๋ ์กฐ์ฌ์ AI์ ๋๋ค.", | |
| "executor": "๋น์ ์ ์ค์ PPT ์ฌ๋ผ์ด๋ ๋ด์ฉ์ ์์ฑํ๋ ์คํ์ AI์ ๋๋ค." | |
| } | |
| full_messages = [ | |
| {"role": "system", "content": system_prompts.get(role, "")}, | |
| *messages | |
| ] | |
| payload = { | |
| "model": self.model_id, | |
| "messages": full_messages, | |
| "max_tokens": 4096, | |
| "temperature": 0.7, | |
| "top_p": 0.8, | |
| "stream": True, | |
| "stream_options": {"include_usage": True} | |
| } | |
| logger.info(f"API ์คํธ๋ฆฌ๋ฐ ํธ์ถ ์์ - Role: {role}") | |
| response = requests.post( | |
| self.api_url, | |
| headers=self.create_headers(), | |
| json=payload, | |
| stream=True, | |
| timeout=10 | |
| ) | |
| if response.status_code != 200: | |
| logger.error(f"API ์ค๋ฅ: {response.status_code}") | |
| yield f"โ API ์ค๋ฅ ({response.status_code}): {response.text[:200]}" | |
| return | |
| for line in response.iter_lines(): | |
| if line: | |
| line = line.decode('utf-8') | |
| if line.startswith("data: "): | |
| data = line[6:] | |
| if data == "[DONE]": | |
| break | |
| try: | |
| chunk = json.loads(data) | |
| if "choices" in chunk and chunk["choices"]: | |
| content = chunk["choices"][0].get("delta", {}).get("content", "") | |
| if content: | |
| yield content | |
| except json.JSONDecodeError: | |
| continue | |
| except requests.exceptions.Timeout: | |
| yield "โฑ๏ธ API ํธ์ถ ์๊ฐ์ด ์ด๊ณผ๋์์ต๋๋ค. ๋ค์ ์๋ํด์ฃผ์ธ์." | |
| except requests.exceptions.ConnectionError: | |
| yield "๐ API ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์ธํฐ๋ท ์ฐ๊ฒฐ์ ํ์ธํด์ฃผ์ธ์." | |
| except Exception as e: | |
| logger.error(f"์คํธ๋ฆฌ๋ฐ ์ค ์ค๋ฅ: {str(e)}") | |
| yield f"โ ์ค๋ฅ ๋ฐ์: {str(e)}" | |
| # ์์คํ ์ธ์คํด์ค ์์ฑ | |
| ppt_system = PPTCreationSystem() | |
| # ===== ๋ฉ์ธ ์ฒ๋ฆฌ ํจ์ ===== | |
| def process_ppt_streaming(ppt_topic: str, template_name: str, audience_type: str, language: str, | |
| custom_slides: List[Dict], slide_count: int, seed: int, uploaded_file, | |
| use_web_search: bool, theme_name: str = "Minimal Light", | |
| progress=gr.Progress()): | |
| """ํตํฉ๋ PPT ์์ฑ ์ฒ๋ฆฌ - 3์ ํ์ ์์คํ ์ฌ์ฉ""" | |
| # Update global variables | |
| global current_topic, uploaded_content, current_language | |
| current_topic = ppt_topic | |
| current_language = language | |
| # Read uploaded file content | |
| uploaded_content = "" | |
| if uploaded_file is not None: | |
| try: | |
| uploaded_content = read_uploaded_file(uploaded_file.name) | |
| print(f"[File Upload] Content length: {len(uploaded_content)} characters") | |
| except Exception as e: | |
| print(f"[File Upload] Error: {str(e)}") | |
| uploaded_content = "" | |
| # Template selection and slide configuration | |
| try: | |
| if template_name == "Custom" and custom_slides: | |
| slides = [{"title": "Cover", "style": "Title Slide (Hero)", "prompt_hint": "Presentation cover"}] | |
| slides.extend(custom_slides) | |
| slides.append({"title": "Thank You", "style": "Thank You Slide", "prompt_hint": "Presentation closing and key message"}) | |
| else: | |
| template = PPT_TEMPLATES.get(template_name) | |
| if not template: | |
| yield "", "", "", None, f"โ Template '{template_name}' not found." | |
| return | |
| slides = generate_dynamic_slides(ppt_topic, template, slide_count) | |
| except Exception as e: | |
| print(f"[Slide Configuration] Error: {str(e)}") | |
| yield "", "", "", None, f"โ Error configuring slides: {str(e)}" | |
| return | |
| if not slides: | |
| yield "", "", "", None, "No slides defined." | |
| return | |
| total_slides = len(slides) | |
| print(f"\n[PPT Generation] Starting - Total {total_slides} slides (Cover + {slide_count} content + Thank You)") | |
| print(f"[PPT Generation] Topic: {ppt_topic}") | |
| print(f"[PPT Generation] Template: {template_name}") | |
| print(f"[PPT Generation] Audience: {audience_type}") | |
| print(f"[PPT Generation] Language: {language}") | |
| print(f"[PPT Generation] Design Theme: {theme_name}") | |
| print(f"[PPT Generation] Web Search: {'Enabled' if use_web_search else 'Disabled'}") | |
| conversation_log = [] | |
| all_responses = {"supervisor": [], "researcher": [], "executor": []} | |
| try: | |
| # 1๋จ๊ณ: ๊ฐ๋ ์ AI ์ด๊ธฐ ๋ถ์ ๋ฐ ํค์๋ ์ถ์ถ | |
| progress(0.1, "๐ง ๊ฐ๋ ์ AI๊ฐ PPT ๊ตฌ์กฐ๋ฅผ ์ค๊ณ ์ค...") | |
| supervisor_prompt = ppt_system.create_supervisor_initial_prompt(ppt_topic) | |
| supervisor_initial_response = "" | |
| supervisor_text = "[PPT ๊ตฌ์กฐ ์ค๊ณ] ๐ ์์ฑ ์ค...\n" | |
| for chunk in ppt_system.call_llm_streaming( | |
| [{"role": "user", "content": supervisor_prompt}], | |
| "supervisor" | |
| ): | |
| supervisor_initial_response += chunk | |
| supervisor_text = f"[PPT ๊ตฌ์กฐ ์ค๊ณ] - {datetime.now().strftime('%H:%M:%S')}\n{supervisor_initial_response}" | |
| yield supervisor_text, "", "", None, "๐ ๊ฐ๋ ์ AI๊ฐ PPT ๊ตฌ์กฐ๋ฅผ ์ค๊ณ ์ค..." | |
| all_responses["supervisor"].append(supervisor_initial_response) | |
| # 2๋จ๊ณ: ์น ๊ฒ์ ์ํ (์ ํ๋ ๊ฒฝ์ฐ) | |
| search_results = {} | |
| if use_web_search and BRAVE_API_TOKEN: | |
| progress(0.2, "๐ PPT ์ฝํ ์ธ ๊ฒ์ ์ค...") | |
| keywords = ppt_system.extract_keywords(supervisor_initial_response) | |
| logger.info(f"์ถ์ถ๋ ํค์๋: {keywords}") | |
| researcher_text = "[์ฝํ ์ธ ๊ฒ์] ๐ ๊ฒ์ ์ค...\n" | |
| yield supervisor_text, researcher_text, "", None, "๐ PPT ์ฝํ ์ธ ๊ฒ์ ์ค..." | |
| total_search_count = 0 | |
| # ์๋ ํค์๋๋ก ๊ฒ์ | |
| for keyword in keywords: | |
| try: | |
| results = ppt_system.brave_search(keyword) | |
| if results: | |
| search_results[keyword] = results | |
| total_search_count += len(results) | |
| researcher_text += f"โ '{keyword}' ๊ฒ์ ์๋ฃ ({len(results)}๊ฐ ๊ฒฐ๊ณผ)\n" | |
| yield supervisor_text, researcher_text, "", None, f"๐ '{keyword}' ๊ฒ์ ์ค..." | |
| except Exception as e: | |
| print(f"[Search] Error searching for '{keyword}': {str(e)}") | |
| researcher_text += f"\n๐ ์ด {total_search_count}๊ฐ์ ๊ฒ์ ๊ฒฐ๊ณผ ์์ง ์๋ฃ\n" | |
| # 3๋จ๊ณ: ์กฐ์ฌ์ AI๊ฐ ๊ฒ์ ๊ฒฐ๊ณผ ์ ๋ฆฌ | |
| progress(0.3, "๐ ์กฐ์ฌ์ AI๊ฐ ์ฝํ ์ธ ์ ๋ฆฌ ์ค...") | |
| researcher_prompt = ppt_system.create_researcher_prompt(ppt_topic, supervisor_initial_response, search_results) | |
| researcher_response = "" | |
| researcher_text = "[PPT ์ฝํ ์ธ ์ ๋ฆฌ] ๐ ์์ฑ ์ค...\n" | |
| for chunk in ppt_system.call_llm_streaming( | |
| [{"role": "user", "content": researcher_prompt}], | |
| "researcher" | |
| ): | |
| researcher_response += chunk | |
| researcher_text = f"[PPT ์ฝํ ์ธ ์ ๋ฆฌ] - {datetime.now().strftime('%H:%M:%S')}\n{researcher_response}" | |
| yield supervisor_text, researcher_text, "", None, "๐ ์กฐ์ฌ์ AI๊ฐ ์ฝํ ์ธ ์ ๋ฆฌ ์ค..." | |
| all_responses["researcher"].append(researcher_response) | |
| # 4๋จ๊ณ: ๊ฐ๋ ์ AI๊ฐ ์กฐ์ฌ ๋ด์ฉ ๊ธฐ๋ฐ์ผ๋ก ์คํ ์ง์ | |
| progress(0.4, "๐ฏ ๊ฐ๋ ์ AI๊ฐ ์ ์ ์ง์ ์ค...") | |
| supervisor_execution_prompt = ppt_system.create_supervisor_execution_prompt(ppt_topic, researcher_response) | |
| supervisor_execution_response = "" | |
| supervisor_text += "\n\n---\n\n[PPT ์ ์ ์ง์] ๐ ์์ฑ ์ค...\n" | |
| for chunk in ppt_system.call_llm_streaming( | |
| [{"role": "user", "content": supervisor_execution_prompt}], | |
| "supervisor" | |
| ): | |
| supervisor_execution_response += chunk | |
| temp_text = f"{all_responses['supervisor'][0]}\n\n---\n\n[PPT ์ ์ ์ง์] - {datetime.now().strftime('%H:%M:%S')}\n{supervisor_execution_response}" | |
| supervisor_text = f"[PPT ๊ตฌ์กฐ ์ค๊ณ] - {datetime.now().strftime('%H:%M:%S')}\n{temp_text}" | |
| yield supervisor_text, researcher_text, "", None, "๐ฏ ๊ฐ๋ ์ AI๊ฐ ์ ์ ์ง์ ์ค..." | |
| all_responses["supervisor"].append(supervisor_execution_response) | |
| # 5๋จ๊ณ: ์คํ์ AI๊ฐ ์กฐ์ฌ ๋ด์ฉ๊ณผ ์ง์๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ด๊ธฐ PPT ์์ฑ | |
| progress(0.5, "๐ ์คํ์ AI๊ฐ PPT ์์ฑ ์ค...") | |
| executor_prompt = ppt_system.create_executor_prompt(ppt_topic, supervisor_execution_response, researcher_response) | |
| executor_response = "" | |
| executor_text = "[์ด๊ธฐ PPT ์์ฑ] ๐ ์์ฑ ์ค...\n" | |
| for chunk in ppt_system.call_llm_streaming( | |
| [{"role": "user", "content": executor_prompt}], | |
| "executor" | |
| ): | |
| executor_response += chunk | |
| executor_text = f"[์ด๊ธฐ PPT ์์ฑ] - {datetime.now().strftime('%H:%M:%S')}\n{executor_response}" | |
| yield supervisor_text, researcher_text, executor_text, None, "๐ ์คํ์ AI๊ฐ PPT ์์ฑ ์ค..." | |
| all_responses["executor"].append(executor_response) | |
| # 5.5๋จ๊ณ: ์คํ์ AI ์๋ต ํ์ฑ (๊ฐ์ ๋ ํ์ ์ฌ์ฉ) | |
| progress(0.55, "๐ ์คํ์ AI ์๋ต์ ์ฌ๋ผ์ด๋๋ก ๋ณํ ์ค...") | |
| # ๊ฐ์ ๋ ํ์ ์ฌ์ฉ | |
| parsed_slides = parse_executor_response(executor_response, slides, language) | |
| logger.info(f"ํ์ฑ๋ ์ฌ๋ผ์ด๋ ์: {len(parsed_slides)}") | |
| # ํ์ฑ ์ฑ๊ณต ์ฌ๋ถ ํ์ธ | |
| parsing_success = len(parsed_slides) > 0 | |
| # ํ์ฑ ๊ฒฐ๊ณผ ๋ก๊ทธ | |
| for slide_idx, slide_data in parsed_slides.items(): | |
| logger.info(f"[ํ์ฑ ๊ฒฐ๊ณผ] ์ฌ๋ผ์ด๋ {slide_idx + 1}:") | |
| logger.info(f" - ์ ๋ชฉ: {slide_data.get('title', 'N/A')}") | |
| logger.info(f" - ๋ถ์ ๋ชฉ: {slide_data.get('subtitle', 'N/A')}") | |
| logger.info(f" - ๋ถ๋ฆฟ ํฌ์ธํธ ์: {len(slide_data.get('bullet_points', []))}") | |
| if slide_data.get('bullet_points'): | |
| logger.info(f" - ์ฒซ ๋ฒ์งธ ๋ถ๋ฆฟ: {slide_data['bullet_points'][0]}") | |
| # ํ์ฑ ์คํจ ์ ๊ฒฝ๊ณ ๋ฐ ๋์ฒด ๋ฐฉ์ | |
| if not parsing_success: | |
| logger.warning("[ํ์ฑ] ์คํ์ ์๋ต ํ์ฑ ์คํจ - ์คํ์ ์๋ต ์๋ฌธ์ ์ง์ ์ฌ์ฉ ์๋") | |
| # ์คํ์ ์๋ต์ ์ง์ ๋ณด์ฌ์ฃผ๊ธฐ (๋๋ฒ๊น ์ฉ) | |
| yield supervisor_text, researcher_text, executor_text + "\n\nโ ๏ธ ํ์ฑ ์คํจ - ๋์ฒด ๋ฐฉ๋ฒ ์ฌ์ฉ ์ค...", None, "โ ๏ธ ์ฌ๋ผ์ด๋ ํ์ฑ ์ค ๋ฌธ์ ๋ฐ๊ฒฌ, ๋์ฒด ๋ฐฉ๋ฒ ์ฌ์ฉ..." | |
| # 6๋จ๊ณ: ์ค์ ์ฌ๋ผ์ด๋ ์์ฑ (๊ฐ์ ๋ ๋ก์ง) | |
| progress(0.6, "๐จ ์ฌ๋ผ์ด๋ ์ด๋ฏธ์ง ์์ฑ ์ค...") | |
| results = [] | |
| preview_html = """ | |
| <style> | |
| .slides-container { | |
| width: 100%; | |
| max-width: 1400px; | |
| margin: 0 auto; | |
| } | |
| </style> | |
| <div class="slides-container"> | |
| """ | |
| # Process each slide with improved logic | |
| for i, slide in enumerate(slides): | |
| try: | |
| progress((0.6 + (0.3 * i / total_slides)), f"์ฌ๋ผ์ด๋ {i+1}/{total_slides} ์ฒ๋ฆฌ ์ค...") | |
| # Translate slide title if Korean | |
| display_title = slide.get('title', '') | |
| if language == "Korean" and slide.get('title', '') in SLIDE_TITLE_TRANSLATIONS: | |
| display_title = SLIDE_TITLE_TRANSLATIONS[slide.get('title', '')] | |
| slide_info = f"Slide {i+1}: {display_title}" | |
| slide_context = f"{slide.get('title', '')} - {slide.get('prompt_hint', '')}" | |
| # ํ์ฑ๋ ๋ฐ์ดํฐ ํ์ธ ๋ฐ ์ฌ์ฉ | |
| content = None | |
| speaker_notes = "" | |
| if i in parsed_slides and parsing_success: | |
| # ํ์ฑ๋ ๋ฐ์ดํฐ ์ฌ์ฉ | |
| parsed_data = parsed_slides[i] | |
| logger.info(f"[์ฌ๋ผ์ด๋ {i+1}] ์คํ์ AI์ ํ์ฑ๋ ์ฝํ ์ธ ์ฌ์ฉ") | |
| # ๋ถ๋ฆฟ ํฌ์ธํธ ๊ฒ์ฆ | |
| valid_bullets = [] | |
| for bp in parsed_data.get("bullet_points", []): | |
| # ์๋ฏธ์๋ placeholder ์ ๊ฑฐ | |
| if bp and not any(skip in bp for skip in ["Point 1", "Point 2", "Point 3", "Point 4", "Point 5", "๐ Point"]): | |
| valid_bullets.append(bp) | |
| # ์ ํจํ ๋ถ๋ฆฟ ํฌ์ธํธ๊ฐ ์์ผ๋ฉด ์ฌ์ฉ | |
| if len(valid_bullets) >= 3: # ์ต์ 3๊ฐ ์ด์์ผ ๋๋ง ์ฌ์ฉ | |
| content = { | |
| "subtitle": parsed_data.get("subtitle") or display_title, | |
| "bullet_points": valid_bullets[:5] # ์ต๋ 5๊ฐ | |
| } | |
| speaker_notes = parsed_data.get("speaker_notes", "") | |
| logger.info(f"[์ฌ๋ผ์ด๋ {i+1}] ํ์ฑ๋ ์ฝํ ์ธ ์ฌ์ฉ ์๋ฃ - ๋ถ๋ฆฟ {len(valid_bullets)}๊ฐ") | |
| else: | |
| logger.warning(f"[์ฌ๋ผ์ด๋ {i+1}] ๋ถ๋ฆฟ ํฌ์ธํธ ๋ถ์กฑ ({len(valid_bullets)}๊ฐ) - ์คํ์ ์๋ต์์ ์ฌ์ถ์ถ ์๋") | |
| # ์คํ์ ์๋ต์์ ํด๋น ์ฌ๋ผ์ด๋ ๊ด๋ จ ๋ด์ฉ ์ฌ์ถ์ถ | |
| slide_keywords = [display_title, slide.get('title', ''), slide.get('prompt_hint', '')] | |
| extracted_content = extract_relevant_content_from_executor( | |
| executor_response, slide_keywords, i+1, slide.get('title', '') | |
| ) | |
| if extracted_content and len(extracted_content.get("bullet_points", [])) >= 3: | |
| content = extracted_content | |
| speaker_notes = extracted_content.get("speaker_notes", "") | |
| logger.info(f"[์ฌ๋ผ์ด๋ {i+1}] ์คํ์ ์๋ต์์ ์ฌ์ถ์ถ ์ฑ๊ณต") | |
| # ํ์ฑ ์คํจํ๊ฑฐ๋ ์ฝํ ์ธ ๊ฐ ์์ผ๋ฉด ์คํ์ ์๋ต์์ ์ง์ ์ถ์ถ | |
| if not content: | |
| logger.warning(f"[์ฌ๋ผ์ด๋ {i+1}] ํ์ฑ ์คํจ - ์คํ์ ์๋ต์์ ์ง์ ์ถ์ถ ์๋") | |
| # ์ฌ๋ผ์ด๋ ๋ฒํธ๋ก ์คํ์ ์๋ต์์ ํด๋น ๋ถ๋ถ ์ฐพ๊ธฐ | |
| slide_section = extract_slide_section_from_executor(executor_response, i+1) | |
| if slide_section: | |
| content = parse_slide_section(slide_section, display_title) | |
| speaker_notes = extract_speaker_notes_from_section(slide_section) | |
| logger.info(f"[์ฌ๋ผ์ด๋ {i+1}] ์คํ์ ์๋ต์์ ์ง์ ์ถ์ถ ์ฑ๊ณต") | |
| # ๊ทธ๋๋ ์ฝํ ์ธ ๊ฐ ์์ผ๋ฉด ์ต์ข ํด๋ฐฑ | |
| if not content or len(content.get("bullet_points", [])) < 3: | |
| logger.warning(f"[์ฌ๋ผ์ด๋ {i+1}] ๋ชจ๋ ๋ฐฉ๋ฒ ์คํจ - generate_slide_content ํด๋ฐฑ ์ฌ์ฉ") | |
| # Thank You slide ํน๋ณ ์ฒ๋ฆฌ | |
| if slide.get('title') == 'Thank You': | |
| conclusion_phrase = generate_conclusion_phrase( | |
| ppt_topic, audience_type, language, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID, AUDIENCE_TYPES | |
| ) | |
| content = { | |
| "subtitle": conclusion_phrase, | |
| "bullet_points": [] | |
| } | |
| speaker_notes = generate_closing_notes( | |
| ppt_topic, conclusion_phrase, audience_type, language, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID, AUDIENCE_TYPES | |
| ) | |
| else: | |
| # ์ผ๋ฐ ์ฌ๋ผ์ด๋ ํด๋ฐฑ ์์ฑ | |
| content = generate_slide_content( | |
| ppt_topic, slide.get('title', ''), slide_context, audience_type, language, | |
| uploaded_content, list(search_results.values()) if use_web_search else [], | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID, AUDIENCE_TYPES | |
| ) | |
| speaker_notes = generate_presentation_notes( | |
| ppt_topic, slide.get('title', ''), content, audience_type, language, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID, AUDIENCE_TYPES | |
| ) | |
| # ๋ฐํ์ ๋ ธํธ๊ฐ ์์ผ๋ฉด ์์ฑ | |
| if not speaker_notes: | |
| speaker_notes = generate_presentation_notes( | |
| ppt_topic, slide.get('title', ''), content, audience_type, language, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID, AUDIENCE_TYPES | |
| ) | |
| # Generate prompt and image | |
| style_key = slide.get("style", "Colorful Mind Map") | |
| if style_key in STYLE_TEMPLATES: | |
| style_info = STYLE_TEMPLATES[style_key] | |
| prompt = generate_prompt_with_llm( | |
| ppt_topic, style_info["example"], | |
| slide_context, uploaded_content, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID | |
| ) | |
| # Generate image | |
| slide_seed = seed + i | |
| img, used_prompt = generate_image( | |
| prompt, slide_seed, slide_info, | |
| REPLICATE_API_TOKEN, current_topic, current_language, | |
| FRIENDLI_TOKEN, API_URL, MODEL_ID | |
| ) | |
| # Prepare slide data | |
| slide_data = { | |
| "slide_number": i + 1, | |
| "title": display_title, | |
| "subtitle": content["subtitle"], | |
| "bullet_points": content["bullet_points"][:5], | |
| "image": img, | |
| "style": style_info["name"], | |
| "speaker_notes": speaker_notes, | |
| "topic": ppt_topic | |
| } | |
| # ๋๋ฒ๊น : ์ค์ ์ฌ์ฉ๋ ์ฝํ ์ธ ๋ก๊ทธ | |
| logger.info(f"[์ฌ๋ผ์ด๋ {i+1}] ์ต์ข ์ฝํ ์ธ :") | |
| logger.info(f" - ๋ถ์ ๋ชฉ: {slide_data['subtitle']}") | |
| logger.info(f" - ๋ถ๋ฆฟ ํฌ์ธํธ: {len(slide_data['bullet_points'])}๊ฐ") | |
| if slide_data['bullet_points']: | |
| logger.info(f" - ์ฒซ ๋ฒ์งธ ๋ถ๋ฆฟ: {slide_data['bullet_points'][0]}") | |
| # Generate preview HTML | |
| preview_html += create_slide_preview_html(slide_data) | |
| # Update current state | |
| yield supervisor_text, researcher_text, executor_text, None, f"### ๐ {slide_info} ์์ฑ ์ค..." | |
| results.append({ | |
| "slide_data": slide_data, | |
| "success": img is not None | |
| }) | |
| else: | |
| logger.error(f"[์ฌ๋ผ์ด๋ {i+1}] ์ ์ ์๋ ์คํ์ผ: {style_key}") | |
| except Exception as e: | |
| logger.error(f"[์ฌ๋ผ์ด๋ {i+1}] ์ฒ๋ฆฌ ์ค ์ค๋ฅ: {str(e)}") | |
| import traceback | |
| traceback.print_exc() | |
| # ์ค๋ฅ ์ ๊ธฐ๋ณธ๊ฐ | |
| results.append({ | |
| "slide_data": { | |
| "slide_number": i + 1, | |
| "title": display_title, | |
| "subtitle": "์ฝํ ์ธ ์์ฑ ์ค ์ค๋ฅ ๋ฐ์", | |
| "bullet_points": ["โข ์ค๋ฅ๋ก ์ธํด ์ฝํ ์ธ ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค"], | |
| "image": None, | |
| "style": "Error", | |
| "speaker_notes": "์ค๋ฅ๋ก ์ธํด ๋ฐํ์ ๋ ธํธ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.", | |
| "topic": ppt_topic | |
| }, | |
| "success": False | |
| }) | |
| # Create PPTX file | |
| progress(0.95, "Creating PPTX file...") | |
| pptx_path = None | |
| try: | |
| pptx_path = create_pptx_file(results, ppt_topic, template_name, theme_name, DESIGN_THEMES) | |
| except Exception as e: | |
| print(f"[PPTX] File creation error: {str(e)}") | |
| import traceback | |
| traceback.print_exc() | |
| preview_html += "</div>" | |
| progress(1.0, "Complete!") | |
| successful = sum(1 for r in results if r["success"]) | |
| final_status = f"### ๐ Generation complete! {successful} out of {total_slides} slides succeeded" | |
| # Save global variables | |
| global current_slides_data, current_template, current_theme | |
| current_slides_data = results | |
| current_template = template_name | |
| current_theme = theme_name | |
| if pptx_path: | |
| final_status += f"\n\n### ๐ฅ PPTX file is ready!" | |
| final_status += f"\n\n๐ค **Speaker notes for {audience_type} included in each slide!**" | |
| if PROCESS_FLOW_AVAILABLE: | |
| final_status += f"\n\n๐ง **Process flow diagrams are automatically generated ({language} support)**" | |
| yield supervisor_text, researcher_text, executor_text, pptx_path, final_status | |
| except Exception as e: | |
| error_msg = f"โ ์ฒ๋ฆฌ ์ค ์ค๋ฅ: {str(e)}" | |
| print(f"[PPT Generation] Critical error: {str(e)}") | |
| import traceback | |
| traceback.print_exc() | |
| yield "", "", "", None, error_msg | |
| def generate_ppt_handler(topic, template_name, audience_type, language, theme_name, slide_count, | |
| seed, file_upload, use_web_search, custom_slide_count, | |
| progress=gr.Progress(), *custom_inputs): | |
| if not topic.strip(): | |
| yield "", "", "", None, "โ Please enter a topic." | |
| return | |
| # Process custom slides | |
| custom_slides = [] | |
| if template_name == "Custom" and custom_inputs: | |
| try: | |
| # Convert custom_inputs to list to avoid tuple slicing issues | |
| custom_inputs_list = list(custom_inputs) | |
| for i in range(0, min(custom_slide_count * 3, len(custom_inputs_list)), 3): | |
| title = custom_inputs_list[i] if i < len(custom_inputs_list) else "" | |
| style = custom_inputs_list[i+1] if i+1 < len(custom_inputs_list) else "Colorful Mind Map" | |
| hint = custom_inputs_list[i+2] if i+2 < len(custom_inputs_list) else "" | |
| if title and style: | |
| custom_slides.append({ | |
| "title": title, | |
| "style": style, | |
| "prompt_hint": hint | |
| }) | |
| except Exception as e: | |
| print(f"[Custom Slides] Error processing custom inputs: {str(e)}") | |
| yield "", "", "", None, f"โ Error processing custom slides: {str(e)}" | |
| return | |
| # Generate PPT | |
| try: | |
| for supervisor, researcher, executor, pptx_file, status in process_ppt_streaming( | |
| topic, template_name, audience_type, language, custom_slides, slide_count, | |
| seed, file_upload, use_web_search, theme_name, progress | |
| ): | |
| yield supervisor, researcher, executor, pptx_file, status | |
| except Exception as e: | |
| print(f"[PPT Generation] Error: {str(e)}") | |
| import traceback | |
| traceback.print_exc() | |
| yield "", "", "", None, f"โ Error during PPT generation: {str(e)}" | |
| # ===== Gradio UI ===== | |
| with gr.Blocks(title="PPT Generator", theme=gr.themes.Soft(), css=get_css()) as demo: | |
| gr.Markdown(""" | |
| # ๐ฏ Open GAMMA 'GAMJA' - AI Presentation Generator with 3-AI Collaboration | |
| ### Create professional presentations with AI-powered collaboration system! | |
| ** Community: https://discord.gg/openfreeai | |
| """) | |
| # API token status check | |
| token_status = [] | |
| if not REPLICATE_API_TOKEN: | |
| token_status.append("โ ๏ธ RAPI_TOKEN environment variable not set.") | |
| if not FRIENDLI_TOKEN: | |
| token_status.append("โ ๏ธ FRIENDLI_TOKEN environment variable not set.") | |
| if not BRAVE_API_TOKEN: | |
| token_status.append("โน๏ธ BAPI_TOKEN not available. Web search disabled.") | |
| if not PROCESS_FLOW_AVAILABLE: | |
| token_status.append("โน๏ธ process_flow_generator not available. Process flow diagrams disabled.") | |
| if token_status: | |
| gr.Markdown("\n".join(token_status)) | |
| with gr.Row(): | |
| with gr.Column(scale=1): | |
| # Language selection (at the top) | |
| language_select = gr.Radio( | |
| choices=["English", "Korean"], | |
| label="๐ Content Language", | |
| value="English", | |
| info="Select the language for your presentation content" | |
| ) | |
| # Example selection | |
| with gr.Row(): | |
| example_btn = gr.Button("๐ Load Example", size="sm", variant="secondary") | |
| # Basic inputs | |
| topic_input = gr.Textbox( | |
| label="Presentation Topic", | |
| placeholder="e.g., AI Startup Investment Pitch, New Product Launch, Digital Transformation Strategy", | |
| lines=2 | |
| ) | |
| # Audience selection | |
| audience_select = gr.Dropdown( | |
| choices=list(AUDIENCE_TYPES.keys()), | |
| label="๐ญ Target Audience", | |
| value="General Staff", | |
| info="Content and tone will be automatically optimized for your audience" | |
| ) | |
| # Audience description display | |
| audience_info = gr.Markdown() | |
| # PPT template selection | |
| template_select = gr.Dropdown( | |
| choices=list(PPT_TEMPLATES.keys()), | |
| label="PPT Template", | |
| value="Business Proposal", | |
| info="Select a template that matches your purpose" | |
| ) | |
| # Design theme selection | |
| theme_select = gr.Dropdown( | |
| choices=list(DESIGN_THEMES.keys()), | |
| label="Design Theme", | |
| value="Minimal Light", | |
| info="Overall design style for your presentation" | |
| ) | |
| # Theme preview | |
| theme_preview = gr.HTML() | |
| # Slide count selection | |
| slide_count = gr.Slider( | |
| minimum=6, | |
| maximum=20, | |
| value=8, | |
| step=1, | |
| label="Number of Content Slides (excluding Cover and Thank You)", | |
| info="Select the number of content slides to generate (not used in Custom template)" | |
| ) | |
| # File upload | |
| file_upload = gr.File( | |
| label="Reference Material Upload (Optional)", | |
| file_types=[".pdf", ".csv", ".txt"], | |
| type="filepath", | |
| value=None | |
| ) | |
| # Web search option | |
| use_web_search = gr.Checkbox( | |
| label="Use Web Search", | |
| value=True, | |
| info="Use Brave Search to include latest information" | |
| ) | |
| # Template description | |
| template_info = gr.Markdown() | |
| # Seed value | |
| seed_input = gr.Slider( | |
| minimum=1, | |
| maximum=100, | |
| value=10, | |
| step=1, | |
| label="Seed Value" | |
| ) | |
| generate_btn = gr.Button("๐ Generate PPT (AI creates all content automatically)", variant="primary", size="lg") | |
| # Usage instructions | |
| with gr.Accordion("๐ How to Use", open=False): | |
| gr.Markdown(get_usage_instructions()) | |
| # Status display | |
| with gr.Row(): | |
| with gr.Column(): | |
| status_output = gr.Markdown( | |
| value="### ๐ Select a template and click the generate button!" | |
| ) | |
| # PPTX download area | |
| download_file = gr.File( | |
| label="๐ฅ Download Generated PPTX File", | |
| visible=True, | |
| elem_id="download-file" | |
| ) | |
| # AI outputs in tabs | |
| with gr.Tabs(): | |
| with gr.TabItem("๐ค 3-AI Collaboration Process"): | |
| with gr.Row(): | |
| # ๊ฐ๋ ์ AI ์ถ๋ ฅ | |
| with gr.Column(): | |
| gr.Markdown("### ๐ง Supervisor AI (Structure Design)") | |
| supervisor_output = gr.Textbox( | |
| label="", | |
| lines=20, | |
| max_lines=25, | |
| interactive=False, | |
| elem_classes=["supervisor-box"] | |
| ) | |
| # ์กฐ์ฌ์ AI ์ถ๋ ฅ | |
| with gr.Column(): | |
| gr.Markdown("### ๐ Researcher AI (Content Collection)") | |
| researcher_output = gr.Textbox( | |
| label="", | |
| lines=20, | |
| max_lines=25, | |
| interactive=False, | |
| elem_classes=["researcher-box"] | |
| ) | |
| # ์คํ์ AI ์ถ๋ ฅ | |
| with gr.Column(): | |
| gr.Markdown("### ๐ Executor AI (Slide Creation)") | |
| executor_output = gr.Textbox( | |
| label="", | |
| lines=20, | |
| max_lines=25, | |
| interactive=False, | |
| elem_classes=["executor-box"] | |
| ) | |
| with gr.TabItem("๐ PPT Preview"): | |
| # Preview area | |
| preview_output = gr.HTML( | |
| label="PPT Preview (16:9)", | |
| elem_classes="preview-container" | |
| ) | |
| # Custom slides section | |
| with gr.Accordion("๐ Custom Slide Configuration", open=False, elem_id="custom_accordion") as custom_accordion: | |
| gr.Markdown("Build your presentation without using templates. (3-20 slides)") | |
| # Custom slide count selection | |
| custom_slide_count = gr.Slider( | |
| minimum=3, | |
| maximum=20, | |
| value=5, | |
| step=1, | |
| label="Number of Custom Slides", | |
| info="Select the number of custom slides to create" | |
| ) | |
| custom_slides_components = create_custom_slides_ui(initial_count=5) | |
| # Connect events | |
| example_btn.click( | |
| fn=load_example, | |
| inputs=[template_select, language_select], | |
| outputs=[topic_input] | |
| ) | |
| audience_select.change( | |
| fn=update_audience_info, | |
| inputs=[audience_select], | |
| outputs=[audience_info] | |
| ) | |
| theme_select.change( | |
| fn=update_theme_preview, | |
| inputs=[theme_select], | |
| outputs=[theme_preview] | |
| ) | |
| template_select.change( | |
| fn=update_template_info, | |
| inputs=[template_select, slide_count], | |
| outputs=[template_info, slide_count, custom_accordion] | |
| ) | |
| slide_count.change( | |
| fn=lambda t, s: update_template_info(t, s)[0], | |
| inputs=[template_select, slide_count], | |
| outputs=[template_info] | |
| ) | |
| custom_slide_count.change( | |
| fn=update_custom_slides_visibility, | |
| inputs=[custom_slide_count], | |
| outputs=[slide["row"] for slide in custom_slides_components] | |
| ) | |
| # Flatten custom slide input components | |
| all_custom_inputs = [] | |
| for slide in custom_slides_components: | |
| all_custom_inputs.extend([slide["title"], slide["style"], slide["hint"]]) | |
| generate_btn.click( | |
| fn=generate_ppt_handler, | |
| inputs=[ | |
| topic_input, template_select, audience_select, language_select, theme_select, | |
| slide_count, seed_input, file_upload, use_web_search, custom_slide_count | |
| ] + all_custom_inputs, | |
| outputs=[supervisor_output, researcher_output, executor_output, download_file, status_output] | |
| ) | |
| # Load initial info on startup | |
| demo.load( | |
| fn=lambda: (update_template_info(template_select.value, slide_count.value)[0], | |
| update_theme_preview(theme_select.value), | |
| update_audience_info(audience_select.value)), | |
| inputs=[], | |
| outputs=[template_info, theme_preview, audience_info] | |
| ) | |
| # Run app | |
| if __name__ == "__main__": | |
| demo.queue() # Enable queue for streaming | |
| demo.launch(ssr_mode=False) |