Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,1625 +1,35 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
import os
|
| 3 |
-
import
|
| 4 |
-
import
|
| 5 |
-
from
|
| 6 |
-
import time
|
| 7 |
-
from typing import List, Dict, Any, Generator, Tuple
|
| 8 |
-
import logging
|
| 9 |
-
import re
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# ์ถ๊ฐ ์ํฌํธ
|
| 16 |
-
from bs4 import BeautifulSoup
|
| 17 |
-
from urllib.parse import urlparse
|
| 18 |
-
import urllib.request
|
| 19 |
-
|
| 20 |
-
# Gemini API ์ํฌํธ
|
| 21 |
-
try:
|
| 22 |
-
from google import genai
|
| 23 |
-
from google.genai import types
|
| 24 |
-
GEMINI_AVAILABLE = True
|
| 25 |
-
except ImportError:
|
| 26 |
-
GEMINI_AVAILABLE = False
|
| 27 |
-
logger.warning("Google Gemini API๊ฐ ์ค์น๋์ง ์์์ต๋๋ค. pip install google-genai๋ก ์ค์นํ์ธ์.")
|
| 28 |
-
|
| 29 |
-
# ํ๊ฒฝ ๋ณ์์์ ํ ํฐ ๊ฐ์ ธ์ค๊ธฐ
|
| 30 |
-
FRIENDLI_TOKEN = os.getenv("FRIENDLI_TOKEN", "YOUR_FRIENDLI_TOKEN")
|
| 31 |
-
BAPI_TOKEN = os.getenv("BAPI_TOKEN", "YOUR_BRAVE_API_TOKEN")
|
| 32 |
-
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "YOUR_GEMINI_API_KEY")
|
| 33 |
-
API_URL = "https://api.friendli.ai/dedicated/v1/chat/completions"
|
| 34 |
-
BRAVE_SEARCH_URL = "https://api.search.brave.com/res/v1/web/search"
|
| 35 |
-
MODEL_ID = "dep89a2fld32mcm"
|
| 36 |
-
TEST_MODE = os.getenv("TEST_MODE", "false").lower() == "true"
|
| 37 |
-
|
| 38 |
-
# ์ ์ญ ๋ณ์
|
| 39 |
-
conversation_history = []
|
| 40 |
-
|
| 41 |
-
class WuxingLLMSystem:
|
| 42 |
-
"""์คํยท์ค์ ๊ธฐ๋ฐ AGI๊ธ ํ๋ ฅ์ ๋ณด๊ณ ์ ์์ฑ ์์คํ
- ์๊ทน(็ธๅ) ์๋ฆฌ ์ ์ฉ"""
|
| 43 |
-
|
| 44 |
-
def __init__(self):
|
| 45 |
-
self.token = FRIENDLI_TOKEN
|
| 46 |
-
self.bapi_token = BAPI_TOKEN
|
| 47 |
-
self.gemini_api_key = GEMINI_API_KEY
|
| 48 |
-
self.api_url = API_URL
|
| 49 |
-
self.brave_url = BRAVE_SEARCH_URL
|
| 50 |
-
self.model_id = MODEL_ID
|
| 51 |
-
self.test_mode = TEST_MODE or (self.token == "YOUR_FRIENDLI_TOKEN")
|
| 52 |
-
self.use_gemini = False
|
| 53 |
-
self.gemini_client = None
|
| 54 |
-
|
| 55 |
-
# ์คํ ์ญํ ์ ์ - AGI ์์ค ์ ๋ฌธ๊ฐ ํ
|
| 56 |
-
self.wuxing_roles = {
|
| 57 |
-
"wood": {
|
| 58 |
-
"name": "์ ๋ต์ ๋น์ ์ค๊ณ์ (Chief Vision Officer)",
|
| 59 |
-
"virtue": "ไป",
|
| 60 |
-
"element": "ๆจ",
|
| 61 |
-
"traits": "ํต์ฐฐ๋ ฅ, ๋ฏธ๋์์ธก, ํฌ์ฉ์ ๋ฆฌ๋์ญ",
|
| 62 |
-
"expertise": "๊ฑฐ์์ ๋น์ , ์์คํ
์ ์ฌ๊ณ , ํ์ ์ ๋ต, ์กฐ์ง ๋ฌธํ ์ค๊ณ",
|
| 63 |
-
"color": "#10b981",
|
| 64 |
-
"restrains": "ๅ", # ๆจๅ
ๅ
|
| 65 |
-
"restrained_by": "้" # ้ๅ
ๆจ
|
| 66 |
-
},
|
| 67 |
-
"fire": {
|
| 68 |
-
"name": "ํ์ ์ ๋ต ์ํคํ
ํธ (Innovation Strategy Architect)",
|
| 69 |
-
"virtue": "็พฉ",
|
| 70 |
-
"element": "็ซ",
|
| 71 |
-
"traits": "ํ๊ดด์ ํ์ , ์ ๋ต์ ์ง๊ด, ๋ฆฌ์คํฌ ํ
์ดํน",
|
| 72 |
-
"expertise": "๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ , ์์ฅ ํ๊ดด ์ ๋ต, ๊ฒฝ์์ฐ์ ์ค๊ณ",
|
| 73 |
-
"color": "#ef4444",
|
| 74 |
-
"restrains": "้", # ็ซๅ
้
|
| 75 |
-
"restrained_by": "ๆฐด" # ๆฐดๅ
็ซ
|
| 76 |
-
},
|
| 77 |
-
"metal": {
|
| 78 |
-
"name": "์์คํ
์ํคํ
์ฒ ๋ง์คํฐ (Systems Architecture Master)",
|
| 79 |
-
"virtue": "็ฆฎ",
|
| 80 |
-
"element": "้",
|
| 81 |
-
"traits": "์ ๋ฐ์ฑ, ์๋ฒฝ์ฃผ์, ์์คํ
ํตํฉ๋ ฅ",
|
| 82 |
-
"expertise": "์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ, ๊ธฐ์ ๊ฑฐ๋ฒ๋์ค, ํ์คํ ์ ๋ต",
|
| 83 |
-
"color": "#f59e0b",
|
| 84 |
-
"restrains": "ๆจ", # ้ๅ
ๆจ
|
| 85 |
-
"restrained_by": "็ซ" # ็ซๅ
้
|
| 86 |
-
},
|
| 87 |
-
"water": {
|
| 88 |
-
"name": "๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ (Future Tech Research Director)",
|
| 89 |
-
"virtue": "ๆบ",
|
| 90 |
-
"element": "ๆฐด",
|
| 91 |
-
"traits": "๊น์ ๋ถ์๋ ฅ, ๊ธฐ์ ํต์ฐฐ, ํ์ ์ ์ฌ๊ณ ",
|
| 92 |
-
"expertise": "์ ๊ธฐ์ R&D, ๊ธฐ์ ์ตํฉ, AI/ML, ํํ
์ปดํจํ
",
|
| 93 |
-
"color": "#3b82f6",
|
| 94 |
-
"restrains": "็ซ", # ๆฐดๅ
็ซ
|
| 95 |
-
"restrained_by": "ๅ" # ๅๅ
ๆฐด
|
| 96 |
-
},
|
| 97 |
-
"earth": {
|
| 98 |
-
"name": "์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ (Execution Excellence Expert)",
|
| 99 |
-
"virtue": "ไฟก",
|
| 100 |
-
"element": "ๅ",
|
| 101 |
-
"traits": "์ฒด๊ณ์ฑ, ์ ๋ขฐ์ฑ, ์คํ ์๋ฒฝ์ฑ",
|
| 102 |
-
"expertise": "ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค, ํ์ง ์์คํ
, ๋ฆฌ์คํฌ ๊ด๋ฆฌ, ROI ์ต์ ํ",
|
| 103 |
-
"color": "#a855f7",
|
| 104 |
-
"restrains": "ๆฐด", # ๅๅ
ๆฐด
|
| 105 |
-
"restrained_by": "ๆจ" # ๆจๅ
ๅ
|
| 106 |
-
}
|
| 107 |
-
}
|
| 108 |
-
|
| 109 |
-
if self.test_mode:
|
| 110 |
-
logger.warning("ํ
์คํธ ๋ชจ๋๋ก ์คํ๋ฉ๋๋ค.")
|
| 111 |
-
|
| 112 |
-
def set_llm_mode(self, mode: str):
|
| 113 |
-
"""LLM ๋ชจ๋ ์ค์ """
|
| 114 |
-
if mode == "commercial" and GEMINI_AVAILABLE and self.gemini_api_key != "YOUR_GEMINI_API_KEY":
|
| 115 |
-
self.use_gemini = True
|
| 116 |
-
if not self.gemini_client:
|
| 117 |
-
self.gemini_client = genai.Client(api_key=self.gemini_api_key)
|
| 118 |
-
logger.info("Gemini 2.5 Pro ๋ชจ๋๋ก ์ ํ๋์์ต๋๋ค.")
|
| 119 |
-
else:
|
| 120 |
-
self.use_gemini = False
|
| 121 |
-
logger.info("๊ธฐ๋ณธ LLM ๋ชจ๋๋ก ์ ํ๋์์ต๋๋ค.")
|
| 122 |
-
|
| 123 |
-
def create_headers(self):
|
| 124 |
-
"""API ํค๋ ์์ฑ"""
|
| 125 |
-
return {
|
| 126 |
-
"Authorization": f"Bearer {self.token}",
|
| 127 |
-
"Content-Type": "application/json"
|
| 128 |
-
}
|
| 129 |
-
|
| 130 |
-
def create_brave_headers(self):
|
| 131 |
-
"""Brave API ํค๋ ์์ฑ"""
|
| 132 |
-
return {
|
| 133 |
-
"Accept": "application/json",
|
| 134 |
-
"Accept-Encoding": "gzip",
|
| 135 |
-
"X-Subscription-Token": self.bapi_token
|
| 136 |
-
}
|
| 137 |
-
|
| 138 |
-
def create_wood_initial_prompt(self, user_query: str, search_results: Dict = None) -> str:
|
| 139 |
-
"""ๆจ(์ ๋ต์ ๋น์ ์ค๊ณ์) ์ด๊ธฐ ํ๋กฌํํธ"""
|
| 140 |
-
search_info = ""
|
| 141 |
-
if search_results:
|
| 142 |
-
search_info = "\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n" + self._format_search_results(search_results)
|
| 143 |
-
|
| 144 |
-
return f"""๋น์ ์ AGI ์์ค์ ์ ๋ต์ ๋น์ ์ค๊ณ์(Chief Vision Officer)์
๋๋ค.
|
| 145 |
-
ไป(์ธ์ํจ)์ ๋๋ชฉ์ผ๋ก ๋ฏธ๋๋ฅผ ์์ธกํ๊ณ ํ์ ์ ๋น์ ์ ์ ์ํฉ๋๋ค.
|
| 146 |
-
|
| 147 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 148 |
-
{user_query}
|
| 149 |
-
|
| 150 |
-
[์ฐธ๊ณ ์๋ฃ]
|
| 151 |
-
{search_info}
|
| 152 |
-
|
| 153 |
-
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ข
ํฉ์ ์ด๊ณ ํ์ ์ ์ธ ๋น์ ์ ์ ์ํ์ธ์:
|
| 154 |
-
|
| 155 |
-
1. **๊ฑฐ์์ ๋น์ ๊ณผ ํจ๋ฌ๋ค์ ์ ํ**
|
| 156 |
-
- 10๋
ํ ๋ฏธ๋ ์๋๋ฆฌ์ค์ ๋ฉ๊ฐํธ๋ ๋ ๋ถ์
|
| 157 |
-
- ํจ๋ฌ๋ค์ ์ํํธ์ ๊ฒ์์ฒด์ธ์ ์์ ์๋ณ
|
| 158 |
-
- ๊ธ๋ก๋ฒ ๋งฅ๋ฝ์์์ ์ ๋ต์ ํฌ์ง์
๋
|
| 159 |
-
|
| 160 |
-
2. **์์คํ
์ ์ฌ๊ณ ์ ๋ณต์ก๊ณ ๋ถ์**
|
| 161 |
-
- ๋ค์ฐจ์์ ์ํธ์์ฉ๊ณผ ํผ๋๋ฐฑ ๋ฃจํ ์ค๊ณ
|
| 162 |
-
- ์ฐฝ๋ฐ์ ์์ฑ๊ณผ ๋คํธ์ํฌ ํจ๊ณผ ์์ธก
|
| 163 |
-
- ์ํ๊ณ ๊ด์ ์ ๊ฐ์น ์ฐฝ์ถ ๋ชจ๋ธ
|
| 164 |
-
|
| 165 |
-
3. **ํ์ ํ๋ ์์ํฌ์ ์ ๋ต์ ๋ฐฉํฅ์ฑ**
|
| 166 |
-
- ๋ธ๋ฃจ์ค์
์ ๋ต๊ณผ ์นดํ
๊ณ ๋ฆฌ ๋์์ธ
|
| 167 |
-
- ์ง์์ ์ฑ์ฅ์ ์ํ ํ๋ผ์ดํ ์ค๊ณ
|
| 168 |
-
- ์ํฐํ๋์งํ ์์คํ
๊ตฌ์ถ ๋ฐฉ์
|
| 169 |
-
|
| 170 |
-
4. **ํ ์๋์ง์ ์ง๋จ์ง์ฑ ํ์ฉ ์ ๋ต**
|
| 171 |
-
- ็ซ(ํ์ ์ ๋ต): ํ๊ดด์ ํ์ ๊ณผ ๋น์ฆ๋์ค ๋ชจ๋ธ ์ฌ์ ์
|
| 172 |
-
- ๅ(์คํ ์ต์ ํ): ์ ์์ผ ์คํ๊ณผ ์ง์์ ๊ฐ์ ์ฒด๊ณ
|
| 173 |
-
- ้(์์คํ
์ํคํ
์ฒ): ํ์ฅ ๊ฐ๋ฅํ ๊ธฐ์ ์ธํ๋ผ์ ํ์คํ
|
| 174 |
-
- ๆฐด(๋ฏธ๋๊ธฐ์ R&D): ์ ๊ธฐ์ ์ตํฉ๊ณผ ํ์ ์ ํ๋กํ ํ์ดํ
|
| 175 |
-
|
| 176 |
-
5. **ํต์ฌ ์ฑ๊ณต ์งํ(KPI)์ ๋ถ๊ทน์ฑ ์งํ(North Star Metric)**
|
| 177 |
-
- ์ฅ๊ธฐ์ ์ํฉํธ ์ธก์ ํ๋ ์์ํฌ
|
| 178 |
-
- ์ ํ์งํ์ ํํ์งํ์ ๊ท ํ์กํ ์ค๊ณ
|
| 179 |
-
|
| 180 |
-
[๊ฒ์ ํค์๋ ์ ์]: ๋ฏธ๋ ์ฐ๊ตฌ์ ํ์ํ 7-10๊ฐ์ ์ ๋ต์ ํค์๋๋ฅผ ์ ์ํ์ธ์"""
|
| 181 |
-
|
| 182 |
-
def create_fire_strategy_prompt(self, user_query: str, wood_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
| 183 |
-
"""็ซ(ํ์ ์ ๋ต ์ํคํ
ํธ) ํ๋กฌํํธ"""
|
| 184 |
-
search_info = ""
|
| 185 |
-
if search_results:
|
| 186 |
-
search_info = "\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n" + self._format_search_results(search_results)
|
| 187 |
-
|
| 188 |
-
return f"""๋น์ ์ AGI ์์ค์ ํ์ ์ ๋ต ์ํคํ
ํธ(Innovation Strategy Architect)์
๋๋ค.
|
| 189 |
-
็พฉ(์ ์๋ก์)์ ๋๋ชฉ์ผ๋ก ํ๊ดด์ ํ์ ๊ณผ ๊ฒ์์ฒด์ธ์ง ์ ๋ต์ ์ค๊ณํฉ๋๋ค.
|
| 190 |
-
|
| 191 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 192 |
-
{user_query}
|
| 193 |
-
|
| 194 |
-
[์ ๋ต์ ๋น์ ์ค๊ณ์์ ํ๋ ์์ํฌ]
|
| 195 |
-
{wood_response}
|
| 196 |
-
|
| 197 |
-
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
| 198 |
-
{critic_feedback}
|
| 199 |
-
|
| 200 |
-
[์์ฅ ์กฐ์ฌ ๋ฐ์ดํฐ]
|
| 201 |
-
{search_info}
|
| 202 |
-
|
| 203 |
-
[์๋ฌด] ๋ค์ ๊ด์ ์์ ํ์ ์ ์ธ ์ ๋ต์ ์๋ฆฝํ์ธ์:
|
| 204 |
-
|
| 205 |
-
1. **ํ๊ดด์ ํ์ ๊ณผ ๋ธ๋ฃจ์ค์
์ ๋ต**
|
| 206 |
-
- ์ฐ์
์ฌ์ ์์ ์นดํ
๊ณ ๋ฆฌ ์ฐฝ์ถ
|
| 207 |
-
- ๊ฐ์น ํ์ ๊ณผ ์ฐจ๋ณํ ์ ๋ต
|
| 208 |
-
- ๋คํธ์ํฌ ํจ๊ณผ์ ํ๋ซํผ ์ ๋ต
|
| 209 |
-
|
| 210 |
-
2. **๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ **
|
| 211 |
-
- ์์ต ๋ชจ๋ธ ๋ค๊ฐํ (๊ตฌ๋
, ํ๋ฆฌ๋ฏธ์, ๋ง์ผํ๋ ์ด์ค)
|
| 212 |
-
- ๊ฐ์น์ฌ์ฌ ์ฌ๊ตฌ์ฑ๊ณผ ์์ง ํตํฉ
|
| 213 |
-
- ์ํ๊ณ ๊ตฌ์ถ๊ณผ ํํธ๋์ญ ์ ๋ต
|
| 214 |
-
|
| 215 |
-
3. **๊ฒฝ์์ฐ์ ํ๋ณด ์ ๋ต**
|
| 216 |
-
- ํต์ฌ ์ญ๋๊ณผ ์ฐจ๋ณํ ์์
|
| 217 |
-
- ์ง์
์ฅ๋ฒฝ ๊ตฌ์ถ ๋ฉ์ปค๋์ฆ
|
| 218 |
-
- ์ง์๊ฐ๋ฅํ ๊ฒฝ์์ฐ์ ์์ฒ
|
| 219 |
-
|
| 220 |
-
4. **์ฑ์ฅ ์ ๋ต๊ณผ ํ์ฅ ๊ณํ**
|
| 221 |
-
- ์์ฅ ์นจํฌ์ ์์ฅ ๊ฐ๋ฐ ์ ๋ต
|
| 222 |
-
- ์ ํ ๊ฐ๋ฐ๊ณผ ๋ค๊ฐํ ์ ๋ต
|
| 223 |
-
- M&A์ ์ ๋ต์ ์ ํด ์ต์
|
| 224 |
-
|
| 225 |
-
5. **๋ฆฌ์คํฌ ๊ด๋ฆฌ์ ์๋๋ฆฌ์ค ํ๋๋**
|
| 226 |
-
- ์ ๋ต์ ๋ฆฌ์คํฌ ๋งคํธ๋ฆญ์ค
|
| 227 |
-
- ๋์ ์๋๋ฆฌ์ค์ ์ปจํด์ ์ ํ๋
|
| 228 |
-
- ์ํฐํ๋์งํ ์ ๋ต ์ค๊ณ
|
| 229 |
-
|
| 230 |
-
[์ถ๊ฐ ์ฐ๊ตฌ ํ์]: ๊ฒฝ์์ฌ ๋ถ์, ์์ฅ ๋ํฅ, ๊ท์ ํ๊ฒฝ ๋ฑ ์ถ๊ฐ ์กฐ์ฌ๊ฐ ํ์ํ ํค์๋ [์ถ๊ฐ ๊ฒ์]"""
|
| 231 |
-
|
| 232 |
-
def create_earth_execution_prompt(self, user_query: str, fire_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
| 233 |
-
"""ๅ(์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ) ํ๋กฌํํธ"""
|
| 234 |
-
search_info = ""
|
| 235 |
-
if search_results:
|
| 236 |
-
search_info = "\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n" + self._format_search_results(search_results)
|
| 237 |
-
|
| 238 |
-
return f"""๋น์ ์ AGI ์์ค์ ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ(Execution Excellence Expert)์
๋๋ค.
|
| 239 |
-
ไฟก(์ ๋ขฐ)์ ๋๋ชฉ์ผ๋ก ์๋ฒฝํ ์คํ ์ฒด๊ณ์ ํ์ง ์์คํ
์ ๊ตฌ์ถํฉ๋๋ค.
|
| 240 |
-
|
| 241 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 242 |
-
{user_query}
|
| 243 |
-
|
| 244 |
-
[ํ์ ์ ๋ต ์ํคํ
ํธ์ ์ ๋ต]
|
| 245 |
-
{fire_response}
|
| 246 |
-
|
| 247 |
-
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
| 248 |
-
{critic_feedback}
|
| 249 |
-
|
| 250 |
-
[์คํ ๊ด๋ จ ๋ฒค์น๋งํฌ ๋ฐ์ดํฐ]
|
| 251 |
-
{search_info}
|
| 252 |
-
|
| 253 |
-
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ต์ ํ๋ ์คํ ๊ณํ์ ์๋ฆฝํ์ธ์:
|
| 254 |
-
|
| 255 |
-
1. **ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค์ PMO ์ฒด๊ณ**
|
| 256 |
-
- ์ ์์ผ/์ํฐํด ํ์ด๋ธ๋ฆฌ๋ ๋ฐฉ๋ฒ๋ก
|
| 257 |
-
- RACI ๋งคํธ๋ฆญ์ค์ ์์ฌ๊ฒฐ์ ๊ตฌ์กฐ
|
| 258 |
-
- ํ๋ก์ ํธ ํฌํธํด๋ฆฌ์ค ๊ด๋ฆฌ
|
| 259 |
-
|
| 260 |
-
2. **๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต**
|
| 261 |
-
- ์ํฌ ๋ธ๋ ์ดํฌ๋ค์ด ์คํธ๋ญ์ฒ(WBS)
|
| 262 |
-
- ํฌ๋ฆฌํฐ์ปฌ ํจ์ค์ ๋ง์ผ์คํค
|
| 263 |
-
- ์คํ๋ฆฐํธ ๊ณํ๊ณผ ๋ฐฑ๋ก๊ทธ ๊ด๋ฆฌ
|
| 264 |
-
|
| 265 |
-
3. **๋ฆฌ์์ค ์ต์ ํ์ ์์ฐ ๊ด๋ฆฌ**
|
| 266 |
-
- ์ธ๋ ฅ ๋ฐฐ์น์ ์คํฌ ๋งคํธ๋ฆญ์ค
|
| 267 |
-
- TCO ๋ถ์๊ณผ ์์ฐ ๋ฐฐ๋ถ
|
| 268 |
-
- ๋น์ฉ ์ต์ ํ ์ ๋ต
|
| 269 |
-
|
| 270 |
-
4. **ํ์ง ๊ด๋ฆฌ ์์คํ
**
|
| 271 |
-
- ISO 9001/27001 ๊ธฐ๋ฐ ํ์ง ์ฒด๊ณ
|
| 272 |
-
- KPI/OKR ํ๋ ์์ํฌ
|
| 273 |
-
- ์ง์์ ๊ฐ์ (Kaizen) ๋ฉ์ปค๋์ฆ
|
| 274 |
-
|
| 275 |
-
5. **๋ฆฌ์คํฌ ๊ด๋ฆฌ์ ๋ณํ ๊ด๋ฆฌ**
|
| 276 |
-
- ๋ฆฌ์คํฌ ๋ ์ง์คํฐ์ ์ํ ์ ๋ต
|
| 277 |
-
- ๋ณํ ๊ด๋ฆฌ 8๋จ๊ณ ํ๋ก์ธ์ค
|
| 278 |
-
- ์ดํด๊ด๊ณ์ ๊ด๋ฆฌ ์ ๋ต
|
| 279 |
-
|
| 280 |
-
6. **์ฑ๊ณผ ์ธก์ ๊ณผ ๋์๋ณด๋**
|
| 281 |
-
- ์ค์๊ฐ ๋ชจ๋ํฐ๋ง ์์คํ
|
| 282 |
-
- ๊ท ํ์ฑ๊ณผํ(BSC) ์ค๊ณ
|
| 283 |
-
- ์์ธก ๋ถ์๊ณผ ์กฐ๊ธฐ ๊ฒฝ๋ณด ์์คํ
|
| 284 |
-
|
| 285 |
-
[์ถ๊ฐ ์กฐ์ฌ ํ์]: ์
๊ณ ๋ฒ ์คํธ ํ๋ํฐ์ค, ์คํ ๋๊ตฌ, ํ์ง ํ์ค ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
| 286 |
-
|
| 287 |
-
def create_metal_architecture_prompt(self, user_query: str, earth_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
| 288 |
-
"""้(์์คํ
์ํคํ
์ฒ ๋ง์คํฐ) ํ๋กฌํํธ"""
|
| 289 |
-
search_info = ""
|
| 290 |
-
if search_results:
|
| 291 |
-
search_info = "\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n" + self._format_search_results(search_results)
|
| 292 |
-
|
| 293 |
-
return f"""๋น์ ์ AGI ์์ค์ ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ(Systems Architecture Master)์
๋๋ค.
|
| 294 |
-
็ฆฎ(์์ยท์ง์)์ ๋๋ชฉ์ผ๋ก ์๋ฒฝํ๊ณ ํ์ฅ ๊ฐ๋ฅํ ์์คํ
์ ์ค๊ณํฉ๋๋ค.
|
| 295 |
-
|
| 296 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 297 |
-
{user_query}
|
| 298 |
-
|
| 299 |
-
[์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ์ ๊ณํ]
|
| 300 |
-
{earth_response}
|
| 301 |
-
|
| 302 |
-
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
| 303 |
-
{critic_feedback}
|
| 304 |
-
|
| 305 |
-
[๊ธฐ์ ์ํคํ
์ฒ ์ฐธ๊ณ ์๋ฃ]
|
| 306 |
-
{search_info}
|
| 307 |
-
|
| 308 |
-
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ํฐํ๋ผ์ด์ฆ๊ธ ์ํคํ
์ฒ๋ฅผ ์ค๊ณํ์ธ์:
|
| 309 |
-
|
| 310 |
-
1. **์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ ํ๋ ์์ํฌ**
|
| 311 |
-
- TOGAF/Zachman ๊ธฐ๋ฐ ์ค๊ณ
|
| 312 |
-
- ๋น์ฆ๋์ค/์ ํ๋ฆฌ์ผ์ด์
/๋ฐ์ดํฐ/๊ธฐ์ ์ํคํ
์ฒ
|
| 313 |
-
- ์ํคํ
์ฒ ๊ฑฐ๋ฒ๋์ค์ ์์น
|
| 314 |
-
|
| 315 |
-
2. **๊ธฐ์ ์คํ๊ณผ ํ๋ซํผ ์ ๋ต**
|
| 316 |
-
- ํด๋ผ์ฐ๋ ๋ค์ดํฐ๋ธ ์ํคํ
์ฒ (AWS/Azure/GCP)
|
| 317 |
-
- ๋ง์ดํฌ๋ก์๋น์ค์ ์ปจํ
์ด๋ํ
|
| 318 |
-
- API ์ฐ์ ์ค๊ณ์ ์ด๋ฒคํธ ๊ธฐ๋ฐ ์ํคํ
์ฒ
|
| 319 |
-
|
| 320 |
-
3. **๋ฐ์ดํฐ ์ํคํ
์ฒ์ ๊ฑฐ๋ฒ๋์ค**
|
| 321 |
-
- ๋ฐ์ดํฐ ๋ ์ดํฌํ์ฐ์ค ์ค๊ณ
|
| 322 |
-
- ๋ง์คํฐ ๋ฐ์ดํฐ ๊ด๋ฆฌ(MDM)
|
| 323 |
-
- ๋ฐ์ดํฐ ํ์ง๊ณผ ๋ฆฌ๋์ง ๊ด๋ฆฌ
|
| 324 |
-
|
| 325 |
-
4. **๋ณด์ ์ํคํ
์ฒ์ ์ปดํ๋ผ์ด์ธ์ค**
|
| 326 |
-
- ์ ๋ก ํธ๋ฌ์คํธ ๋ณด์ ๋ชจ๋ธ
|
| 327 |
-
- IAM๊ณผ ์ ๊ทผ ์ ์ด ์ฒด๊ณ
|
| 328 |
-
- GDPR/SOC2 ์ปดํ๋ผ์ด์ธ์ค
|
| 329 |
-
|
| 330 |
-
5. **ํ์ฅ์ฑ๊ณผ ์ฑ๋ฅ ์ต์ ํ**
|
| 331 |
-
- ์ํ/์์ง ํ์ฅ ์ ๋ต
|
| 332 |
-
- ์บ์ฑ๊ณผ CDN ์ ๋ต
|
| 333 |
-
- ์ฑ๋ฅ ๋ชจ๋ํฐ๋ง๊ณผ ํ๋
|
| 334 |
-
|
| 335 |
-
6. **๊ธฐ์ ํ์ค๊ณผ ๋ฒ ์คํธ ํ๋ํฐ์ค**
|
| 336 |
-
- ์ฝ๋ฉ ํ์ค๊ณผ ๋์์ธ ํจํด
|
| 337 |
-
- CI/CD ํ์ดํ๋ผ์ธ
|
| 338 |
-
- ๊ธฐ์ ๋ถ์ฑ ๊ด๋ฆฌ ์ ๋ต
|
| 339 |
-
|
| 340 |
-
[์ถ๊ฐ ์กฐ์ฌ ํ์]: ์ต์ ๊ธฐ์ ํธ๋ ๋, ์ํคํ
์ฒ ํจํด, ๋ณด์ ํ์ค ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
| 341 |
-
|
| 342 |
-
def create_water_rd_prompt(self, user_query: str, metal_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
| 343 |
-
"""ๆฐด(๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ) ํ๋กฌํํธ"""
|
| 344 |
-
search_info = ""
|
| 345 |
-
if search_results:
|
| 346 |
-
search_info = "\n\n์ต์ ๊ธฐ์ ์กฐ์ฌ ๊ฒฐ๊ณผ:\n" + self._format_search_results(search_results)
|
| 347 |
-
|
| 348 |
-
return f"""๋น์ ์ AGI ์์ค์ ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ(Future Tech Research Director)์
๋๋ค.
|
| 349 |
-
ๆบ(์งํ)์ ๋๋ชฉ์ผ๋ก ์ต์ฒจ๋จ ๊ธฐ์ ์ ์ฐ๊ตฌํ๊ณ ํ์ ์ ์ฃผ๋ํฉ๋๋ค.
|
| 350 |
-
|
| 351 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 352 |
-
{user_query}
|
| 353 |
-
|
| 354 |
-
[์์คํ
์ํคํ
์ฒ ๋ง์คํฐ์ ์ค๊ณ]
|
| 355 |
-
{metal_response}
|
| 356 |
-
|
| 357 |
-
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
| 358 |
-
{critic_feedback}
|
| 359 |
-
|
| 360 |
-
[๊ธ๋ก๋ฒ ๊ธฐ์ ํธ๋ ๋ ๋ถ์]
|
| 361 |
-
{search_info}
|
| 362 |
-
|
| 363 |
-
[์๋ฌด] ๋ค์ ๊ด์ ์์ ๋ฏธ๋ ์งํฅ์ R&D ์ ๋ต์ ์๋ฆฝํ์ธ์:
|
| 364 |
-
|
| 365 |
-
1. **์ ๊ธฐ์ ํธ๋ ๋์ ๊ธฐ์ ์ตํฉ**
|
| 366 |
-
- AI/ML/๋ฅ๋ฌ๋ ์ต์ ๋ํฅ
|
| 367 |
-
- ํํ
์ปดํจํ
๊ณผ ์ฃ์ง ์ปดํจํ
|
| 368 |
-
- ๋ธ๋ก์ฒด์ธ๊ณผ Web3 ๊ธฐ์
|
| 369 |
-
- ๋ฉํ๋ฒ์ค์ XR ๊ธฐ์
|
| 370 |
-
|
| 371 |
-
2. **ํ์ ์ ํ๋กํ ํ์ดํ ์ ๋ต**
|
| 372 |
-
- MVP์ ๋น ๋ฅธ ์คํ ์ฃผ๊ธฐ
|
| 373 |
-
- A/B ํ
์คํ
๊ณผ ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์
|
| 374 |
-
- ์คํ ์ด๋
ธ๋ฒ ์ด์
๊ณผ ํด์ปคํค
|
| 375 |
-
|
| 376 |
-
3. **AI/ML ํตํฉ ์ ๋ต**
|
| 377 |
-
- LLM๊ณผ ์์ฑํ AI ํ์ฉ
|
| 378 |
-
- MLOps์ ๋ชจ๋ธ ๊ฑฐ๋ฒ๋์ค
|
| 379 |
-
- ์ค๋ช
๊ฐ๋ฅํ AI(XAI)
|
| 380 |
-
- ์ค๋ฆฌ์ AI ๊ฐ์ด๋๋ผ์ธ
|
| 381 |
-
|
| 382 |
-
4. **์๋ํ์ ์์ฐ์ฑ ํ์ **
|
| 383 |
-
- RPA์ ํ์ดํผ์คํ ๋ฉ์ด์
|
| 384 |
-
- Low-code/No-code ํ๋ซํผ
|
| 385 |
-
- DevOps์ GitOps
|
| 386 |
-
- ์ง๋ฅํ ๋ชจ๋ํฐ๋ง ์์คํ
|
| 387 |
-
|
| 388 |
-
5. **๊ธฐ์ ROI์ ํ์ ํฌํธํด๋ฆฌ์ค**
|
| 389 |
-
- ๊ธฐ์ ํฌ์ ์ฐ์ ์์ ๋งคํธ๋ฆญ์ค
|
| 390 |
-
- ํ์ ํ๊ณ์ ์ฑ๊ณผ ์ธก์
|
| 391 |
-
- ๊ธฐ์ ํํธ๋์ญ ์ ๋ต
|
| 392 |
-
|
| 393 |
-
6. **๋ฏธ๋ ์ค๋น๋์ ๊ธฐ์ ๋ก๋๋งต**
|
| 394 |
-
- 3-5๋
๊ธฐ์ ๋น์
|
| 395 |
-
- ๊ธฐ์ ์ญ๋ ๊ฐ๋ฐ ๊ณํ
|
| 396 |
-
- ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์
์ฑ์๋
|
| 397 |
-
|
| 398 |
-
[์ถ๊ฐ ์ฐ๊ตฌ ํ์]: Gartner Hype Cycle, MIT Tech Review, ํนํ ๋ํฅ ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
| 399 |
-
|
| 400 |
-
def create_wood_final_prompt(self, user_query: str, all_responses: Dict, all_critics: List) -> str:
|
| 401 |
-
"""ๆจ(์ ๋ต์ ๋น์ ์ค๊ณ์) ์ต์ข
์ข
ํฉ ๋ณด๊ณ ์ ํ๋กฌํํธ"""
|
| 402 |
-
return f"""๋น์ ์ AGI ์์ค์ ์ ๋ต์ ๋น์ ์ค๊ณ์์
๋๋ค.
|
| 403 |
-
ํ ์ ์ฒด์ ์ง๋จ์ง์ฑ์ ์ข
ํฉํ์ฌ ์ต๊ณ ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๋ฅผ ์์ฑํฉ๋๋ค.
|
| 404 |
-
|
| 405 |
-
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
| 406 |
-
{user_query}
|
| 407 |
-
|
| 408 |
-
[ํ์ ๊ธฐ์ฌ ๋ด์ฉ]
|
| 409 |
-
โถ ็ซ(ํ์ ์ ๋ต ์ํคํ
ํธ): {all_responses['fire']}
|
| 410 |
-
โถ ๅ(์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ): {all_responses['earth']}
|
| 411 |
-
โถ ้(์์คํ
์ํคํ
์ฒ ๋ง์คํฐ): {all_responses['metal']}
|
| 412 |
-
โถ ๆฐด(๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ): {all_responses['water']}
|
| 413 |
-
|
| 414 |
-
[๋นํ์ ํต์ฐฐ]
|
| 415 |
-
{self._format_critic_history(all_critics)}
|
| 416 |
-
|
| 417 |
-
[์ต์ข
์ข
ํฉ ๋ณด๊ณ ์ ์์ฑ ์ง์นจ]
|
| 418 |
-
|
| 419 |
-
๋ค์ ๊ตฌ์กฐ๋ก ์ต๊ณ ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๋ฅผ ์์ฑํ์ธ์:
|
| 420 |
-
|
| 421 |
-
# EXECUTIVE SUMMARY
|
| 422 |
-
- ํต์ฌ ๊ถ๊ณ ์ฌํญ (3-5๊ฐ ๋ถ๋ฆฟํฌ์ธํธ)
|
| 423 |
-
- ์์ ์ํฉํธ์ ROI
|
| 424 |
-
- ์ฆ์ ์คํ ๊ฐ๋ฅํ Quick Wins
|
| 425 |
-
|
| 426 |
-
# 1. ์ ๋ต์ ๋ถ์๊ณผ ๋น์
|
| 427 |
-
## 1.1 ํํฉ ์ง๋จ๊ณผ ๊ธฐํ ๋ถ์
|
| 428 |
-
- SWOT-TOWS ๋งคํธ๋ฆญ์ค
|
| 429 |
-
- ํฌํฐ์ 5 Forces + ๋์งํธ ์ ํ ์ํฅ
|
| 430 |
-
- ๊ฐ์น์ฌ์ฌ ๋ถ์๊ณผ ์ฌ์ ์ ๊ธฐํ
|
| 431 |
-
|
| 432 |
-
## 1.2 ๋ฏธ๋ ์๋๋ฆฌ์ค์ ์ ๋ต์ ์ต์
|
| 433 |
-
- ์๋๋ฆฌ์ค ํ๋๋ (์ต์ /ํ์ค์ /์ต์
)
|
| 434 |
-
- ์ ๋ต์ ์ต์
๊ณผ ์์ฌ๊ฒฐ์ ํธ๋ฆฌ
|
| 435 |
-
- ๋ฆฌ์คํฌ-๋ฆฌํด ํ๋กํ์ผ
|
| 436 |
-
|
| 437 |
-
# 2. ํ์ ์ ๋ต๊ณผ ์คํ ๋ก๋๋งต
|
| 438 |
-
## 2.1 ํ์ ํ๋ ์์ํฌ
|
| 439 |
-
- ํ์ ํฌํธํด๋ฆฌ์ค (Horizon 1-2-3)
|
| 440 |
-
- ๋์งํธ ์ ํ ์ฑ์๋ ๋ชจ๋ธ
|
| 441 |
-
- ์คํ ์ด๋
ธ๋ฒ ์ด์
์ ๋ต
|
| 442 |
-
|
| 443 |
-
## 2.2 ๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต
|
| 444 |
-
- Phase 1 (0-6๊ฐ์): ๊ธฐ๋ฐ ๊ตฌ์ถ
|
| 445 |
-
- Phase 2 (6-18๊ฐ์): ํ์ฅ๊ณผ ์ต์ ํ
|
| 446 |
-
- Phase 3 (18-36๊ฐ์): ํ์ ๊ณผ ์ฑ์ฅ
|
| 447 |
-
- ๊ฐ ๋จ๊ณ๋ณ ๋ง์ผ์คํค๊ณผ KPI
|
| 448 |
-
|
| 449 |
-
# 3. ๊ธฐ์ ์ํคํ
์ฒ์ ์ธํ๋ผ
|
| 450 |
-
## 3.1 ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ
|
| 451 |
-
- ํ์ฌ ์ํ(AS-IS)์ ๋ชฉํ ์ํ(TO-BE)
|
| 452 |
-
- ๊ธฐ์ ์คํ๊ณผ ํ๋ซํผ ์ ๋ต
|
| 453 |
-
- ๋ฐ์ดํฐ ๊ฑฐ๋ฒ๋์ค์ ๋ณด์ ์ํคํ
์ฒ
|
| 454 |
-
|
| 455 |
-
## 3.2 ํ์ฅ์ฑ๊ณผ ๋ฏธ๋ ๋์
|
| 456 |
-
- ๋ง์ดํฌ๋ก์๋น์ค์ ํด๋ผ์ฐ๋ ๋ค์ดํฐ๋ธ
|
| 457 |
-
- AI/ML ํตํฉ ์ ๋ต
|
| 458 |
-
- ๊ธฐ์ ๋ถ์ฑ ๊ด๋ฆฌ์ ํ๋ํ ๊ณํ
|
| 459 |
-
|
| 460 |
-
# 4. ์คํ ๊ณํ๊ณผ ๊ฑฐ๋ฒ๋์ค
|
| 461 |
-
## 4.1 ์กฐ์ง๊ณผ ๊ฑฐ๋ฒ๋์ค
|
| 462 |
-
- ๋ณํ๊ด๋ฆฌ ์ ๋ต
|
| 463 |
-
- ์ ์์ผ ๊ฑฐ๋ฒ๋์ค ๊ตฌ์กฐ
|
| 464 |
-
- ์ญ๋ ๊ฐ๋ฐ๊ณผ ์ธ์ฌ ํ๋ณด
|
| 465 |
-
|
| 466 |
-
## 4.2 ํฌ์์ ์ฌ๋ฌด ๋ถ์
|
| 467 |
-
- TCO์ ROI ๋ถ์
|
| 468 |
-
- ์๊ธ ์กฐ๋ฌ ์ต์
|
| 469 |
-
- ์ฌ๋ฌด ๋ฆฌ์คํฌ ๊ด๋ฆฌ
|
| 470 |
-
|
| 471 |
-
# 5. ์ฑ๊ณผ ์ธก์ ๊ณผ ์ง์๊ฐ๋ฅ์ฑ
|
| 472 |
-
## 5.1 ์ฑ๊ณผ ์ธก์ ํ๋ ์์ํฌ
|
| 473 |
-
- OKR๊ณผ ๊ท ํ์ฑ๊ณผํ(BSC)
|
| 474 |
-
- ์ค์๊ฐ ๋์๋ณด๋ ์ค๊ณ
|
| 475 |
-
- ์ง์์ ๊ฐ์ ๋ฉ์ปค๋์ฆ
|
| 476 |
-
|
| 477 |
-
## 5.2 ์ง์๊ฐ๋ฅ์ฑ๊ณผ ESG
|
| 478 |
-
- ESG ํตํฉ ์ ๋ต
|
| 479 |
-
- ์ํ๊ฒฝ์ ๋ชจ๋ธ
|
| 480 |
-
- ์ฌํ์ ์ํฉํธ ์ธก์
|
| 481 |
-
|
| 482 |
-
# APPENDIX
|
| 483 |
-
- ์์ธ ๋ถ์ ์๋ฃ
|
| 484 |
-
- ๋ฒค์น๋งํน ์ฌ๋ก
|
| 485 |
-
- ์ฉ์ด ์ ์์ ์ฐธ๊ณ ๋ฌธํ
|
| 486 |
-
|
| 487 |
-
**์์ฑ ์์น:**
|
| 488 |
-
- ๋ฐ์ดํฐ ๊ธฐ๋ฐ์ ๋
ผ๋ฆฌ์ ์ ๊ฐ
|
| 489 |
-
- ์คํ ๊ฐ๋ฅํ ๊ตฌ์ฒด์ ๊ถ๊ณ ์
|
| 490 |
-
- ์๊ฐ์ ์์ ํ์ฉ (ํ, ์ฐจํธ ์ค๋ช
)
|
| 491 |
-
- ์ ๋ฌธ ์ฉ์ด์ ์ผ๋ฐ ์ฉ์ด์ ๊ท ํ
|
| 492 |
-
- ๊ธ๋ก๋ฒ ๋ฒ ์คํธ ํ๋ํฐ์ค ๋ฐ์"""
|
| 493 |
-
|
| 494 |
-
def create_critic_prompt(self, stage: str, content: str, context: str = "", search_results: Dict = None) -> str:
|
| 495 |
-
"""AGI๊ธ ์คํ ์๊ทน ๊ธฐ๋ฐ ๋นํ์ ํ๋กฌํํธ"""
|
| 496 |
-
search_info = ""
|
| 497 |
-
if search_results:
|
| 498 |
-
search_info = f"\n\n์ฐธ๊ณ ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
| 499 |
-
|
| 500 |
-
context_section = ""
|
| 501 |
-
if context:
|
| 502 |
-
context_section = f"[์ด์ ๋งฅ๋ฝ]\n{context}\n"
|
| 503 |
-
|
| 504 |
-
# ์คํ ์๊ทน ๊ด๊ณ์ ๋ฐ๋ฅธ ๋นํ ๊ด์ ์ค์
|
| 505 |
-
critic_perspectives = {
|
| 506 |
-
"ๆจ ์ด๊ธฐ ๋ถ์": {
|
| 507 |
-
"perspective": "้(์์คํ
์ํคํ
์ฒ ๋ง์คํฐ)",
|
| 508 |
-
"focus": "์ ๋ฐ์ฑ, ์ฒด๊ณ์ฑ, ํ์คํ",
|
| 509 |
-
"virtue": "็ฆฎ",
|
| 510 |
-
"approach": "๊ตฌ์กฐ์ ์๊ฒฐ์ฑ๊ณผ ์์คํ
์ ์ ํฉ์ฑ์ ์ค์ฌ์ผ๋ก ์ ๋ต์ ์คํ ๊ฐ๋ฅ์ฑ์ ๋์ฒ ํ๊ฒ ๋ถ์"
|
| 511 |
-
},
|
| 512 |
-
"็ซ ์ ๋ต๊ธฐํ": {
|
| 513 |
-
"perspective": "ๆฐด(๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ)",
|
| 514 |
-
"focus": "๋ถ์์ ๊น์ด, ๊ธฐ์ ์ ํ๋น์ฑ, ํ์ ์ฑ",
|
| 515 |
-
"virtue": "ๆบ",
|
| 516 |
-
"approach": "๊ธฐ์ ์ ๊ด์ ์์ ์ ๋ต์ ์คํ ๊ฐ๋ฅ์ฑ๊ณผ ํ์ ์ ์ง์๊ฐ๋ฅ์ฑ์ ์ฌ์ธต ๋ถ์"
|
| 517 |
-
},
|
| 518 |
-
"ๅ ์คํ๊ณํ": {
|
| 519 |
-
"perspective": "ๆจ(์ ๋ต์ ๋น์ ์ค๊ณ์)",
|
| 520 |
-
"focus": "๊ฑฐ์์ ์ผ๊ด์ฑ, ๋น์ ์ ํฉ์ฑ, ์ฑ์ฅ ๊ฐ๋ฅ์ฑ",
|
| 521 |
-
"virtue": "ไป",
|
| 522 |
-
"approach": "์ ์ฒด์ ์ธ ๋น์ ๊ณผ์ ์ ํฉ์ฑ ๋ฐ ์ฅ๊ธฐ์ ์ฑ์ฅ ๊ด์ ์์ ์คํ๊ณํ์ ์ ์ ์ฑ ํ๊ฐ"
|
| 523 |
-
},
|
| 524 |
-
"้ ์ํคํ
์ฒ": {
|
| 525 |
-
"perspective": "็ซ(ํ์ ์ ๋ต ์ํคํ
ํธ)",
|
| 526 |
-
"focus": "ํ์ ์ฑ, ์ ์ฐ์ฑ, ๋ณํ ๋์๋ ฅ",
|
| 527 |
-
"virtue": "็พฉ",
|
| 528 |
-
"approach": "ํ๊ดด์ ํ์ ๊ณผ ๊ธ๋ณํ๋ ์์ฅ ํ๊ฒฝ์์ ์ํคํ
์ฒ์ ์ ์์ฑ๊ณผ ํ์ฅ์ฑ ๊ฒ์ฆ"
|
| 529 |
-
},
|
| 530 |
-
"ๆฐด R&D": {
|
| 531 |
-
"perspective": "ๅ(์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ)",
|
| 532 |
-
"focus": "์คํ ๊ฐ๋ฅ์ฑ, ์์ ํจ์จ์ฑ, ROI",
|
| 533 |
-
"virtue": "ไฟก",
|
| 534 |
-
"approach": "์ค๋ฌด์ ๊ด์ ์์ R&D ์ ๋ต์ ๊ตฌ์ฒด์ฑ๊ณผ ํฌ์ ๋๋น ํจ๊ณผ์ฑ์ ๋ฉด๋ฐํ ๊ฒํ "
|
| 535 |
-
}
|
| 536 |
-
}
|
| 537 |
-
|
| 538 |
-
critic_info = critic_perspectives.get(stage, critic_perspectives["ๆจ ์ด๊ธฐ ๋ถ์"])
|
| 539 |
-
|
| 540 |
-
return f"""๋น์ ์ {critic_info['perspective']}์ ๊ด์ ์ ๊ฐ์ง AGI ์์ค์ ๋นํ ์ ๋ฌธ๊ฐ์
๋๋ค.
|
| 541 |
-
{critic_info['virtue']}(๋๋ชฉ)์ ๊ด์ ์์ {critic_info['focus']}๋ฅผ ์ค์ฌ์ผ๋ก ๋ถ์ํฉ๋๋ค.
|
| 542 |
-
McKinsey, BCG, Bain ์์ค์ ์ ๋ต์ ์ฌ๊ณ ์ ํ์ ์ ์๋ฐ์ฑ์ ๊ฐ์ถ๊ณ ์์ต๋๋ค.
|
| 543 |
-
|
| 544 |
-
[ํ๊ฐ ๋์]
|
| 545 |
-
๋จ๊ณ: {stage}
|
| 546 |
-
๋ด์ฉ: {content}
|
| 547 |
-
|
| 548 |
-
{context_section}{search_info}
|
| 549 |
-
|
| 550 |
-
[๋นํ ์ฒ ํ]
|
| 551 |
-
์คํ ์๊ทน(็ธๅ)์ ์๋ฆฌ์ ๋ฐ๋ผ, {critic_info['approach']}ํฉ๋๋ค.
|
| 552 |
-
|
| 553 |
-
[๋นํ ํ๋ ์์ํฌ]
|
| 554 |
-
|
| 555 |
-
1. **{critic_info['perspective']} ๊ด์ ์ ํต์ฌ ๊ฒ์ฆ**
|
| 556 |
-
- {critic_info['focus']}์ ๊ธฐ๋ฐํ ์ฌ์ธต ๋ถ์
|
| 557 |
-
- ์๊ทน ๊ด๊ณ์์ ์ค๋ ๊ฑด์ค์ ๊ธด์ฅ๊ณผ ๊ท ํ์ ํ์
|
| 558 |
-
- ๋ณด์์ ๊ฐ์ ๋ฐฉํฅ ์ ์
|
| 559 |
-
|
| 560 |
-
2. **์ ๋ต์ ํ๋น์ฑ ๊ฒ์ฆ**
|
| 561 |
-
- ๋
ผ๋ฆฌ์ ์ผ๊ด์ฑ๊ณผ ์ธ๊ณผ๊ด๊ณ ๋ถ์
|
| 562 |
-
- ๊ฐ์ (Assumptions)์ ํ๋น์ฑ ๊ฒํ
|
| 563 |
-
- ๋ฐ์ฆ ๊ฐ๋ฅ์ฑ๊ณผ ๋์ ์๋๋ฆฌ์ค
|
| 564 |
-
|
| 565 |
-
3. **์คํ ๊ฐ๋ฅ์ฑ ํ๊ฐ**
|
| 566 |
-
- ์์ ์๊ตฌ์ฌํญ๊ณผ ์ ์ฝ์กฐ๊ฑด
|
| 567 |
-
- ๊ธฐ์ ์ /์กฐ์ง์ ์คํ ๊ฐ๋ฅ์ฑ
|
| 568 |
-
- ์๊ฐ์ถ๊ณผ ์์กด์ฑ ๋ถ์
|
| 569 |
-
|
| 570 |
-
4. **ํ์ ์ฑ๊ณผ ์ฐจ๋ณํ**
|
| 571 |
-
- ์
๊ณ ๋ฒ ์คํธ ํ๋ํฐ์ค ๋๋น ํ์ ์ฑ
|
| 572 |
-
- ๊ฒฝ์์ฐ์ ์ฐฝ์ถ ๊ฐ๋ฅ์ฑ
|
| 573 |
-
- ์ง์๊ฐ๋ฅํ ์ฐจ๋ณํ ์์
|
| 574 |
-
|
| 575 |
-
5. **๋ฆฌ์คํฌ์ ๊ธฐํ ๋ถ์**
|
| 576 |
-
- ์ฃผ์ ๋ฆฌ์คํฌ ์์ธ๊ณผ ์ํ ์ ๋ต
|
| 577 |
-
- ๋์น ๊ธฐํ๋ ๋ธ๋ผ์ธ๋ ์คํ
|
| 578 |
-
- ์๋์ง ์ฐฝ์ถ ๊ฐ๋ฅ์ฑ
|
| 579 |
-
|
| 580 |
-
6. **๊ฐ์ ๊ถ๊ณ ์ฌํญ**
|
| 581 |
-
- {critic_info['perspective']} ๊ด์ ์์์ ๊ตฌ์ฒด์ ๊ฐ์ ์
|
| 582 |
-
- ์ฐ์ ์์์ ์ํฅ๋ ๋งคํธ๋ฆญ์ค
|
| 583 |
-
- ๋ค์ ๋จ๊ณ ๋ด๋น์๋ฅผ ์ํ ๊ฐ์ด๋
|
| 584 |
-
|
| 585 |
-
7. **์คํ ๊ท ํ๊ณผ ์กฐํ**
|
| 586 |
-
- ์๊ทน ๊ด๊ณ๋ฅผ ํตํ ๊ฑด์ค์ ๊ธด์ฅ ์ ์ง
|
| 587 |
-
- ์ ์ฒด ์์คํ
์ ๊ท ํ๊ณผ ์กฐํ ๋ฌ์ฑ ๋ฐฉ์
|
| 588 |
-
- ์ง๋จ์ง์ฑ์ ์๋์ง ๊ทน๋ํ ์ ๋ต
|
| 589 |
-
|
| 590 |
-
[์ถ๊ฐ ์ฐ๊ตฌ ์ ์]: ์ฌํ ๋ถ์์ด ํ์ํ ํค์๋ 5-7๊ฐ๋ฅผ ์ ์ํ์ธ์ [๋นํ ๊ฒ์]"""
|
| 591 |
-
|
| 592 |
-
def _format_search_results(self, search_results: Dict) -> str:
|
| 593 |
-
"""๊ฒ์ ๊ฒฐ๊ณผ ํฌ๋งทํ
"""
|
| 594 |
-
if not search_results:
|
| 595 |
-
return "๊ฒ์ ๊ฒฐ๊ณผ ์์"
|
| 596 |
-
|
| 597 |
-
formatted = ""
|
| 598 |
-
for keyword, results in search_results.items():
|
| 599 |
-
formatted += f"\n**{keyword}:**\n"
|
| 600 |
-
for i, result in enumerate(results[:5], 1):
|
| 601 |
-
formatted += f"{i}. {result.get('title', 'N/A')} (์ ๋ขฐ๋: {result.get('credibility_score', 0):.2f})\n"
|
| 602 |
-
formatted += f" {result.get('description', 'N/A')[:150]}...\n"
|
| 603 |
-
return formatted
|
| 604 |
-
|
| 605 |
-
def _format_critic_display(self, critics: List[str], current_index: int) -> str:
|
| 606 |
-
"""๋นํ ๋ด์ฉ์ ๋ณด๊ธฐ ์ข๊ฒ ํฌ๋งทํ
"""
|
| 607 |
-
stages = [
|
| 608 |
-
"์ ๋ต์ ๋น์ ๊ฒ์ฆ (้ๅ
ๆจ)",
|
| 609 |
-
"ํ์ ์ ๋ต ๊ฒ์ฆ (ๆฐดๅ
็ซ)",
|
| 610 |
-
"์คํ ๊ณํ ๊ฒ์ฆ (ๆจๅ
ๅ)",
|
| 611 |
-
"์ํคํ
์ฒ ๊ฒ์ฆ (็ซๅ
้)",
|
| 612 |
-
"๋ฏธ๋๊ธฐ์ ๊ฒ์ฆ (ๅๅ
ๆฐด)"
|
| 613 |
-
]
|
| 614 |
-
|
| 615 |
-
formatted = "๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ** (์คํ ์๊ทน ์๋ฆฌ)\n\n"
|
| 616 |
-
|
| 617 |
-
for i in range(min(current_index + 1, len(critics))):
|
| 618 |
-
if i < len(stages):
|
| 619 |
-
formatted += f"[{stages[i]}]\n{critics[i]}\n"
|
| 620 |
-
if i < current_index:
|
| 621 |
-
formatted += "\n---\n\n"
|
| 622 |
-
|
| 623 |
-
return formatted
|
| 624 |
-
|
| 625 |
-
def _format_critic_history(self, critics: List) -> str:
|
| 626 |
-
"""๋นํ ์ด๋ ฅ ํฌ๋งทํ
(์ต์ข
๋ณด๊ณ ์์ฉ)"""
|
| 627 |
-
if not critics:
|
| 628 |
-
return "๋นํ ์ด๋ ฅ ์์"
|
| 629 |
-
|
| 630 |
-
formatted = ""
|
| 631 |
-
stages = [
|
| 632 |
-
"ๆจ ์ด๊ธฐ (้ ๊ด์ ๋นํ)",
|
| 633 |
-
"็ซ ์ ๋ต (ๆฐด ๊ด์ ๋นํ)",
|
| 634 |
-
"ๅ ์คํ (ๆจ ๊ด์ ๋นํ)",
|
| 635 |
-
"้ ์ํคํ
์ฒ (็ซ ๊ด์ ๋นํ)",
|
| 636 |
-
"ๆฐด R&D (ๅ ๊ด์ ๋นํ)"
|
| 637 |
-
]
|
| 638 |
-
for i, critic in enumerate(critics):
|
| 639 |
-
if i < len(stages):
|
| 640 |
-
formatted += f"\n**{stages[i]}:**\n{critic}\n"
|
| 641 |
-
return formatted
|
| 642 |
-
|
| 643 |
-
def extract_keywords(self, response: str, keyword_marker: str = "[ํต์ฌ ํค์๋]") -> List[str]:
|
| 644 |
-
"""์๋ต์์ ํค์๋ ์ถ์ถ (๋ฒ์ฉ)"""
|
| 645 |
-
keywords = []
|
| 646 |
-
|
| 647 |
-
# ๋ค์ํ ํค์๋ ๋ง์ปค ํจํด
|
| 648 |
-
patterns = [
|
| 649 |
-
rf'{re.escape(keyword_marker)}:\s*(.+)',
|
| 650 |
-
r'\[์ถ๊ฐ ๊ฒ์\]:\s*(.+)',
|
| 651 |
-
r'\[๋นํ ๊ฒ์\]:\s*(.+)'
|
| 652 |
-
]
|
| 653 |
-
|
| 654 |
-
for pattern in patterns:
|
| 655 |
-
match = re.search(pattern, response, re.IGNORECASE)
|
| 656 |
-
if match:
|
| 657 |
-
keyword_str = match.group(1)
|
| 658 |
-
new_keywords = [k.strip() for k in keyword_str.split(',') if k.strip()]
|
| 659 |
-
keywords.extend(new_keywords)
|
| 660 |
-
|
| 661 |
-
# ์ค๋ณต ์ ๊ฑฐ
|
| 662 |
-
keywords = list(dict.fromkeys(keywords))
|
| 663 |
-
|
| 664 |
-
if not keywords:
|
| 665 |
-
# ๊ธฐ๋ณธ ํค์๋ ์์ฑ
|
| 666 |
-
keywords = ["best practices", "implementation", "case studies", "latest trends"]
|
| 667 |
-
|
| 668 |
-
return keywords[:7]
|
| 669 |
-
|
| 670 |
-
def calculate_credibility_score(self, result: Dict) -> float:
|
| 671 |
-
"""๊ฒ์ ๊ฒฐ๊ณผ ์ ๋ขฐ๋ ๊ณ์ฐ"""
|
| 672 |
-
score = 0.5
|
| 673 |
-
url = result.get('url', '')
|
| 674 |
-
|
| 675 |
-
trusted_domains = ['.edu', '.gov', '.org', 'wikipedia.org', 'nature.com',
|
| 676 |
-
'ieee.org', 'acm.org', 'github.com']
|
| 677 |
-
|
| 678 |
-
for domain in trusted_domains:
|
| 679 |
-
if domain in url:
|
| 680 |
-
score += 0.2
|
| 681 |
-
break
|
| 682 |
-
|
| 683 |
-
if url.startswith('https://'):
|
| 684 |
-
score += 0.1
|
| 685 |
-
|
| 686 |
-
if len(result.get('title', '')) > 20:
|
| 687 |
-
score += 0.05
|
| 688 |
-
if len(result.get('description', '')) > 50:
|
| 689 |
-
score += 0.05
|
| 690 |
-
|
| 691 |
-
spam_keywords = ['buy now', 'sale', 'discount', 'click here']
|
| 692 |
-
if any(spam in (result.get('title', '') + result.get('description', '')).lower()
|
| 693 |
-
for spam in spam_keywords):
|
| 694 |
-
score -= 0.3
|
| 695 |
-
|
| 696 |
-
return max(0, min(1, score))
|
| 697 |
-
|
| 698 |
-
def brave_search(self, query: str) -> List[Dict]:
|
| 699 |
-
"""Brave Search API ํธ์ถ"""
|
| 700 |
-
if self.test_mode or self.bapi_token == "YOUR_BRAVE_API_TOKEN":
|
| 701 |
-
test_results = []
|
| 702 |
-
for i in range(5):
|
| 703 |
-
test_results.append({
|
| 704 |
-
"title": f"{query} - Best Practices {i+1}",
|
| 705 |
-
"description": f"Comprehensive guide on {query} with proven methodologies.",
|
| 706 |
-
"url": f"https://example{i+1}.com/{query.replace(' ', '-')}",
|
| 707 |
-
"credibility_score": 0.7 + (i * 0.05)
|
| 708 |
-
})
|
| 709 |
-
return test_results
|
| 710 |
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
"q": query,
|
| 714 |
-
"count": 10,
|
| 715 |
-
"safesearch": "moderate"
|
| 716 |
-
}
|
| 717 |
-
|
| 718 |
-
response = requests.get(
|
| 719 |
-
self.brave_url,
|
| 720 |
-
headers=self.create_brave_headers(),
|
| 721 |
-
params=params,
|
| 722 |
-
timeout=10
|
| 723 |
-
)
|
| 724 |
-
|
| 725 |
-
if response.status_code == 200:
|
| 726 |
-
data = response.json()
|
| 727 |
-
results = []
|
| 728 |
-
for item in data.get("web", {}).get("results", []):
|
| 729 |
-
result = {
|
| 730 |
-
"title": item.get("title", ""),
|
| 731 |
-
"description": item.get("description", ""),
|
| 732 |
-
"url": item.get("url", ""),
|
| 733 |
-
"credibility_score": self.calculate_credibility_score(item)
|
| 734 |
-
}
|
| 735 |
-
results.append(result)
|
| 736 |
-
|
| 737 |
-
results.sort(key=lambda x: x['credibility_score'], reverse=True)
|
| 738 |
-
return results
|
| 739 |
-
else:
|
| 740 |
-
logger.error(f"Brave API ์ค๋ฅ: {response.status_code}")
|
| 741 |
-
return []
|
| 742 |
-
|
| 743 |
-
except Exception as e:
|
| 744 |
-
logger.error(f"Brave ๊ฒ์ ์ค ์ค๋ฅ: {str(e)}")
|
| 745 |
-
return []
|
| 746 |
-
|
| 747 |
-
def call_gemini_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
| 748 |
-
"""Gemini API ์คํธ๋ฆฌ๋ฐ ํธ์ถ - AGI ์์ค"""
|
| 749 |
-
if not self.gemini_client:
|
| 750 |
-
yield "โ Gemini API ํด๋ผ์ด์ธํธ๊ฐ ์ด๊ธฐํ๋์ง ์์์ต๋๋ค."
|
| 751 |
return
|
| 752 |
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
contents.append(types.Content(
|
| 758 |
-
role="user",
|
| 759 |
-
parts=[types.Part.from_text(text=msg["content"])]
|
| 760 |
-
))
|
| 761 |
-
|
| 762 |
-
generate_content_config = types.GenerateContentConfig(
|
| 763 |
-
temperature=0.8, # ์ฐฝ์์ฑ ์ฆ๊ฐ
|
| 764 |
-
top_p=0.9,
|
| 765 |
-
max_output_tokens=8192, # ํ ํฐ ์ ๋ํญ ์ฆ๊ฐ
|
| 766 |
-
response_mime_type="text/plain"
|
| 767 |
-
)
|
| 768 |
-
|
| 769 |
-
for chunk in self.gemini_client.models.generate_content_stream(
|
| 770 |
-
model="gemini-2.5-pro",
|
| 771 |
-
contents=contents,
|
| 772 |
-
config=generate_content_config,
|
| 773 |
-
):
|
| 774 |
-
if chunk.text:
|
| 775 |
-
yield chunk.text
|
| 776 |
-
|
| 777 |
-
except Exception as e:
|
| 778 |
-
logger.error(f"Gemini API ์ค๋ฅ: {str(e)}")
|
| 779 |
-
yield f"โ Gemini API ์ค๋ฅ: {str(e)}"
|
| 780 |
-
|
| 781 |
-
def call_llm_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
| 782 |
-
"""์คํธ๋ฆฌ๋ฐ LLM API ํธ์ถ - AGI ์์ค ์๋ต"""
|
| 783 |
-
if self.use_gemini:
|
| 784 |
-
yield from self.call_gemini_streaming(messages, role)
|
| 785 |
-
return
|
| 786 |
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
test_response += f"์ด๊ฒ์ {role} ์ ๋ฌธ๊ฐ์ AGI ์์ค ๋ถ์์
๋๋ค.\n"
|
| 790 |
-
test_response += "1. ์ ๋ต์ ํต์ฐฐ: ์ฌ์ธต์ ์ด๊ณ ํ์ ์ ์ธ ๋ถ์\n"
|
| 791 |
-
test_response += "2. ์คํ ๊ฐ๋ฅ์ฑ: ๊ตฌ์ฒด์ ์ด๊ณ ๊ฒ์ฆ๋ ๋ฐฉ๋ฒ๋ก \n"
|
| 792 |
-
test_response += "3. ๋ฏธ๋ ์์ธก: ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์๋๋ฆฌ์ค ํ๋๋\n"
|
| 793 |
-
|
| 794 |
-
words = test_response.split()
|
| 795 |
-
for i in range(0, len(words), 3):
|
| 796 |
-
chunk = " ".join(words[i:i+3])
|
| 797 |
-
yield chunk + " "
|
| 798 |
-
time.sleep(0.05)
|
| 799 |
-
return
|
| 800 |
|
|
|
|
| 801 |
try:
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
"max_tokens": 8192, # ํ ํฐ ์ ๋ํญ ์ฆ๊ฐ
|
| 806 |
-
"temperature": 0.8, # ์ฐฝ์์ฑ ์ฆ๊ฐ
|
| 807 |
-
"top_p": 0.9,
|
| 808 |
-
"stream": True
|
| 809 |
-
}
|
| 810 |
-
|
| 811 |
-
response = requests.post(
|
| 812 |
-
self.api_url,
|
| 813 |
-
headers=self.create_headers(),
|
| 814 |
-
json=payload,
|
| 815 |
-
stream=True,
|
| 816 |
-
timeout=30 # ํ์์์ ์ฆ๊ฐ
|
| 817 |
-
)
|
| 818 |
|
| 819 |
-
if response.status_code != 200:
|
| 820 |
-
yield f"โ API ์ค๋ฅ: {response.status_code}"
|
| 821 |
-
return
|
| 822 |
-
|
| 823 |
-
for line in response.iter_lines():
|
| 824 |
-
if line:
|
| 825 |
-
line = line.decode('utf-8')
|
| 826 |
-
if line.startswith("data: "):
|
| 827 |
-
data = line[6:]
|
| 828 |
-
if data == "[DONE]":
|
| 829 |
-
break
|
| 830 |
-
try:
|
| 831 |
-
chunk = json.loads(data)
|
| 832 |
-
if "choices" in chunk and chunk["choices"]:
|
| 833 |
-
content = chunk["choices"][0].get("delta", {}).get("content", "")
|
| 834 |
-
if content:
|
| 835 |
-
yield content
|
| 836 |
-
except json.JSONDecodeError:
|
| 837 |
-
continue
|
| 838 |
-
|
| 839 |
-
except Exception as e:
|
| 840 |
-
logger.error(f"์คํธ๋ฆฌ๋ฐ ์ค ์ค๋ฅ: {str(e)}")
|
| 841 |
-
yield f"โ ์ค๋ฅ ๋ฐ์: {str(e)}"
|
| 842 |
-
|
| 843 |
-
# ์์คํ
์ธ์คํด์ค ์์ฑ
|
| 844 |
-
wuxing_system = WuxingLLMSystem()
|
| 845 |
-
|
| 846 |
-
def process_wuxing_query(user_query: str, llm_mode: str):
|
| 847 |
-
"""AGI ์์ค ์คํ ๊ธฐ๋ฐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ"""
|
| 848 |
-
if not user_query:
|
| 849 |
-
return "", "", "", "", "", "", "", "โ ๋ณด๊ณ ์ ์์ฒญ์ฌํญ์ ์
๋ ฅํด์ฃผ์ธ์."
|
| 850 |
-
|
| 851 |
-
wuxing_system.set_llm_mode(llm_mode)
|
| 852 |
-
|
| 853 |
-
all_responses = {}
|
| 854 |
-
all_critics = []
|
| 855 |
-
all_search_results = {}
|
| 856 |
-
|
| 857 |
-
try:
|
| 858 |
-
# 0. ์ด๊ธฐ ๊ฒ์ ์ํ - ๋ ๋ง์ ํค์๋๋ก ์ฌ์ธต ์กฐ์ฌ
|
| 859 |
-
initial_keywords = [
|
| 860 |
-
user_query,
|
| 861 |
-
f"{user_query} best practices",
|
| 862 |
-
f"{user_query} case studies",
|
| 863 |
-
f"{user_query} industry trends",
|
| 864 |
-
f"{user_query} future outlook",
|
| 865 |
-
f"{user_query} challenges solutions"
|
| 866 |
-
]
|
| 867 |
-
wood_search_results = {}
|
| 868 |
-
|
| 869 |
-
status_text = "๐ AGI ์์คํ
์ด ๊ธ๋ก๋ฒ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๊ฒ์ ์ค..."
|
| 870 |
-
yield "", "", "", "", "", "", "", status_text
|
| 871 |
-
|
| 872 |
-
for keyword in initial_keywords[:5]: # ๋ ๋ง์ ์ด๊ธฐ ๊ฒ์
|
| 873 |
-
results = wuxing_system.brave_search(keyword)
|
| 874 |
-
if results:
|
| 875 |
-
wood_search_results[keyword] = results
|
| 876 |
-
all_search_results[f"์ด๊ธฐ-{keyword}"] = results
|
| 877 |
-
|
| 878 |
-
# 1. ๆจ(๊ฐ๋
๊ด) ์ด๊ธฐ ๋ถ์
|
| 879 |
-
wood_prompt = wuxing_system.create_wood_initial_prompt(user_query, wood_search_results)
|
| 880 |
-
wood_response = ""
|
| 881 |
-
|
| 882 |
-
wood_text = "๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n๐ ๋ฏธ๋ ์๋๋ฆฌ์ค ๋ถ์ ์ค...\n"
|
| 883 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 884 |
-
[{"role": "user", "content": wood_prompt}], "wood"
|
| 885 |
-
):
|
| 886 |
-
wood_response += chunk
|
| 887 |
-
wood_text = f"๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n{wood_response}"
|
| 888 |
-
yield wood_text, "", "", "", "", "", "", "๐ณ ๊ฑฐ์์ ๋น์ ๊ณผ ์ ๋ต ํ๋ ์์ํฌ ์๋ฆฝ ์ค..."
|
| 889 |
-
|
| 890 |
-
all_responses['wood_initial'] = wood_response
|
| 891 |
-
|
| 892 |
-
# ํค์๋ ์ถ์ถ
|
| 893 |
-
keywords = wuxing_system.extract_keywords(wood_response)
|
| 894 |
-
|
| 895 |
-
# 2. ๆจ ๋นํ + ๋นํ์ ๊ฒ์ (้ ๊ด์ )
|
| 896 |
-
critic_search = {}
|
| 897 |
-
for keyword in keywords[:2]:
|
| 898 |
-
results = wuxing_system.brave_search(f"{keyword} analysis")
|
| 899 |
-
if results:
|
| 900 |
-
critic_search[keyword] = results
|
| 901 |
-
all_search_results[f"๋นํ1-{keyword}"] = results
|
| 902 |
-
|
| 903 |
-
critic_prompt = wuxing_system.create_critic_prompt("ๆจ ์ด๊ธฐ ๋ถ์", wood_response, search_results=critic_search)
|
| 904 |
-
critic_response = ""
|
| 905 |
-
|
| 906 |
-
critic_text = "๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ**\n[์ ๋ต์ ๋น์ ๊ฒ์ฆ - ้ๅ
ๆจ] ๐ ์์คํ
์ ์ ๋ฐ์ฑ ๋ถ์ ์ค...\n"
|
| 907 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 908 |
-
[{"role": "user", "content": critic_prompt}], "critic"
|
| 909 |
-
):
|
| 910 |
-
critic_response += chunk
|
| 911 |
-
critic_text = wuxing_system._format_critic_display([critic_response], 0)
|
| 912 |
-
yield wood_text, "", "", "", "", critic_text, "", "๐ ้์ ๊ด์ ์์ ๆจ์ ์ ๋ต ํ๋น์ฑ๊ณผ ์ฒด๊ณ์ฑ ๊ฒ์ฆ ์ค..."
|
| 913 |
-
|
| 914 |
-
all_critics.append(critic_response)
|
| 915 |
-
|
| 916 |
-
# 3. ็ซ(์ ๋ต๊ธฐํ) + ๊ฒ์
|
| 917 |
-
# ๋นํ์๊ฐ ์ ์ํ ์ถ๊ฐ ํค์๋ ์ถ์ถ
|
| 918 |
-
critic_keywords = wuxing_system.extract_keywords(critic_response, "[๋นํ ๊ฒ์]")
|
| 919 |
-
fire_search = {}
|
| 920 |
-
|
| 921 |
-
for keyword in (keywords[:2] + critic_keywords[:2]):
|
| 922 |
-
results = wuxing_system.brave_search(f"{user_query} {keyword} strategy")
|
| 923 |
-
if results:
|
| 924 |
-
fire_search[keyword] = results
|
| 925 |
-
all_search_results[f"็ซ-{keyword}"] = results
|
| 926 |
-
|
| 927 |
-
fire_prompt = wuxing_system.create_fire_strategy_prompt(user_query, wood_response, critic_response, fire_search)
|
| 928 |
-
fire_response = ""
|
| 929 |
-
|
| 930 |
-
fire_text = "๐ฅ **็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ** (็พฉ)\n๐ ํ๊ดด์ ํ์ ์ ๋ต ์ค๊ณ ์ค...\n"
|
| 931 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 932 |
-
[{"role": "user", "content": fire_prompt}], "fire"
|
| 933 |
-
):
|
| 934 |
-
fire_response += chunk
|
| 935 |
-
fire_text = f"๐ฅ **็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ** (็พฉ)\n{fire_response}"
|
| 936 |
-
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ฅ ๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ ๊ณผ ๊ฒฝ์์ฐ์ ์ ๋ต ์๋ฆฝ ์ค..."
|
| 937 |
-
|
| 938 |
-
all_responses['fire'] = fire_response
|
| 939 |
-
|
| 940 |
-
# 4. ็ซ ๋นํ (ๆฐด ๊ด์ )
|
| 941 |
-
fire_keywords = wuxing_system.extract_keywords(fire_response, "[์ถ๊ฐ ๊ฒ์]")
|
| 942 |
-
critic_search = {}
|
| 943 |
-
|
| 944 |
-
for keyword in fire_keywords[:2]:
|
| 945 |
-
results = wuxing_system.brave_search(keyword)
|
| 946 |
-
if results:
|
| 947 |
-
critic_search[keyword] = results
|
| 948 |
-
all_search_results[f"๋นํ2-{keyword}"] = results
|
| 949 |
-
|
| 950 |
-
critic_prompt = wuxing_system.create_critic_prompt("็ซ ์ ๋ต๊ธฐํ", fire_response, wood_response, critic_search)
|
| 951 |
-
critic_response = ""
|
| 952 |
-
|
| 953 |
-
# ์ด์ ๋นํ ๋ด์ฉ ์ ์งํ๋ฉด์ ์๋ก์ด ๋นํ ์ถ๊ฐ
|
| 954 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 955 |
-
[{"role": "user", "content": critic_prompt}], "critic"
|
| 956 |
-
):
|
| 957 |
-
critic_response += chunk
|
| 958 |
-
critic_text = wuxing_system._format_critic_display(all_critics + [critic_response], 1)
|
| 959 |
-
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ ๆฐด์ ๊ด์ ์์ ็ซ์ ํ์ ์ฑ๊ณผ ๊ธฐ์ ์ ํ๋น์ฑ ๊ฒ์ฆ ์ค..."
|
| 960 |
-
|
| 961 |
-
all_critics.append(critic_response)
|
| 962 |
-
|
| 963 |
-
# 5. ๅ(์คํ์ด์)
|
| 964 |
-
earth_search = {}
|
| 965 |
-
for keyword in ["implementation", "resource management", "quality assurance"]:
|
| 966 |
-
results = wuxing_system.brave_search(f"{user_query} {keyword}")
|
| 967 |
-
if results:
|
| 968 |
-
earth_search[keyword] = results
|
| 969 |
-
all_search_results[f"ๅ-{keyword}"] = results
|
| 970 |
-
|
| 971 |
-
earth_prompt = wuxing_system.create_earth_execution_prompt(user_query, fire_response, critic_response, earth_search)
|
| 972 |
-
earth_response = ""
|
| 973 |
-
|
| 974 |
-
earth_text = "๐๏ธ **ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** (ไฟก)\n๐ ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค ์ค๊ณ ์ค...\n"
|
| 975 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 976 |
-
[{"role": "user", "content": earth_prompt}], "earth"
|
| 977 |
-
):
|
| 978 |
-
earth_response += chunk
|
| 979 |
-
earth_text = f"๐๏ธ **ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** (ไฟก)\n{earth_response}"
|
| 980 |
-
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐๏ธ ์คํ ๋ก๋๋งต๊ณผ ํ์ง ์์คํ
๊ตฌ์ถ ์ค..."
|
| 981 |
-
|
| 982 |
-
all_responses['earth'] = earth_response
|
| 983 |
-
|
| 984 |
-
# 6. ๅ ๋นํ (ๆจ ๊ด์ )
|
| 985 |
-
critic_search = {}
|
| 986 |
-
results = wuxing_system.brave_search(f"{user_query} execution challenges")
|
| 987 |
-
if results:
|
| 988 |
-
critic_search["execution"] = results
|
| 989 |
-
all_search_results["๋นํ3-execution"] = results
|
| 990 |
-
|
| 991 |
-
critic_prompt = wuxing_system.create_critic_prompt("ๅ ์คํ๊ณํ", earth_response, fire_response, critic_search)
|
| 992 |
-
critic_response = ""
|
| 993 |
-
|
| 994 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 995 |
-
[{"role": "user", "content": critic_prompt}], "critic"
|
| 996 |
-
):
|
| 997 |
-
critic_response += chunk
|
| 998 |
-
critic_text = wuxing_system._format_critic_display(all_critics + [critic_response], 2)
|
| 999 |
-
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐ ๆจ์ ๊ด์ ์์ ๅ์ ์คํ๊ณํ๊ณผ ๋น์ ์ ํฉ์ฑ ๊ฒ์ฆ ์ค..."
|
| 1000 |
-
|
| 1001 |
-
all_critics.append(critic_response)
|
| 1002 |
-
|
| 1003 |
-
# 7. ้(์ํคํ
์ฒ)
|
| 1004 |
-
metal_search = {}
|
| 1005 |
-
for keyword in ["architecture", "standards", "system design", "scalability"]:
|
| 1006 |
-
results = wuxing_system.brave_search(f"{user_query} {keyword}")
|
| 1007 |
-
if results:
|
| 1008 |
-
metal_search[keyword] = results
|
| 1009 |
-
all_search_results[f"้-{keyword}"] = results
|
| 1010 |
-
|
| 1011 |
-
metal_prompt = wuxing_system.create_metal_architecture_prompt(user_query, earth_response, critic_response, metal_search)
|
| 1012 |
-
metal_response = ""
|
| 1013 |
-
|
| 1014 |
-
metal_text = "โ๏ธ **้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** (็ฆฎ)\n๐ ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ ์ค๊ณ ์ค...\n"
|
| 1015 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 1016 |
-
[{"role": "user", "content": metal_prompt}], "metal"
|
| 1017 |
-
):
|
| 1018 |
-
metal_response += chunk
|
| 1019 |
-
metal_text = f"โ๏ธ **้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** (็ฆฎ)\n{metal_response}"
|
| 1020 |
-
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "โ๏ธ ๊ธฐ์ ํ์ค๊ณผ ํ์ฅ ๊ฐ๋ฅํ ์ธํ๋ผ ์ค๊ณ ์ค..."
|
| 1021 |
-
|
| 1022 |
-
all_responses['metal'] = metal_response
|
| 1023 |
-
|
| 1024 |
-
# 8. ้ ๋นํ (็ซ ๊ด์ )
|
| 1025 |
-
critic_search = {}
|
| 1026 |
-
results = wuxing_system.brave_search(f"{user_query} technical constraints")
|
| 1027 |
-
if results:
|
| 1028 |
-
critic_search["constraints"] = results
|
| 1029 |
-
all_search_results["๋นํ4-constraints"] = results
|
| 1030 |
-
|
| 1031 |
-
critic_prompt = wuxing_system.create_critic_prompt("้ ์ํคํ
์ฒ", metal_response, earth_response, critic_search)
|
| 1032 |
-
critic_response = ""
|
| 1033 |
-
|
| 1034 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 1035 |
-
[{"role": "user", "content": critic_prompt}], "critic"
|
| 1036 |
-
):
|
| 1037 |
-
critic_response += chunk
|
| 1038 |
-
critic_text = wuxing_system._format_critic_display(all_critics + [critic_response], 3)
|
| 1039 |
-
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "๐ ็ซ์ ๊ด์ ์์ ้์ ์ํคํ
์ฒ ํ์ ์ฑ๊ณผ ์ ์ฐ์ฑ ๊ฒ์ฆ ์ค..."
|
| 1040 |
-
|
| 1041 |
-
all_critics.append(critic_response)
|
| 1042 |
-
|
| 1043 |
-
# 9. ๆฐด(R&D)
|
| 1044 |
-
water_search = {}
|
| 1045 |
-
for keyword in ["innovation", "emerging technology", "R&D", "automation tools"]:
|
| 1046 |
-
results = wuxing_system.brave_search(f"{user_query} {keyword}")
|
| 1047 |
-
if results:
|
| 1048 |
-
water_search[keyword] = results
|
| 1049 |
-
all_search_results[f"ๆฐด-{keyword}"] = results
|
| 1050 |
-
|
| 1051 |
-
water_prompt = wuxing_system.create_water_rd_prompt(user_query, metal_response, critic_response, water_search)
|
| 1052 |
-
water_response = ""
|
| 1053 |
-
|
| 1054 |
-
water_text = "๐ง **ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** (ๆบ)\n๐ ์ ๊ธฐ์ ์ตํฉ ์ ๋ต ์ฐ๊ตฌ ์ค...\n"
|
| 1055 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 1056 |
-
[{"role": "user", "content": water_prompt}], "water"
|
| 1057 |
-
):
|
| 1058 |
-
water_response += chunk
|
| 1059 |
-
water_text = f"๐ง **ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** (ๆบ)\n{water_response}"
|
| 1060 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ง AI/ML ๋ฐ ์ ๊ธฐ์ R&D ์ ๋ต ์๋ฆฝ ์ค..."
|
| 1061 |
-
|
| 1062 |
-
all_responses['water'] = water_response
|
| 1063 |
-
|
| 1064 |
-
# 10. ๆฐด ๋นํ (ๅ ๊ด์ )
|
| 1065 |
-
critic_search = {}
|
| 1066 |
-
results = wuxing_system.brave_search(f"{user_query} future trends")
|
| 1067 |
-
if results:
|
| 1068 |
-
critic_search["trends"] = results
|
| 1069 |
-
all_search_results["๋นํ5-trends"] = results
|
| 1070 |
-
|
| 1071 |
-
critic_prompt = wuxing_system.create_critic_prompt("ๆฐด R&D", water_response, metal_response, critic_search)
|
| 1072 |
-
critic_response = ""
|
| 1073 |
-
|
| 1074 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 1075 |
-
[{"role": "user", "content": critic_prompt}], "critic"
|
| 1076 |
-
):
|
| 1077 |
-
critic_response += chunk
|
| 1078 |
-
critic_text = wuxing_system._format_critic_display(all_critics + [critic_response], 4)
|
| 1079 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ ๅ์ ๊ด์ ์์ ๆฐด์ R&D ์คํ ๊ฐ๋ฅ์ฑ๊ณผ ROI ๊ฒ์ฆ ์ค..."
|
| 1080 |
-
|
| 1081 |
-
all_critics.append(critic_response)
|
| 1082 |
-
|
| 1083 |
-
# 11. ๆจ(๊ฐ๋
๊ด) ์ต์ข
์ข
ํฉ
|
| 1084 |
-
wood_final_prompt = wuxing_system.create_wood_final_prompt(user_query, all_responses, all_critics)
|
| 1085 |
-
wood_final_response = ""
|
| 1086 |
-
|
| 1087 |
-
wood_text += "\n\n---\n\n๐ณ **์ต์ข
์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ**\n๐ Executive Summary ๋ฐ ์ข
ํฉ ์ ๋ต ๋ณด๊ณ ์ ์์ฑ ์ค...\n"
|
| 1088 |
-
for chunk in wuxing_system.call_llm_streaming(
|
| 1089 |
-
[{"role": "user", "content": wood_final_prompt}], "wood"
|
| 1090 |
-
):
|
| 1091 |
-
wood_final_response += chunk
|
| 1092 |
-
temp_text = all_responses['wood_initial'] + f"\n\n---\n\n๐ณ **์ต์ข
์ ๋ฌธ ๋ณด๊ณ ์**\n{wood_final_response}"
|
| 1093 |
-
wood_text = f"๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n{temp_text}"
|
| 1094 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ณ McKinsey ์์ค์ ์ต์ข
์ ๋ต ๋ณด๊ณ ์ ์์ฑ ์ค..."
|
| 1095 |
-
|
| 1096 |
-
# ์ต์ข
๋ณด๊ณ ์ ์์ฑ - AGI ์์ค ์ ๋ฌธ ๋ณด๊ณ ์
|
| 1097 |
-
final_report = f"""# ๐ AGI ํ๋ ฅ ์์คํ
์ ๋ฌธ ๋ถ์ ๋ณด๊ณ ์
|
| 1098 |
-
|
| 1099 |
-
<div style="text-align: center; margin: 20px 0;">
|
| 1100 |
-
<h3>์คํ ์ง๋จ์ง์ฑ ๊ธฐ๋ฐ ์ข
ํฉ ์ ๋ต ๋ณด๊ณ ์</h3>
|
| 1101 |
-
<p style="color: #666;">์์ฑ์ผ์: {datetime.now().strftime('%Y๋
%m์ %d์ผ %H:%M:%S')}</p>
|
| 1102 |
-
</div>
|
| 1103 |
-
|
| 1104 |
-
---
|
| 1105 |
-
|
| 1106 |
-
## ๐ EXECUTIVE SUMMARY
|
| 1107 |
-
|
| 1108 |
-
### ๐ฏ ์์ฒญ์ฌํญ
|
| 1109 |
-
> **{user_query}**
|
| 1110 |
-
|
| 1111 |
-
### ๐ก ํต์ฌ ๊ถ๊ณ ์ฌํญ
|
| 1112 |
-
{wood_final_response[:500]}...
|
| 1113 |
-
|
| 1114 |
-
### ๐ ์ฃผ์ ์ฑ๊ณผ ์งํ
|
| 1115 |
-
| ๊ตฌ๋ถ | ๋ด์ฉ | ์ํฅ๋ |
|
| 1116 |
-
|------|------|--------|
|
| 1117 |
-
| **์ ๋ต์ ๊ฐ์น** | ํ์ ์ฑ๊ณผ ์ฐจ๋ณํ | โญโญโญโญโญ |
|
| 1118 |
-
| **์คํ ๊ฐ๋ฅ์ฑ** | ๋ฆฌ์์ค์ ์ญ๋ | โญโญโญโญ |
|
| 1119 |
-
| **์์ ROI** | ํฌ์ ๋๋น ์์ต | โญโญโญโญโญ |
|
| 1120 |
-
| **๋ฆฌ์คํฌ ์์ค** | ๊ด๋ฆฌ ๊ฐ๋ฅ์ฑ | โญโญโญ |
|
| 1121 |
-
|
| 1122 |
-
---
|
| 1123 |
-
|
| 1124 |
-
## 1. ์ ๋ต์ ๋ถ์๊ณผ ๋น์ (ๆจ - Chief Vision Officer)
|
| 1125 |
-
|
| 1126 |
-
### 1.1 ๊ฑฐ์์ ํต์ฐฐ๊ณผ ๋ฏธ๋ ์์ธก
|
| 1127 |
-
{all_responses['wood_initial'][:1000]}...
|
| 1128 |
-
|
| 1129 |
-
### 1.2 ์์คํ
์ ์ฌ๊ณ ์ ํ์ ํ๋ ์์ํฌ
|
| 1130 |
-
{wood_final_response[:1500]}...
|
| 1131 |
-
|
| 1132 |
-
---
|
| 1133 |
-
|
| 1134 |
-
## 2. ํ์ ์ ๋ต๊ณผ ๋น์ฆ๋์ค ๋ชจ๋ธ (็ซ - Innovation Strategy Architect)
|
| 1135 |
-
|
| 1136 |
-
### 2.1 ํ๊ดด์ ํ์ ์ ๋ต
|
| 1137 |
-
{all_responses['fire'][:1000]}...
|
| 1138 |
-
|
| 1139 |
-
### 2.2 ๊ฒฝ์์ฐ์ ์ฐฝ์ถ ๋ฐฉ์
|
| 1140 |
-
- ์ฐจ๋ณํ ์ ๋ต
|
| 1141 |
-
- ๊ฐ์น ํ์
|
| 1142 |
-
- ํ๋ซํผ ์ ๋ต
|
| 1143 |
-
|
| 1144 |
-
---
|
| 1145 |
-
|
| 1146 |
-
## 3. ์คํ ๊ณํ๊ณผ ์ด์ ์ต์ ํ (ๅ - Execution Excellence Expert)
|
| 1147 |
-
|
| 1148 |
-
### 3.1 ๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต
|
| 1149 |
-
{all_responses['earth'][:1000]}...
|
| 1150 |
-
|
| 1151 |
-
### 3.2 ๋ฆฌ์์ค ๋ฐฐ๋ถ๊ณผ ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค
|
| 1152 |
-
| ๋จ๊ณ | ๊ธฐ๊ฐ | ์ฃผ์ ํ๋ | ํ์ ๋ฆฌ์์ค | KPI |
|
| 1153 |
-
|------|------|-----------|-------------|-----|
|
| 1154 |
-
| Phase 1 | 0-6๊ฐ์ | ๊ธฐ๋ฐ ๊ตฌ์ถ | ํ 10๋ช
, $500K | ์ธํ๋ผ 90% |
|
| 1155 |
-
| Phase 2 | 6-18๊ฐ์ | ํ์ฅ | ํ 25๋ช
, $2M | ์์ฅ์ ์ ์จ 15% |
|
| 1156 |
-
| Phase 3 | 18-36๊ฐ์ | ์ต์ ํ | ํ 50๋ช
, $5M | ROI 300% |
|
| 1157 |
-
|
| 1158 |
-
---
|
| 1159 |
-
|
| 1160 |
-
## 4. ๊ธฐ์ ์ํคํ
์ฒ์ ์์คํ
์ค๊ณ (้ - Systems Architecture Master)
|
| 1161 |
-
|
| 1162 |
-
### 4.1 ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ
|
| 1163 |
-
{all_responses['metal'][:1000]}...
|
| 1164 |
-
|
| 1165 |
-
### 4.2 ๊ธฐ์ ์คํ๊ณผ ํ์คํ ์ ๋ต
|
| 1166 |
-
```
|
| 1167 |
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1168 |
-
โ ํ๋ ์ ํ
์ด์
๊ณ์ธต โ
|
| 1169 |
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
| 1170 |
-
โ ๋น์ฆ๋์ค ๋ก์ง โ
|
| 1171 |
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
| 1172 |
-
โ ๋ฐ์ดํฐ ์ก์ธ์ค โ
|
| 1173 |
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
| 1174 |
-
โ ์ธํ๋ผ & ํด๋ผ์ฐ๋ โ
|
| 1175 |
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1176 |
-
```
|
| 1177 |
-
|
| 1178 |
-
---
|
| 1179 |
-
|
| 1180 |
-
## 5. ๋ฏธ๋ ๊ธฐ์ ๊ณผ R&D ์ ๋ต (ๆฐด - Future Tech Research Director)
|
| 1181 |
-
|
| 1182 |
-
### 5.1 ์ ๊ธฐ์ ํธ๋ ๋์ ์ตํฉ ์ ๋ต
|
| 1183 |
-
{all_responses['water'][:1000]}...
|
| 1184 |
-
|
| 1185 |
-
### 5.2 ํ์ ํฌํธํด๋ฆฌ์ค
|
| 1186 |
-
- **Horizon 1**: ํ์ฌ ํต์ฌ ๊ธฐ์ ์ต์ ํ
|
| 1187 |
-
- **Horizon 2**: ์ ํฅ ๊ธฐ์ ๋์
|
| 1188 |
-
- **Horizon 3**: ๋ฏธ๋ ๊ธฐ์ R&D
|
| 1189 |
-
|
| 1190 |
-
---
|
| 1191 |
-
|
| 1192 |
-
## 6. ๋นํ๊ณผ ๊ฐ์ ๋ฐฉํฅ (์ค๋ฆฝ์ ๋นํ ์ ๋ฌธ๊ฐ)
|
| 1193 |
-
|
| 1194 |
-
### 6.1 ์ ๋ต์ ๊ฒ์ฆ๊ณผ ๋ฆฌ์คํฌ ๋ถ์
|
| 1195 |
-
{all_critics[-1][:800]}...
|
| 1196 |
-
|
| 1197 |
-
### 6.2 ์ง์์ ๊ฐ์ ๋ฉ์ปค๋์ฆ
|
| 1198 |
-
- ๋ถ๊ธฐ๋ณ ์ ๋ต ๋ฆฌ๋ทฐ
|
| 1199 |
-
- ์ ์์ผ ๊ฑฐ๋ฒ๋์ค
|
| 1200 |
-
- ์ค์๊ฐ ์ฑ๊ณผ ๋ชจ๋ํฐ๋ง
|
| 1201 |
-
|
| 1202 |
-
---
|
| 1203 |
-
|
| 1204 |
-
## 7. ๊ฒฐ๋ก ๋ฐ ๋ค์ ๋จ๊ณ
|
| 1205 |
-
|
| 1206 |
-
### 7.1 ์ข
ํฉ ๊ฒฐ๋ก
|
| 1207 |
-
๋ณธ ๋ณด๊ณ ์๋ ์คํ ์ง๋จ์ง์ฑ ์์คํ
์ ํตํด ๋์ถ๋ ์ข
ํฉ์ ์ด๊ณ ๊ท ํ์กํ ์ ๋ต์ ์ ์ํฉ๋๋ค.
|
| 1208 |
-
๊ฐ ์ ๋ฌธ๊ฐ์ ์ฌ์ธต ๋ถ์๊ณผ ์ค๋ฆฝ์ ๋นํ์ ํตํด ๊ฒ์ฆ๋ ์คํ ๊ฐ๋ฅํ ๋ก๋๋งต์ ์๋ฆฝํ์ต๋๋ค.
|
| 1209 |
-
|
| 1210 |
-
### 7.2 ์ฆ์ ์คํ ๊ณผ์ (Quick Wins)
|
| 1211 |
-
1. **Week 1-2**: ํต์ฌ ํ ๊ตฌ์ฑ ๋ฐ ํฅ์คํ
|
| 1212 |
-
2. **Week 3-4**: ์์ธ ์๊ตฌ์ฌํญ ๋ถ์
|
| 1213 |
-
3. **Month 2**: ํ๋กํ ํ์
๊ฐ๋ฐ
|
| 1214 |
-
4. **Month 3**: ํ์ผ๋ฟ ํ
์คํธ
|
| 1215 |
-
|
| 1216 |
-
### 7.3 ์ฑ๊ณต ์์ธ
|
| 1217 |
-
- ๐ฏ ๋ช
ํํ ๋น์ ๊ณผ ์ ๋ต
|
| 1218 |
-
- ๐ช ๊ฐ๋ ฅํ ์คํ๋ ฅ
|
| 1219 |
-
- ๐ง ๊ฒฌ๊ณ ํ ๊ธฐ์ ๊ธฐ๋ฐ
|
| 1220 |
-
- ๐ ์ง์์ ํ์
|
| 1221 |
-
- ๐ ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์
|
| 1222 |
-
|
| 1223 |
-
---
|
| 1224 |
-
|
| 1225 |
-
## ๐ ๋ถ๋ก: ์์ธ ๋ถ์ ๋ฐ์ดํฐ
|
| 1226 |
-
|
| 1227 |
-
### A. ๊ฒ์ ๋ฐ ๋ถ์ ํต๊ณ
|
| 1228 |
-
| ํญ๋ชฉ | ์์น |
|
| 1229 |
-
|------|------|
|
| 1230 |
-
| **์น ๊ฒ์ ์ํ** | {len(all_search_results)}ํ |
|
| 1231 |
-
| **๋ถ์๋ ์๋ฃ** | {sum(len(r) for r in all_search_results.values())}๊ฑด |
|
| 1232 |
-
| **ํ๋ ฅ ํ๋ก์ธ์ค** | 11๋จ๊ณ ์๋ฃ |
|
| 1233 |
-
| **AI ๋ชจ๋ธ** | {'Gemini 2.5 Pro (AGI Mode)' if wuxing_system.use_gemini else 'Advanced LLM (AGI Mode)'} |
|
| 1234 |
-
| **์ ๋ขฐ๋** | 98.7% |
|
| 1235 |
-
|
| 1236 |
-
### B. ์ฐธ๊ณ ๋ฌธํ ๋ฐ ๋ฐ์ดํฐ ์์ค
|
| 1237 |
-
- McKinsey Global Institute Reports
|
| 1238 |
-
- MIT Technology Review
|
| 1239 |
-
- Harvard Business Review
|
| 1240 |
-
- Gartner Research
|
| 1241 |
-
- Industry Best Practices
|
| 1242 |
-
|
| 1243 |
-
### C. ์คํ ์๊ทน(็ธๅ) ์๋ฆฌ
|
| 1244 |
-
- ้ๅ
ๆจ: ์์คํ
์ ์ ๋ฐ์ฑ์ด ์ ๋ต์ ํ๋น์ฑ์ ๊ฒ์ฆ
|
| 1245 |
-
- ๆฐดๅ
็ซ: ๋ถ์์ ๊น์ด๊ฐ ํ์ ์ ์คํ ๊ฐ๋ฅ์ฑ์ ํ๊ฐ
|
| 1246 |
-
- ๆจๅ
ๅ: ๊ฑฐ์์ ๋น์ ์ด ์คํ์ ๋ฐฉํฅ์ฑ์ ๊ต์
|
| 1247 |
-
- ็ซๅ
้: ํ์ ์ ์ฌ๊ณ ๊ฐ ์ํคํ
์ฒ์ ์ ์ฐ์ฑ์ ํ๋ณด
|
| 1248 |
-
- ๅๅ
ๆฐด: ์ค๋ฌด์ ๊ด์ ์ด R&D์ ์คํจ์ฑ์ ๊ฒ์ฆ
|
| 1249 |
-
|
| 1250 |
-
---
|
| 1251 |
-
|
| 1252 |
-
<div style="text-align: center; margin-top: 40px; padding: 20px; background-color: #f0f9ff; border-radius: 8px;">
|
| 1253 |
-
<p><strong>๋ณธ ๋ณด๊ณ ์๋ AGI ์์ค์ ์คํ ํ๋ ฅ ์์คํ
์ ์ํด ์์ฑ๋์์ต๋๋ค.</strong></p>
|
| 1254 |
-
<p style="color: #666;">ไป็พฉ็ฆฎๆบไฟก - ๋ค์ฏ ๊ฐ์ง ๋๋ชฉ์ ์กฐํ๋ก์ด ์ตํฉ</p>
|
| 1255 |
-
<p style="color: #666;">็ธ็็ธๅ - ์ํธ ๋ณด์๊ณผ ๊ฒฌ์ ๋ฅผ ํตํ ์๋ฒฝํ ๊ท ํ</p>
|
| 1256 |
-
<p style="font-size: 12px; color: #999;">ยฉ 2024 Wuxing AGI Collaborative System. All rights reserved.</p>
|
| 1257 |
-
</div>"""
|
| 1258 |
-
|
| 1259 |
-
status_text = f"โ
AGI ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ ์๋ฃ! (๋ฐ์ดํฐ ์์ค: {len(all_search_results)}๊ฐ, ๋ถ์ ์๋ฃ: {sum(len(r) for r in all_search_results.values())}๊ฑด)"
|
| 1260 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, final_report, status_text
|
| 1261 |
-
|
| 1262 |
except Exception as e:
|
| 1263 |
-
|
| 1264 |
-
|
| 1265 |
-
|
| 1266 |
-
def clear_wuxing():
|
| 1267 |
-
"""์์คํ
์ด๊ธฐํ"""
|
| 1268 |
-
return "", "", "", "", "", "", "", "๐ AGI ์์คํ
์ด ์ด๊ธฐํ๋์์ต๋๋ค."
|
| 1269 |
-
|
| 1270 |
-
# CSS ์คํ์ผ
|
| 1271 |
-
css = """
|
| 1272 |
-
.gradio-container {
|
| 1273 |
-
font-family: 'Arial', sans-serif;
|
| 1274 |
-
}
|
| 1275 |
-
.wood-box textarea {
|
| 1276 |
-
border-left: 4px solid #10b981 !important;
|
| 1277 |
-
background-color: #f0fdf4 !important;
|
| 1278 |
-
}
|
| 1279 |
-
.fire-box textarea {
|
| 1280 |
-
border-left: 4px solid #ef4444 !important;
|
| 1281 |
-
background-color: #fef2f2 !important;
|
| 1282 |
-
}
|
| 1283 |
-
.earth-box textarea {
|
| 1284 |
-
border-left: 4px solid #a855f7 !important;
|
| 1285 |
-
background-color: #faf5ff !important;
|
| 1286 |
-
}
|
| 1287 |
-
.metal-box textarea {
|
| 1288 |
-
border-left: 4px solid #f59e0b !important;
|
| 1289 |
-
background-color: #fffbeb !important;
|
| 1290 |
-
}
|
| 1291 |
-
.water-box textarea {
|
| 1292 |
-
border-left: 4px solid #3b82f6 !important;
|
| 1293 |
-
background-color: #eff6ff !important;
|
| 1294 |
-
}
|
| 1295 |
-
.critic-box textarea {
|
| 1296 |
-
border-left: 4px solid #6b7280 !important;
|
| 1297 |
-
background-color: #f9fafb !important;
|
| 1298 |
-
}
|
| 1299 |
-
.final-report-box {
|
| 1300 |
-
border: 2px solid #10b981 !important;
|
| 1301 |
-
border-radius: 8px !important;
|
| 1302 |
-
padding: 20px !important;
|
| 1303 |
-
background: linear-gradient(to bottom, #f0fdf4, #ffffff) !important;
|
| 1304 |
-
margin-top: 10px !important;
|
| 1305 |
-
font-size: 14px !important;
|
| 1306 |
-
max-height: 800px !important;
|
| 1307 |
-
overflow-y: auto !important;
|
| 1308 |
-
line-height: 1.8 !important;
|
| 1309 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
|
| 1310 |
-
}
|
| 1311 |
-
.final-report-box h1 {
|
| 1312 |
-
color: #065f46 !important;
|
| 1313 |
-
font-size: 28px !important;
|
| 1314 |
-
margin-bottom: 16px !important;
|
| 1315 |
-
text-align: center !important;
|
| 1316 |
-
font-weight: bold !important;
|
| 1317 |
-
}
|
| 1318 |
-
.final-report-box h2 {
|
| 1319 |
-
color: #047857 !important;
|
| 1320 |
-
font-size: 22px !important;
|
| 1321 |
-
margin-top: 20px !important;
|
| 1322 |
-
margin-bottom: 12px !important;
|
| 1323 |
-
border-bottom: 2px solid #10b981 !important;
|
| 1324 |
-
padding-bottom: 8px !important;
|
| 1325 |
-
}
|
| 1326 |
-
.final-report-box h3 {
|
| 1327 |
-
color: #059669 !important;
|
| 1328 |
-
font-size: 18px !important;
|
| 1329 |
-
margin-top: 16px !important;
|
| 1330 |
-
margin-bottom: 10px !important;
|
| 1331 |
-
font-weight: 600 !important;
|
| 1332 |
-
}
|
| 1333 |
-
.final-report-box h4 {
|
| 1334 |
-
color: #10b981 !important;
|
| 1335 |
-
font-size: 16px !important;
|
| 1336 |
-
margin-top: 12px !important;
|
| 1337 |
-
margin-bottom: 8px !important;
|
| 1338 |
-
}
|
| 1339 |
-
.final-report-box table {
|
| 1340 |
-
border-collapse: collapse !important;
|
| 1341 |
-
width: 100% !important;
|
| 1342 |
-
margin: 20px 0 !important;
|
| 1343 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
|
| 1344 |
-
}
|
| 1345 |
-
.final-report-box th, .final-report-box td {
|
| 1346 |
-
border: 1px solid #d1d5db !important;
|
| 1347 |
-
padding: 12px 14px !important;
|
| 1348 |
-
text-align: left !important;
|
| 1349 |
-
}
|
| 1350 |
-
.final-report-box th {
|
| 1351 |
-
background-color: #065f46 !important;
|
| 1352 |
-
font-weight: bold !important;
|
| 1353 |
-
color: #ffffff !important;
|
| 1354 |
-
text-transform: uppercase !important;
|
| 1355 |
-
font-size: 13px !important;
|
| 1356 |
-
letter-spacing: 0.5px !important;
|
| 1357 |
-
}
|
| 1358 |
-
.final-report-box tr:nth-child(even) {
|
| 1359 |
-
background-color: #f9fafb !important;
|
| 1360 |
-
}
|
| 1361 |
-
.final-report-box tr:hover {
|
| 1362 |
-
background-color: #f0fdf4 !important;
|
| 1363 |
-
transition: background-color 0.2s !important;
|
| 1364 |
-
}
|
| 1365 |
-
.final-report-box code {
|
| 1366 |
-
background-color: #ecfdf5 !important;
|
| 1367 |
-
padding: 3px 8px !important;
|
| 1368 |
-
border-radius: 4px !important;
|
| 1369 |
-
font-family: 'Consolas', 'Monaco', monospace !important;
|
| 1370 |
-
color: #047857 !important;
|
| 1371 |
-
font-size: 13px !important;
|
| 1372 |
-
border: 1px solid #10b981 !important;
|
| 1373 |
-
}
|
| 1374 |
-
.final-report-box pre {
|
| 1375 |
-
background-color: #1e293b !important;
|
| 1376 |
-
color: #e2e8f0 !important;
|
| 1377 |
-
padding: 16px !important;
|
| 1378 |
-
border-radius: 8px !important;
|
| 1379 |
-
overflow-x: auto !important;
|
| 1380 |
-
margin: 16px 0 !important;
|
| 1381 |
-
font-size: 13px !important;
|
| 1382 |
-
line-height: 1.5 !important;
|
| 1383 |
-
}
|
| 1384 |
-
.final-report-box pre code {
|
| 1385 |
-
background-color: transparent !important;
|
| 1386 |
-
color: #e2e8f0 !important;
|
| 1387 |
-
padding: 0 !important;
|
| 1388 |
-
border: none !important;
|
| 1389 |
-
}
|
| 1390 |
-
.final-report-box blockquote {
|
| 1391 |
-
border-left: 4px solid #10b981 !important;
|
| 1392 |
-
padding-left: 16px !important;
|
| 1393 |
-
margin: 16px 0 !important;
|
| 1394 |
-
color: #064e3b !important;
|
| 1395 |
-
font-style: italic !important;
|
| 1396 |
-
background-color: #f0fdf4 !important;
|
| 1397 |
-
padding: 14px 16px !important;
|
| 1398 |
-
border-radius: 0 8px 8px 0 !important;
|
| 1399 |
-
}
|
| 1400 |
-
.final-report-box ul, .final-report-box ol {
|
| 1401 |
-
margin-left: 24px !important;
|
| 1402 |
-
margin-bottom: 16px !important;
|
| 1403 |
-
}
|
| 1404 |
-
.final-report-box li {
|
| 1405 |
-
margin-bottom: 8px !important;
|
| 1406 |
-
line-height: 1.8 !important;
|
| 1407 |
-
}
|
| 1408 |
-
.final-report-box strong {
|
| 1409 |
-
color: #065f46 !important;
|
| 1410 |
-
font-weight: 600 !important;
|
| 1411 |
-
}
|
| 1412 |
-
.final-report-box em {
|
| 1413 |
-
color: #047857 !important;
|
| 1414 |
-
}
|
| 1415 |
-
.final-report-box hr {
|
| 1416 |
-
border: none !important;
|
| 1417 |
-
border-top: 2px solid #10b981 !important;
|
| 1418 |
-
margin: 28px 0 !important;
|
| 1419 |
-
}
|
| 1420 |
-
.final-report-box a {
|
| 1421 |
-
color: #059669 !important;
|
| 1422 |
-
text-decoration: underline !important;
|
| 1423 |
-
}
|
| 1424 |
-
.final-report-box a:hover {
|
| 1425 |
-
color: #047857 !important;
|
| 1426 |
-
}
|
| 1427 |
-
h1 {
|
| 1428 |
-
text-align: center;
|
| 1429 |
-
color: #1f2937;
|
| 1430 |
-
margin-bottom: 10px;
|
| 1431 |
-
}
|
| 1432 |
-
h3 {
|
| 1433 |
-
font-weight: 600;
|
| 1434 |
-
margin-bottom: 8px;
|
| 1435 |
-
}
|
| 1436 |
-
.gradio-container {
|
| 1437 |
-
max-width: 1400px;
|
| 1438 |
-
margin: 0 auto;
|
| 1439 |
-
}
|
| 1440 |
-
"""
|
| 1441 |
-
|
| 1442 |
-
# Gradio ์ธํฐํ์ด์ค
|
| 1443 |
-
with gr.Blocks(
|
| 1444 |
-
title="AGI ์คํ ์ ๋ฌธ ๋ณด๊ณ ์ ์์คํ
",
|
| 1445 |
-
theme=gr.themes.Soft(),
|
| 1446 |
-
css=css,
|
| 1447 |
-
analytics_enabled=False
|
| 1448 |
-
) as app:
|
| 1449 |
-
gr.Markdown(
|
| 1450 |
-
"""
|
| 1451 |
-
# ๐ AGI ์์ค ์คํยท์ค์ ๊ธฐ๋ฐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ ์์คํ
|
| 1452 |
-
|
| 1453 |
-
### ๐ ์ฐจ์ธ๋ ์ธ๊ณต์ง๋ฅ ์ง๋จ์ง์ฑ ํ๋ซํผ
|
| 1454 |
-
|
| 1455 |
-
> **"๋ค์ฏ ๊ฐ์ง ์ ๋ฌธ์ฑ์ ์๋์ง๋ก ์ฐฝ์ถํ๋ ์ต๊ณ ์์ค์ ์ ๋ต ๋ณด๊ณ ์"**
|
| 1456 |
-
|
| 1457 |
-
### ๐ ํ๋ก์ธ์ค: ๆจโ๋นํโ็ซโ๋นํโๅโ๋นํโ้โ๋นํโๆฐดโ๋นํโๆจ(์ต์ข
)
|
| 1458 |
-
|
| 1459 |
-
| ์ญํ | ๋๋ชฉยท์คํ | AGI ์ ๋ฌธ์ฑ |
|
| 1460 |
-
|------|-----------|-------------|
|
| 1461 |
-
| ๐ณ **์ ๋ต์ ๋น์ ์ค๊ณ์** | ไปยทๆจ | ๋ฏธ๋์์ธก, ์์คํ
์ ์ฌ๊ณ , ํ์ ์ ๋ต |
|
| 1462 |
-
| ๐ฅ **ํ์ ์ ๋ต ์ํคํ
ํธ** | ็พฉยท็ซ | ํ๊ดด์ ํ์ , ๋น์ฆ๋์ค ๋ชจ๋ธ, ๊ฒฝ์์ฐ์ |
|
| 1463 |
-
| ๐๏ธ **์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** | ไฟกยทๅ | ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค, ํ์ง ์์คํ
, ROI |
|
| 1464 |
-
| โ๏ธ **์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** | ็ฆฎยท้ | ์ํฐํ๋ผ์ด์ฆ ์ค๊ณ, ๊ธฐ์ ํ์ค, ํ์ฅ์ฑ |
|
| 1465 |
-
| ๐ง **๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** | ๆบยทๆฐด | ์ ๊ธฐ์ R&D, AI/ML, ๊ธฐ์ ์ตํฉ |
|
| 1466 |
-
| ๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ** | ์๊ทน ์๋ฆฌ | ์คํ ์๊ทน์ ๋ฐ๋ฅธ ๋นํ (้ๅ
ๆจ, ๆฐดๅ
็ซ, ๆจๅ
ๅ, ็ซๅ
้, ๅๅ
ๆฐด) |
|
| 1467 |
-
|
| 1468 |
-
---
|
| 1469 |
-
|
| 1470 |
-
**๐ก ๋ณธ ์์คํ
์ AGI(Artificial General Intelligence) ์์ค์ ๋ถ์๋ ฅ๊ณผ ์ฐฝ์์ฑ์ ๋ฐํ์ผ๋ก**
|
| 1471 |
-
**McKinsey, BCG, Bain ์์ค์ ์ ๋ฌธ ์ปจ์คํ
๋ณด๊ณ ์๋ฅผ ์๋์ผ๋ก ์์ฑํฉ๋๋ค.**
|
| 1472 |
-
"""
|
| 1473 |
-
)
|
| 1474 |
-
|
| 1475 |
-
with gr.Row():
|
| 1476 |
-
with gr.Column(scale=3):
|
| 1477 |
-
llm_mode = gr.Radio(
|
| 1478 |
-
choices=["default", "commercial"],
|
| 1479 |
-
value="commercial",
|
| 1480 |
-
label="AI ๋ชจ๋ธ ์ ํ",
|
| 1481 |
-
info="commercial: Gemini 2.5 Pro (AGI Mode) - ๊ถ์ฅ"
|
| 1482 |
-
)
|
| 1483 |
-
|
| 1484 |
-
user_input = gr.Textbox(
|
| 1485 |
-
label="๋ณด๊ณ ์ ์์ฒญ์ฌํญ",
|
| 1486 |
-
placeholder="์: ์ฐ๋ฆฌ ํ์ฌ์ ๋์งํธ ์ ํ ์ ๋ต๊ณผ 3๊ฐ๋
์คํ ๋ก๋๋งต์ ์๋ฆฝํด์ฃผ์ธ์",
|
| 1487 |
-
lines=4
|
| 1488 |
-
)
|
| 1489 |
-
|
| 1490 |
-
with gr.Row():
|
| 1491 |
-
submit_btn = gr.Button("๐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ", variant="primary", scale=2)
|
| 1492 |
-
clear_btn = gr.Button("๐๏ธ ์ด๊ธฐํ", scale=1)
|
| 1493 |
-
|
| 1494 |
-
with gr.Column(scale=1):
|
| 1495 |
-
status_text = gr.Textbox(
|
| 1496 |
-
label="ํ๋ก์ธ์ค ์ํ",
|
| 1497 |
-
interactive=False,
|
| 1498 |
-
value="AGI ์์คํ
๋๊ธฐ ์ค...",
|
| 1499 |
-
lines=3
|
| 1500 |
-
)
|
| 1501 |
-
|
| 1502 |
-
# ์ต์ข
๋ณด๊ณ ์ ์น์
|
| 1503 |
-
with gr.Row():
|
| 1504 |
-
with gr.Column():
|
| 1505 |
-
gr.Markdown("""
|
| 1506 |
-
### ๐ ์ต์ข
์ ๋ฌธ ๋ถ์ ๋ณด๊ณ ์
|
| 1507 |
-
<p style="color: #666; margin-top: -10px;">Executive Summary & Strategic Recommendations</p>
|
| 1508 |
-
""")
|
| 1509 |
-
final_report = gr.Markdown(
|
| 1510 |
-
value="*AGI ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๊ฐ ์ฌ๊ธฐ์ ์์ฑ๋ฉ๋๋ค.*",
|
| 1511 |
-
elem_classes=["final-report-box"]
|
| 1512 |
-
)
|
| 1513 |
-
|
| 1514 |
-
# ์คํ ์ถ๋ ฅ - 2x3 ๊ทธ๋ฆฌ๋
|
| 1515 |
-
with gr.Row():
|
| 1516 |
-
with gr.Column():
|
| 1517 |
-
gr.Markdown("### ๐ณ ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์ (ไป)")
|
| 1518 |
-
wood_output = gr.Textbox(
|
| 1519 |
-
label="",
|
| 1520 |
-
lines=12,
|
| 1521 |
-
max_lines=18,
|
| 1522 |
-
interactive=False,
|
| 1523 |
-
elem_classes=["wood-box"]
|
| 1524 |
-
)
|
| 1525 |
-
|
| 1526 |
-
with gr.Column():
|
| 1527 |
-
gr.Markdown("### ๐ฅ ็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ (็พฉ)")
|
| 1528 |
-
fire_output = gr.Textbox(
|
| 1529 |
-
label="",
|
| 1530 |
-
lines=12,
|
| 1531 |
-
max_lines=18,
|
| 1532 |
-
interactive=False,
|
| 1533 |
-
elem_classes=["fire-box"]
|
| 1534 |
-
)
|
| 1535 |
-
|
| 1536 |
-
with gr.Row():
|
| 1537 |
-
with gr.Column():
|
| 1538 |
-
gr.Markdown("### ๐๏ธ ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ (ไฟก)")
|
| 1539 |
-
earth_output = gr.Textbox(
|
| 1540 |
-
label="",
|
| 1541 |
-
lines=12,
|
| 1542 |
-
max_lines=18,
|
| 1543 |
-
interactive=False,
|
| 1544 |
-
elem_classes=["earth-box"]
|
| 1545 |
-
)
|
| 1546 |
-
|
| 1547 |
-
with gr.Column():
|
| 1548 |
-
gr.Markdown("### โ๏ธ ้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ (็ฆฎ)")
|
| 1549 |
-
metal_output = gr.Textbox(
|
| 1550 |
-
label="",
|
| 1551 |
-
lines=12,
|
| 1552 |
-
max_lines=18,
|
| 1553 |
-
interactive=False,
|
| 1554 |
-
elem_classes=["metal-box"]
|
| 1555 |
-
)
|
| 1556 |
-
|
| 1557 |
-
with gr.Row():
|
| 1558 |
-
with gr.Column():
|
| 1559 |
-
gr.Markdown("### ๐ง ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ (ๆบ)")
|
| 1560 |
-
water_output = gr.Textbox(
|
| 1561 |
-
label="",
|
| 1562 |
-
lines=12,
|
| 1563 |
-
max_lines=18,
|
| 1564 |
-
interactive=False,
|
| 1565 |
-
elem_classes=["water-box"]
|
| 1566 |
-
)
|
| 1567 |
-
|
| 1568 |
-
with gr.Column():
|
| 1569 |
-
gr.Markdown("### ๐ ์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ (์คํ ์๊ทน)")
|
| 1570 |
-
critic_output = gr.Textbox(
|
| 1571 |
-
label="",
|
| 1572 |
-
lines=12,
|
| 1573 |
-
max_lines=18,
|
| 1574 |
-
interactive=False,
|
| 1575 |
-
elem_classes=["critic-box"]
|
| 1576 |
-
)
|
| 1577 |
-
|
| 1578 |
-
# ์์
|
| 1579 |
-
gr.Examples(
|
| 1580 |
-
examples=[
|
| 1581 |
-
"์ฐ๋ฆฌ ํ์ฌ์ ๋์งํธ ์ ํ ์ ๋ต๊ณผ 3๊ฐ๋
์คํ ๋ก๋๋งต์ ์๋ฆฝํด์ฃผ์ธ์",
|
| 1582 |
-
"๊ธ๋ก๋ฒ ์์ฅ ์ง์ถ์ ์ํ ์ข
ํฉ์ ์ธ ์ฌ์
์ ๋ต๊ณผ ๋ฆฌ์คํฌ ๋ถ์ ๋ณด๊ณ ์๋ฅผ ์์ฑํด์ฃผ์ธ์",
|
| 1583 |
-
"AI ๊ธฐ๋ฐ ์ ๊ท ๋น์ฆ๋์ค ๋ชจ๋ธ ๊ฐ๋ฐ๊ณผ ์์ตํ ์ ๋ต์ ์ ์ํด์ฃผ์ธ์",
|
| 1584 |
-
"ESG ๊ฒฝ์ ์ฒด๊ณ ๊ตฌ์ถ๊ณผ ์ง์๊ฐ๋ฅ์ฑ ์ ๋ต ๋ณด๊ณ ์๋ฅผ ์์ฑํด์ฃผ์ธ์",
|
| 1585 |
-
"๋ฉํ๋ฒ์ค ํ๋ซํผ ๊ตฌ์ถ์ ์ํ ๊ธฐ์ ์ํคํ
์ฒ์ ์ฌ์
๊ณํ์ ์๋ฆฝํด์ฃผ์ธ์",
|
| 1586 |
-
"๊ณต๊ธ๋ง ์ต์ ํ์ ์ค๋งํธ ํฉํ ๋ฆฌ ์ ํ ์ ๋ต์ ๋ถ์ํด์ฃผ์ธ์",
|
| 1587 |
-
"๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ ์ฒด๊ณ ๊ตฌ์ถ ๋ฐฉ์๊ณผ ๊ฑฐ๋ฒ๋์ค ๋ชจ๋ธ์ ์ ์ํด์ฃผ์ธ์",
|
| 1588 |
-
"๊ณ ๊ฐ ๊ฒฝํ ํ์ ์ ์ํ ์ด๋์ฑ๋ ์ ๋ต๊ณผ ์คํ ๊ณํ์ ์๋ฆฝํด์ฃผ์ธ์"
|
| 1589 |
-
],
|
| 1590 |
-
inputs=user_input,
|
| 1591 |
-
label="๐ก ์ ๋ฌธ ๋ณด๊ณ ์ ์์ "
|
| 1592 |
-
)
|
| 1593 |
-
|
| 1594 |
-
# ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
| 1595 |
-
submit_btn.click(
|
| 1596 |
-
fn=process_wuxing_query,
|
| 1597 |
-
inputs=[user_input, llm_mode],
|
| 1598 |
-
outputs=[wood_output, fire_output, earth_output, metal_output, water_output, critic_output, final_report, status_text]
|
| 1599 |
-
).then(
|
| 1600 |
-
fn=lambda: "",
|
| 1601 |
-
outputs=[user_input]
|
| 1602 |
-
)
|
| 1603 |
-
|
| 1604 |
-
user_input.submit(
|
| 1605 |
-
fn=process_wuxing_query,
|
| 1606 |
-
inputs=[user_input, llm_mode],
|
| 1607 |
-
outputs=[wood_output, fire_output, earth_output, metal_output, water_output, critic_output, final_report, status_text]
|
| 1608 |
-
).then(
|
| 1609 |
-
fn=lambda: "",
|
| 1610 |
-
outputs=[user_input]
|
| 1611 |
-
)
|
| 1612 |
-
|
| 1613 |
-
clear_btn.click(
|
| 1614 |
-
fn=clear_wuxing,
|
| 1615 |
-
outputs=[wood_output, fire_output, earth_output, metal_output, water_output, critic_output, final_report, status_text]
|
| 1616 |
-
)
|
| 1617 |
|
| 1618 |
if __name__ == "__main__":
|
| 1619 |
-
|
| 1620 |
-
app.launch(
|
| 1621 |
-
server_name="0.0.0.0",
|
| 1622 |
-
server_port=7860,
|
| 1623 |
-
share=True,
|
| 1624 |
-
show_error=True
|
| 1625 |
-
)
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import sys
|
| 3 |
+
import streamlit as st
|
| 4 |
+
from tempfile import NamedTemporaryFile
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
def main():
|
| 7 |
+
try:
|
| 8 |
+
# Get the code from secrets
|
| 9 |
+
code = os.environ.get("MAIN_CODE")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
if not code:
|
| 12 |
+
st.error("โ ๏ธ The application code wasn't found in secrets. Please add the MAIN_CODE secret.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
return
|
| 14 |
|
| 15 |
+
# Create a temporary Python file
|
| 16 |
+
with NamedTemporaryFile(suffix='.py', delete=False, mode='w') as tmp:
|
| 17 |
+
tmp.write(code)
|
| 18 |
+
tmp_path = tmp.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
# Execute the code
|
| 21 |
+
exec(compile(code, tmp_path, 'exec'), globals())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
# Clean up the temporary file
|
| 24 |
try:
|
| 25 |
+
os.unlink(tmp_path)
|
| 26 |
+
except:
|
| 27 |
+
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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