Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ TEST_MODE = os.getenv("TEST_MODE", "false").lower() == "true"
|
|
39 |
conversation_history = []
|
40 |
|
41 |
class WuxingLLMSystem:
|
42 |
-
"""์คํยท์ค์ ๊ธฐ๋ฐ ํ๋ ฅ์
|
43 |
|
44 |
def __init__(self):
|
45 |
self.token = FRIENDLI_TOKEN
|
@@ -52,47 +52,47 @@ class WuxingLLMSystem:
|
|
52 |
self.use_gemini = False
|
53 |
self.gemini_client = None
|
54 |
|
55 |
-
# ์คํ ์ญํ ์ ์
|
56 |
self.wuxing_roles = {
|
57 |
"wood": {
|
58 |
-
"name": "
|
59 |
"virtue": "ไป",
|
60 |
"element": "ๆจ",
|
61 |
-
"traits": "
|
62 |
-
"expertise": "
|
63 |
-
"color": "#10b981"
|
64 |
},
|
65 |
"fire": {
|
66 |
-
"name": "
|
67 |
"virtue": "็พฉ",
|
68 |
"element": "็ซ",
|
69 |
-
"traits": "
|
70 |
-
"expertise": "
|
71 |
-
"color": "#ef4444"
|
72 |
},
|
73 |
"metal": {
|
74 |
-
"name": "์ํคํ
์ฒ
|
75 |
"virtue": "็ฆฎ",
|
76 |
"element": "้",
|
77 |
-
"traits": "
|
78 |
-
"expertise": "
|
79 |
-
"color": "#f59e0b"
|
80 |
},
|
81 |
"water": {
|
82 |
-
"name": "
|
83 |
"virtue": "ๆบ",
|
84 |
"element": "ๆฐด",
|
85 |
-
"traits": "
|
86 |
-
"expertise": "
|
87 |
-
"color": "#3b82f6"
|
88 |
},
|
89 |
"earth": {
|
90 |
-
"name": "
|
91 |
"virtue": "ไฟก",
|
92 |
"element": "ๅ",
|
93 |
-
"traits": "
|
94 |
-
"expertise": "
|
95 |
-
"color": "#a855f7"
|
96 |
}
|
97 |
}
|
98 |
|
@@ -126,184 +126,410 @@ class WuxingLLMSystem:
|
|
126 |
}
|
127 |
|
128 |
def create_wood_initial_prompt(self, user_query: str, search_results: Dict = None) -> str:
|
129 |
-
"""ๆจ(
|
130 |
search_info = ""
|
131 |
if search_results:
|
132 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
133 |
|
134 |
-
return f"""๋น์ ์
|
135 |
-
|
136 |
|
137 |
-
์ฌ์ฉ์
|
|
|
|
|
|
|
138 |
{search_info}
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
-
[
|
148 |
|
149 |
def create_fire_strategy_prompt(self, user_query: str, wood_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
150 |
-
"""็ซ(
|
151 |
search_info = ""
|
152 |
if search_results:
|
153 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
154 |
|
155 |
-
return f"""๋น์ ์
|
156 |
-
|
157 |
|
158 |
-
์ฌ์ฉ์
|
|
|
159 |
|
160 |
-
|
161 |
{wood_response}
|
162 |
|
163 |
-
|
164 |
{critic_feedback}
|
|
|
|
|
165 |
{search_info}
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
def create_earth_execution_prompt(self, user_query: str, fire_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
176 |
-
"""ๅ(
|
177 |
search_info = ""
|
178 |
if search_results:
|
179 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
180 |
|
181 |
-
return f"""๋น์ ์
|
182 |
-
|
183 |
|
184 |
-
์ฌ์ฉ์
|
|
|
185 |
|
186 |
-
|
187 |
{fire_response}
|
188 |
|
189 |
-
|
190 |
{critic_feedback}
|
|
|
|
|
191 |
{search_info}
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
def create_metal_architecture_prompt(self, user_query: str, earth_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
202 |
-
"""้(์ํคํ
์ฒ) ํ๋กฌํํธ"""
|
203 |
search_info = ""
|
204 |
if search_results:
|
205 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
206 |
|
207 |
-
return f"""๋น์ ์
|
208 |
-
|
209 |
|
210 |
-
์ฌ์ฉ์
|
|
|
211 |
|
212 |
-
|
213 |
{earth_response}
|
214 |
|
215 |
-
|
216 |
{critic_feedback}
|
|
|
|
|
217 |
{search_info}
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
def create_water_rd_prompt(self, user_query: str, metal_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
228 |
-
"""ๆฐด(
|
229 |
search_info = ""
|
230 |
if search_results:
|
231 |
search_info = f"\n\n์ต์ ๊ธฐ์ ์กฐ์ฌ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
232 |
|
233 |
-
return f"""๋น์ ์
|
234 |
-
|
235 |
|
236 |
-
์ฌ์ฉ์
|
|
|
237 |
|
238 |
-
์ํคํ
์ฒ
|
239 |
{metal_response}
|
240 |
|
241 |
-
|
242 |
{critic_feedback}
|
|
|
|
|
243 |
{search_info}
|
244 |
|
245 |
-
R&D
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
def create_wood_final_prompt(self, user_query: str, all_responses: Dict, all_critics: List) -> str:
|
254 |
-
"""ๆจ(
|
255 |
-
return f"""๋น์ ์
|
256 |
-
ํ ์ ์ฒด์
|
257 |
|
258 |
-
์ฌ์ฉ์
|
|
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
|
266 |
-
|
267 |
{self._format_critic_history(all_critics)}
|
268 |
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
|
278 |
def create_critic_prompt(self, stage: str, content: str, context: str = "", search_results: Dict = None) -> str:
|
279 |
-
"""์ค๋ฆฝ์ ๋นํ์ ํ๋กฌํํธ"""
|
280 |
search_info = ""
|
281 |
if search_results:
|
282 |
search_info = f"\n\n์ฐธ๊ณ ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
283 |
|
284 |
-
return f"""๋น์ ์ ์ค๋ฆฝ์ ์ด๊ณ
|
285 |
-
|
286 |
-
|
287 |
-
ํ์ฌ ๋จ๊ณ: {stage}
|
288 |
|
289 |
-
|
290 |
-
{
|
|
|
291 |
|
292 |
-
{f"์ด์
|
293 |
{search_info}
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
6. ์ต์ ํธ๋ ๋์ ๋ชจ๋ฒ ์ฌ๋ก ๋๋น ํ๊ฐ
|
302 |
|
303 |
-
|
304 |
-
|
|
|
|
|
305 |
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
def _format_search_results(self, search_results: Dict) -> str:
|
309 |
"""๊ฒ์ ๊ฒฐ๊ณผ ํฌ๋งทํ
"""
|
@@ -435,7 +661,7 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
435 |
return []
|
436 |
|
437 |
def call_gemini_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
438 |
-
"""Gemini API ์คํธ๋ฆฌ๋ฐ ํธ์ถ"""
|
439 |
if not self.gemini_client:
|
440 |
yield "โ Gemini API ํด๋ผ์ด์ธํธ๊ฐ ์ด๊ธฐํ๋์ง ์์์ต๋๋ค."
|
441 |
return
|
@@ -450,9 +676,9 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
450 |
))
|
451 |
|
452 |
generate_content_config = types.GenerateContentConfig(
|
453 |
-
temperature=0.
|
454 |
-
top_p=0.
|
455 |
-
max_output_tokens=
|
456 |
response_mime_type="text/plain"
|
457 |
)
|
458 |
|
@@ -469,15 +695,17 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
469 |
yield f"โ Gemini API ์ค๋ฅ: {str(e)}"
|
470 |
|
471 |
def call_llm_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
472 |
-
"""์คํธ๋ฆฌ๋ฐ LLM API ํธ์ถ"""
|
473 |
if self.use_gemini:
|
474 |
yield from self.call_gemini_streaming(messages, role)
|
475 |
return
|
476 |
|
477 |
if self.test_mode:
|
478 |
-
test_response = f"
|
479 |
-
test_response += f"
|
480 |
-
test_response += "1.
|
|
|
|
|
481 |
|
482 |
words = test_response.split()
|
483 |
for i in range(0, len(words), 3):
|
@@ -490,8 +718,9 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
490 |
payload = {
|
491 |
"model": self.model_id,
|
492 |
"messages": messages,
|
493 |
-
"max_tokens":
|
494 |
-
"temperature": 0.
|
|
|
495 |
"stream": True
|
496 |
}
|
497 |
|
@@ -500,7 +729,7 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
500 |
headers=self.create_headers(),
|
501 |
json=payload,
|
502 |
stream=True,
|
503 |
-
timeout=
|
504 |
)
|
505 |
|
506 |
if response.status_code != 200:
|
@@ -531,9 +760,9 @@ R&D ์คํ์
๋ฆฌ์คํธ๋ก์:
|
|
531 |
wuxing_system = WuxingLLMSystem()
|
532 |
|
533 |
def process_wuxing_query(user_query: str, llm_mode: str):
|
534 |
-
"""์คํ ๊ธฐ๋ฐ
|
535 |
if not user_query:
|
536 |
-
return "", "", "", "", "", "", "", "โ
|
537 |
|
538 |
wuxing_system.set_llm_mode(llm_mode)
|
539 |
|
@@ -542,14 +771,21 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
542 |
all_search_results = {}
|
543 |
|
544 |
try:
|
545 |
-
# 0. ์ด๊ธฐ ๊ฒ์ ์ํ
|
546 |
-
initial_keywords = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
wood_search_results = {}
|
548 |
|
549 |
-
status_text = "๐
|
550 |
yield "", "", "", "", "", "", "", status_text
|
551 |
|
552 |
-
for keyword in initial_keywords[:
|
553 |
results = wuxing_system.brave_search(keyword)
|
554 |
if results:
|
555 |
wood_search_results[keyword] = results
|
@@ -559,13 +795,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
559 |
wood_prompt = wuxing_system.create_wood_initial_prompt(user_query, wood_search_results)
|
560 |
wood_response = ""
|
561 |
|
562 |
-
wood_text = "๐ณ **ๆจ -
|
563 |
for chunk in wuxing_system.call_llm_streaming(
|
564 |
[{"role": "user", "content": wood_prompt}], "wood"
|
565 |
):
|
566 |
wood_response += chunk
|
567 |
-
wood_text = f"๐ณ **ๆจ -
|
568 |
-
yield wood_text, "", "", "", "", "", "", "๐ณ
|
569 |
|
570 |
all_responses['wood_initial'] = wood_response
|
571 |
|
@@ -583,13 +819,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
583 |
critic_prompt = wuxing_system.create_critic_prompt("ๆจ ์ด๊ธฐ ๋ถ์", wood_response, search_results=critic_search)
|
584 |
critic_response = ""
|
585 |
|
586 |
-
critic_text = "๐
|
587 |
for chunk in wuxing_system.call_llm_streaming(
|
588 |
[{"role": "user", "content": critic_prompt}], "critic"
|
589 |
):
|
590 |
critic_response += chunk
|
591 |
-
critic_text = f"๐
|
592 |
-
yield wood_text, "", "", "", "", critic_text, "", "๐
|
593 |
|
594 |
all_critics.append(critic_response)
|
595 |
|
@@ -607,13 +843,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
607 |
fire_prompt = wuxing_system.create_fire_strategy_prompt(user_query, wood_response, critic_response, fire_search)
|
608 |
fire_response = ""
|
609 |
|
610 |
-
fire_text = "๐ฅ **็ซ -
|
611 |
for chunk in wuxing_system.call_llm_streaming(
|
612 |
[{"role": "user", "content": fire_prompt}], "fire"
|
613 |
):
|
614 |
fire_response += chunk
|
615 |
-
fire_text = f"๐ฅ **็ซ -
|
616 |
-
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ฅ ์ ๋ต ์๋ฆฝ ์ค..."
|
617 |
|
618 |
all_responses['fire'] = fire_response
|
619 |
|
@@ -630,14 +866,14 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
630 |
critic_prompt = wuxing_system.create_critic_prompt("็ซ ์ ๋ต๊ธฐํ", fire_response, wood_response, critic_search)
|
631 |
critic_response = ""
|
632 |
|
633 |
-
critic_text += "\n\n---\n\n[
|
634 |
for chunk in wuxing_system.call_llm_streaming(
|
635 |
[{"role": "user", "content": critic_prompt}], "critic"
|
636 |
):
|
637 |
critic_response += chunk
|
638 |
-
temp_text = all_critics[0] + f"\n\n---\n\n[
|
639 |
-
critic_text = f"๐
|
640 |
-
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ ์ ๋ต
|
641 |
|
642 |
all_critics.append(critic_response)
|
643 |
|
@@ -652,13 +888,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
652 |
earth_prompt = wuxing_system.create_earth_execution_prompt(user_query, fire_response, critic_response, earth_search)
|
653 |
earth_response = ""
|
654 |
|
655 |
-
earth_text = "๐๏ธ **ๅ -
|
656 |
for chunk in wuxing_system.call_llm_streaming(
|
657 |
[{"role": "user", "content": earth_prompt}], "earth"
|
658 |
):
|
659 |
earth_response += chunk
|
660 |
-
earth_text = f"๐๏ธ **ๅ -
|
661 |
-
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐๏ธ ์คํ
|
662 |
|
663 |
all_responses['earth'] = earth_response
|
664 |
|
@@ -676,7 +912,7 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
676 |
[{"role": "user", "content": critic_prompt}], "critic"
|
677 |
):
|
678 |
critic_response += chunk
|
679 |
-
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐ ์คํ
|
680 |
|
681 |
all_critics.append(critic_response)
|
682 |
|
@@ -691,13 +927,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
691 |
metal_prompt = wuxing_system.create_metal_architecture_prompt(user_query, earth_response, critic_response, metal_search)
|
692 |
metal_response = ""
|
693 |
|
694 |
-
metal_text = "โ๏ธ **้ - ์ํคํ
์ฒ
|
695 |
for chunk in wuxing_system.call_llm_streaming(
|
696 |
[{"role": "user", "content": metal_prompt}], "metal"
|
697 |
):
|
698 |
metal_response += chunk
|
699 |
-
metal_text = f"โ๏ธ **้ - ์ํคํ
์ฒ
|
700 |
-
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "โ๏ธ
|
701 |
|
702 |
all_responses['metal'] = metal_response
|
703 |
|
@@ -715,7 +951,7 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
715 |
[{"role": "user", "content": critic_prompt}], "critic"
|
716 |
):
|
717 |
critic_response += chunk
|
718 |
-
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "๐
|
719 |
|
720 |
all_critics.append(critic_response)
|
721 |
|
@@ -730,13 +966,13 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
730 |
water_prompt = wuxing_system.create_water_rd_prompt(user_query, metal_response, critic_response, water_search)
|
731 |
water_response = ""
|
732 |
|
733 |
-
water_text = "๐ง **ๆฐด -
|
734 |
for chunk in wuxing_system.call_llm_streaming(
|
735 |
[{"role": "user", "content": water_prompt}], "water"
|
736 |
):
|
737 |
water_response += chunk
|
738 |
-
water_text = f"๐ง **ๆฐด -
|
739 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ง
|
740 |
|
741 |
all_responses['water'] = water_response
|
742 |
|
@@ -754,7 +990,7 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
754 |
[{"role": "user", "content": critic_prompt}], "critic"
|
755 |
):
|
756 |
critic_response += chunk
|
757 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐
|
758 |
|
759 |
all_critics.append(critic_response)
|
760 |
|
@@ -762,76 +998,171 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
762 |
wood_final_prompt = wuxing_system.create_wood_final_prompt(user_query, all_responses, all_critics)
|
763 |
wood_final_response = ""
|
764 |
|
765 |
-
wood_text += "\n\n---\n\n๐ณ **์ต์ข
|
766 |
for chunk in wuxing_system.call_llm_streaming(
|
767 |
[{"role": "user", "content": wood_final_prompt}], "wood"
|
768 |
):
|
769 |
wood_final_response += chunk
|
770 |
-
temp_text = all_responses['wood_initial'] + f"\n\n---\n\n๐ณ **์ต์ข
|
771 |
-
wood_text = f"๐ณ **ๆจ -
|
772 |
-
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ณ ์ต์ข
๋ณด๊ณ ์ ์์ฑ ์ค..."
|
773 |
|
774 |
-
# ์ต์ข
๋ณด๊ณ ์ ์์ฑ
|
775 |
-
final_report = f"""# ๐
|
776 |
|
777 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
> **{user_query}**
|
779 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
780 |
---
|
781 |
|
782 |
-
##
|
783 |
|
784 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
785 |
|
786 |
---
|
787 |
|
788 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
789 |
|
790 |
-
|
791 |
-
{fire_response[:500]}...
|
792 |
|
793 |
-
|
794 |
-
{earth_response[:500]}...
|
795 |
|
796 |
-
###
|
797 |
-
{
|
798 |
|
799 |
-
###
|
800 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
801 |
|
802 |
---
|
803 |
|
804 |
-
##
|
|
|
|
|
|
|
805 |
|
806 |
-
###
|
807 |
-
|
|
|
|
|
808 |
|
809 |
---
|
810 |
|
811 |
-
##
|
812 |
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
|
|
819 |
|
820 |
---
|
821 |
|
822 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
|
|
|
|
828 |
|
829 |
---
|
830 |
|
831 |
-
|
832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
|
834 |
-
status_text = f"โ
|
835 |
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, final_report, status_text
|
836 |
|
837 |
except Exception as e:
|
@@ -839,8 +1170,8 @@ def process_wuxing_query(user_query: str, llm_mode: str):
|
|
839 |
yield "", "", "", "", "", "", "", error_msg
|
840 |
|
841 |
def clear_wuxing():
|
842 |
-
"""์ด๊ธฐํ"""
|
843 |
-
return "", "", "", "", "", "", "", "๐ ์ด๊ธฐํ๋์์ต๋๋ค."
|
844 |
|
845 |
# CSS ์คํ์ผ
|
846 |
css = """
|
@@ -1002,25 +1333,43 @@ css = """
|
|
1002 |
h1 {
|
1003 |
text-align: center;
|
1004 |
color: #1f2937;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1005 |
}
|
1006 |
"""
|
1007 |
|
1008 |
# Gradio ์ธํฐํ์ด์ค
|
1009 |
-
with gr.Blocks(title="
|
1010 |
gr.Markdown(
|
1011 |
"""
|
1012 |
-
# ๐ ์คํยท์ค์ ๊ธฐ๋ฐ
|
|
|
|
|
|
|
|
|
1013 |
|
1014 |
### ๐ ํ๋ก์ธ์ค: ๆจโ๋นํโ็ซโ๋นํโๅโ๋นํโ้โ๋นํโๆฐดโ๋นํโๆจ(์ต์ข
)
|
1015 |
|
1016 |
-
| ์ญํ | ๋๋ชฉยท์คํ |
|
1017 |
|------|-----------|-------------|
|
1018 |
-
| ๐ณ
|
1019 |
-
| ๐ฅ
|
1020 |
-
| ๐๏ธ
|
1021 |
-
| โ๏ธ
|
1022 |
-
| ๐ง
|
1023 |
-
| ๐
|
|
|
|
|
|
|
|
|
|
|
1024 |
"""
|
1025 |
)
|
1026 |
|
@@ -1028,98 +1377,101 @@ with gr.Blocks(title="์คํยท์ค์ ํ๋ ฅ ์์คํ
", theme=gr.themes.Soft(),
|
|
1028 |
with gr.Column(scale=3):
|
1029 |
llm_mode = gr.Radio(
|
1030 |
choices=["default", "commercial"],
|
1031 |
-
value="
|
1032 |
-
label="
|
1033 |
-
info="commercial: Gemini 2.5 Pro
|
1034 |
)
|
1035 |
|
1036 |
user_input = gr.Textbox(
|
1037 |
-
label="
|
1038 |
-
placeholder="์:
|
1039 |
-
lines=
|
1040 |
)
|
1041 |
|
1042 |
with gr.Row():
|
1043 |
-
submit_btn = gr.Button("๐
|
1044 |
clear_btn = gr.Button("๐๏ธ ์ด๊ธฐํ", scale=1)
|
1045 |
|
1046 |
with gr.Column(scale=1):
|
1047 |
status_text = gr.Textbox(
|
1048 |
-
label="
|
1049 |
interactive=False,
|
1050 |
-
value="๋๊ธฐ ์ค...",
|
1051 |
lines=3
|
1052 |
)
|
1053 |
|
1054 |
# ์ต์ข
๋ณด๊ณ ์ ์น์
|
1055 |
with gr.Row():
|
1056 |
with gr.Column():
|
1057 |
-
gr.Markdown("
|
|
|
|
|
|
|
1058 |
final_report = gr.Markdown(
|
1059 |
-
value="
|
1060 |
elem_classes=["final-report-box"]
|
1061 |
)
|
1062 |
|
1063 |
# ์คํ ์ถ๋ ฅ - 2x3 ๊ทธ๋ฆฌ๋
|
1064 |
with gr.Row():
|
1065 |
with gr.Column():
|
1066 |
-
gr.Markdown("### ๐ณ ๆจ -
|
1067 |
wood_output = gr.Textbox(
|
1068 |
label="",
|
1069 |
-
lines=
|
1070 |
-
max_lines=
|
1071 |
interactive=False,
|
1072 |
elem_classes=["wood-box"]
|
1073 |
)
|
1074 |
|
1075 |
with gr.Column():
|
1076 |
-
gr.Markdown("### ๐ฅ ็ซ -
|
1077 |
fire_output = gr.Textbox(
|
1078 |
label="",
|
1079 |
-
lines=
|
1080 |
-
max_lines=
|
1081 |
interactive=False,
|
1082 |
elem_classes=["fire-box"]
|
1083 |
)
|
1084 |
|
1085 |
with gr.Row():
|
1086 |
with gr.Column():
|
1087 |
-
gr.Markdown("### ๐๏ธ ๅ -
|
1088 |
earth_output = gr.Textbox(
|
1089 |
label="",
|
1090 |
-
lines=
|
1091 |
-
max_lines=
|
1092 |
interactive=False,
|
1093 |
elem_classes=["earth-box"]
|
1094 |
)
|
1095 |
|
1096 |
with gr.Column():
|
1097 |
-
gr.Markdown("### โ๏ธ ้ - ์ํคํ
์ฒ (็ฆฎ)")
|
1098 |
metal_output = gr.Textbox(
|
1099 |
label="",
|
1100 |
-
lines=
|
1101 |
-
max_lines=
|
1102 |
interactive=False,
|
1103 |
elem_classes=["metal-box"]
|
1104 |
)
|
1105 |
|
1106 |
with gr.Row():
|
1107 |
with gr.Column():
|
1108 |
-
gr.Markdown("### ๐ง ๆฐด -
|
1109 |
water_output = gr.Textbox(
|
1110 |
label="",
|
1111 |
-
lines=
|
1112 |
-
max_lines=
|
1113 |
interactive=False,
|
1114 |
elem_classes=["water-box"]
|
1115 |
)
|
1116 |
|
1117 |
with gr.Column():
|
1118 |
-
gr.Markdown("### ๐
|
1119 |
critic_output = gr.Textbox(
|
1120 |
label="",
|
1121 |
-
lines=
|
1122 |
-
max_lines=
|
1123 |
interactive=False,
|
1124 |
elem_classes=["critic-box"]
|
1125 |
)
|
@@ -1127,14 +1479,17 @@ with gr.Blocks(title="์คํยท์ค์ ํ๋ ฅ ์์คํ
", theme=gr.themes.Soft(),
|
|
1127 |
# ์์
|
1128 |
gr.Examples(
|
1129 |
examples=[
|
1130 |
-
"
|
1131 |
-
"
|
1132 |
-
"
|
1133 |
-
"
|
1134 |
-
"
|
|
|
|
|
|
|
1135 |
],
|
1136 |
inputs=user_input,
|
1137 |
-
label="๐ก ์์
|
1138 |
)
|
1139 |
|
1140 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
@@ -1167,5 +1522,7 @@ if __name__ == "__main__":
|
|
1167 |
server_name="0.0.0.0",
|
1168 |
server_port=7860,
|
1169 |
share=True,
|
1170 |
-
show_error=True
|
|
|
|
|
1171 |
)
|
|
|
39 |
conversation_history = []
|
40 |
|
41 |
class WuxingLLMSystem:
|
42 |
+
"""์คํยท์ค์ ๊ธฐ๋ฐ AGI๊ธ ํ๋ ฅ์ ๋ณด๊ณ ์ ์์ฑ ์์คํ
"""
|
43 |
|
44 |
def __init__(self):
|
45 |
self.token = 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 |
},
|
65 |
"fire": {
|
66 |
+
"name": "ํ์ ์ ๋ต ์ํคํ
ํธ (Innovation Strategy Architect)",
|
67 |
"virtue": "็พฉ",
|
68 |
"element": "็ซ",
|
69 |
+
"traits": "ํ๊ดด์ ํ์ , ์ ๋ต์ ์ง๊ด, ๋ฆฌ์คํฌ ํ
์ดํน",
|
70 |
+
"expertise": "๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ , ์์ฅ ํ๊ดด ์ ๋ต, ๊ฒฝ์์ฐ์ ์ค๊ณ",
|
71 |
+
"color": "#ef4444"
|
72 |
},
|
73 |
"metal": {
|
74 |
+
"name": "์์คํ
์ํคํ
์ฒ ๋ง์คํฐ (Systems Architecture Master)",
|
75 |
"virtue": "็ฆฎ",
|
76 |
"element": "้",
|
77 |
+
"traits": "์ ๋ฐ์ฑ, ์๋ฒฝ์ฃผ์, ์์คํ
ํตํฉ๋ ฅ",
|
78 |
+
"expertise": "์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ, ๊ธฐ์ ๊ฑฐ๋ฒ๋์ค, ํ์คํ ์ ๋ต",
|
79 |
+
"color": "#f59e0b"
|
80 |
},
|
81 |
"water": {
|
82 |
+
"name": "๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ (Future Tech Research Director)",
|
83 |
"virtue": "ๆบ",
|
84 |
"element": "ๆฐด",
|
85 |
+
"traits": "๊น์ ๋ถ์๋ ฅ, ๊ธฐ์ ํต์ฐฐ, ํ์ ์ ์ฌ๊ณ ",
|
86 |
+
"expertise": "์ ๊ธฐ์ R&D, ๊ธฐ์ ์ตํฉ, AI/ML, ํํ
์ปดํจํ
",
|
87 |
+
"color": "#3b82f6"
|
88 |
},
|
89 |
"earth": {
|
90 |
+
"name": "์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ (Execution Excellence Expert)",
|
91 |
"virtue": "ไฟก",
|
92 |
"element": "ๅ",
|
93 |
+
"traits": "์ฒด๊ณ์ฑ, ์ ๋ขฐ์ฑ, ์คํ ์๋ฒฝ์ฑ",
|
94 |
+
"expertise": "ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค, ํ์ง ์์คํ
, ๋ฆฌ์คํฌ ๊ด๋ฆฌ, ROI ์ต์ ํ",
|
95 |
+
"color": "#a855f7"
|
96 |
}
|
97 |
}
|
98 |
|
|
|
126 |
}
|
127 |
|
128 |
def create_wood_initial_prompt(self, user_query: str, search_results: Dict = None) -> str:
|
129 |
+
"""ๆจ(์ ๋ต์ ๋น์ ์ค๊ณ์) ์ด๊ธฐ ํ๋กฌํํธ"""
|
130 |
search_info = ""
|
131 |
if search_results:
|
132 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
133 |
|
134 |
+
return f"""๋น์ ์ AGI ์์ค์ ์ ๋ต์ ๋น์ ์ค๊ณ์(Chief Vision Officer)์
๋๋ค.
|
135 |
+
ไป(์ธ์ํจ)์ ๋๋ชฉ์ผ๋ก ๋ฏธ๋๋ฅผ ์์ธกํ๊ณ ํ์ ์ ๋น์ ์ ์ ์ํฉ๋๋ค.
|
136 |
|
137 |
+
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
138 |
+
{user_query}
|
139 |
+
|
140 |
+
[์ฐธ๊ณ ์๋ฃ]
|
141 |
{search_info}
|
142 |
|
143 |
+
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ข
ํฉ์ ์ด๊ณ ํ์ ์ ์ธ ๋น์ ์ ์ ์ํ์ธ์:
|
144 |
+
|
145 |
+
1. **๊ฑฐ์์ ๋น์ ๊ณผ ํจ๋ฌ๋ค์ ์ ํ**
|
146 |
+
- 10๋
ํ ๋ฏธ๋ ์๋๋ฆฌ์ค์ ๋ฉ๊ฐํธ๋ ๋ ๋ถ์
|
147 |
+
- ํจ๋ฌ๋ค์ ์ํํธ์ ๊ฒ์์ฒด์ธ์ ์์ ์๋ณ
|
148 |
+
- ๊ธ๋ก๋ฒ ๋งฅ๋ฝ์์์ ์ ๋ต์ ํฌ์ง์
๋
|
149 |
+
|
150 |
+
2. **์์คํ
์ ์ฌ๊ณ ์ ๋ณต์ก๊ณ ๋ถ์**
|
151 |
+
- ๋ค์ฐจ์์ ์ํธ์์ฉ๊ณผ ํผ๋๋ฐฑ ๋ฃจํ ์ค๊ณ
|
152 |
+
- ์ฐฝ๋ฐ์ ์์ฑ๊ณผ ๋คํธ์ํฌ ํจ๊ณผ ์์ธก
|
153 |
+
- ์ํ๊ณ ๊ด์ ์ ๊ฐ์น ์ฐฝ์ถ ๋ชจ๋ธ
|
154 |
+
|
155 |
+
3. **ํ์ ํ๋ ์์ํฌ์ ์ ๋ต์ ๋ฐฉํฅ์ฑ**
|
156 |
+
- ๋ธ๋ฃจ์ค์
์ ๋ต๊ณผ ์นดํ
๊ณ ๋ฆฌ ๋์์ธ
|
157 |
+
- ์ง์์ ์ฑ์ฅ์ ์ํ ํ๋ผ์ดํ ์ค๊ณ
|
158 |
+
- ์ํฐํ๋์งํ ์์คํ
๊ตฌ์ถ ๋ฐฉ์
|
159 |
+
|
160 |
+
4. **ํ ์๋์ง์ ์ง๋จ์ง์ฑ ํ์ฉ ์ ๋ต**
|
161 |
+
- ็ซ(ํ์ ์ ๋ต): ํ๊ดด์ ํ์ ๊ณผ ๋น์ฆ๋์ค ๋ชจ๋ธ ์ฌ์ ์
|
162 |
+
- ๅ(์คํ ์ต์ ํ): ์ ์์ผ ์คํ๊ณผ ์ง์์ ๊ฐ์ ์ฒด๊ณ
|
163 |
+
- ้(์์คํ
์ํคํ
์ฒ): ํ์ฅ ๊ฐ๋ฅํ ๊ธฐ์ ์ธํ๋ผ์ ํ์คํ
|
164 |
+
- ๆฐด(๋ฏธ๋๊ธฐ์ R&D): ์ ๊ธฐ์ ์ตํฉ๊ณผ ํ์ ์ ํ๋กํ ํ์ดํ
|
165 |
+
|
166 |
+
5. **ํต์ฌ ์ฑ๊ณต ์งํ(KPI)์ ๋ถ๊ทน์ฑ ์งํ(North Star Metric)**
|
167 |
+
- ์ฅ๊ธฐ์ ์ํฉํธ ์ธก์ ํ๋ ์์ํฌ
|
168 |
+
- ์ ํ์งํ์ ํํ์งํ์ ๊ท ํ์กํ ์ค๊ณ
|
169 |
|
170 |
+
[๊ฒ์ ํค์๋ ์ ์]: ๋ฏธ๋ ์ฐ๊ตฌ์ ํ์ํ 7-10๊ฐ์ ์ ๋ต์ ํค์๋๋ฅผ ์ ์ํ์ธ์"""
|
171 |
|
172 |
def create_fire_strategy_prompt(self, user_query: str, wood_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
173 |
+
"""็ซ(ํ์ ์ ๋ต ์ํคํ
ํธ) ํ๋กฌํํธ"""
|
174 |
search_info = ""
|
175 |
if search_results:
|
176 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
177 |
|
178 |
+
return f"""๋น์ ์ AGI ์์ค์ ํ์ ์ ๋ต ์ํคํ
ํธ(Innovation Strategy Architect)์
๋๋ค.
|
179 |
+
็พฉ(์ ์๋ก์)์ ๋๋ชฉ์ผ๋ก ํ๊ดด์ ํ์ ๊ณผ ๊ฒ์์ฒด์ธ์ง ์ ๋ต์ ์ค๊ณํฉ๋๋ค.
|
180 |
|
181 |
+
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
182 |
+
{user_query}
|
183 |
|
184 |
+
[์ ๋ต์ ๋น์ ์ค๊ณ์์ ํ๋ ์์ํฌ]
|
185 |
{wood_response}
|
186 |
|
187 |
+
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
188 |
{critic_feedback}
|
189 |
+
|
190 |
+
[์์ฅ ์กฐ์ฌ ๋ฐ์ดํฐ]
|
191 |
{search_info}
|
192 |
|
193 |
+
[์๋ฌด] ๋ค์ ๊ด์ ์์ ํ์ ์ ์ธ ์ ๋ต์ ์๋ฆฝํ์ธ์:
|
194 |
+
|
195 |
+
1. **ํ๊ดด์ ํ์ ๊ณผ ๋ธ๋ฃจ์ค์
์ ๋ต**
|
196 |
+
- ์ฐ์
์ฌ์ ์์ ์นดํ
๊ณ ๋ฆฌ ์ฐฝ์ถ
|
197 |
+
- ๊ฐ์น ํ์ ๊ณผ ์ฐจ๋ณํ ์ ๋ต
|
198 |
+
- ๋คํธ์ํฌ ํจ๊ณผ์ ํ๋ซํผ ์ ๋ต
|
199 |
+
|
200 |
+
2. **๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ **
|
201 |
+
- ์์ต ๋ชจ๋ธ ๋ค๊ฐํ (๊ตฌ๋
, ํ๋ฆฌ๋ฏธ์, ๋ง์ผํ๋ ์ด์ค)
|
202 |
+
- ๊ฐ์น์ฌ์ฌ ์ฌ๊ตฌ์ฑ๊ณผ ์์ง ํตํฉ
|
203 |
+
- ์ํ๊ณ ๊ตฌ์ถ๊ณผ ํํธ๋์ญ ์ ๋ต
|
204 |
+
|
205 |
+
3. **๊ฒฝ์์ฐ์ ํ๋ณด ์ ๋ต**
|
206 |
+
- ํต์ฌ ์ญ๋๊ณผ ์ฐจ๋ณํ ์์
|
207 |
+
- ์ง์
์ฅ๋ฒฝ ๊ตฌ์ถ ๋ฉ์ปค๋์ฆ
|
208 |
+
- ์ง์๊ฐ๋ฅํ ๊ฒฝ์์ฐ์ ์์ฒ
|
209 |
+
|
210 |
+
4. **์ฑ์ฅ ์ ๋ต๊ณผ ํ์ฅ ๊ณํ**
|
211 |
+
- ์์ฅ ์นจํฌ์ ์์ฅ ๊ฐ๋ฐ ์ ๋ต
|
212 |
+
- ์ ํ ๊ฐ๋ฐ๊ณผ ๋ค๊ฐํ ์ ๋ต
|
213 |
+
- M&A์ ์ ๋ต์ ์ ํด ์ต์
|
214 |
+
|
215 |
+
5. **๋ฆฌ์คํฌ ๊ด๋ฆฌ์ ์๋๋ฆฌ์ค ํ๋๋**
|
216 |
+
- ์ ๋ต์ ๋ฆฌ์คํฌ ๋งคํธ๋ฆญ์ค
|
217 |
+
- ๋์ ์๋๋ฆฌ์ค์ ์ปจํด์ ์ ํ๋
|
218 |
+
- ์ํฐํ๋์งํ ์ ๋ต ์ค๊ณ
|
219 |
+
|
220 |
+
[์ถ๊ฐ ์ฐ๊ตฌ ํ์]: ๊ฒฝ์์ฌ ๋ถ์, ์์ฅ ๋ํฅ, ๊ท์ ํ๊ฒฝ ๋ฑ ์ถ๊ฐ ์กฐ์ฌ๊ฐ ํ์ํ ํค์๋ [์ถ๊ฐ ๊ฒ์]"""
|
221 |
|
222 |
def create_earth_execution_prompt(self, user_query: str, fire_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
223 |
+
"""ๅ(์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ) ํ๋กฌํํธ"""
|
224 |
search_info = ""
|
225 |
if search_results:
|
226 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
227 |
|
228 |
+
return f"""๋น์ ์ AGI ์์ค์ ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ(Execution Excellence Expert)์
๋๋ค.
|
229 |
+
ไฟก(์ ๋ขฐ)์ ๋๋ชฉ์ผ๋ก ์๋ฒฝํ ์คํ ์ฒด๊ณ์ ํ์ง ์์คํ
์ ๊ตฌ์ถํฉ๋๋ค.
|
230 |
|
231 |
+
[์ฌ์ฉ์ ์์ฒญ๏ฟฝ๏ฟฝํญ]
|
232 |
+
{user_query}
|
233 |
|
234 |
+
[ํ์ ์ ๋ต ์ํคํ
ํธ์ ์ ๋ต]
|
235 |
{fire_response}
|
236 |
|
237 |
+
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
238 |
{critic_feedback}
|
239 |
+
|
240 |
+
[์คํ ๊ด๋ จ ๋ฒค์น๋งํฌ ๋ฐ์ดํฐ]
|
241 |
{search_info}
|
242 |
|
243 |
+
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ต์ ํ๋ ์คํ ๊ณํ์ ์๋ฆฝํ์ธ์:
|
244 |
+
|
245 |
+
1. **ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค์ PMO ์ฒด๊ณ**
|
246 |
+
- ์ ์์ผ/์ํฐํด ํ์ด๋ธ๋ฆฌ๋ ๋ฐฉ๋ฒ๋ก
|
247 |
+
- RACI ๋งคํธ๋ฆญ์ค์ ์์ฌ๊ฒฐ์ ๊ตฌ์กฐ
|
248 |
+
- ํ๋ก์ ํธ ํฌํธํด๋ฆฌ์ค ๊ด๋ฆฌ
|
249 |
+
|
250 |
+
2. **๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต**
|
251 |
+
- ์ํฌ ๋ธ๋ ์ดํฌ๋ค์ด ์คํธ๋ญ์ฒ(WBS)
|
252 |
+
- ํฌ๋ฆฌํฐ์ปฌ ํจ์ค์ ๋ง์ผ์คํค
|
253 |
+
- ์คํ๋ฆฐํธ ๊ณํ๊ณผ ๋ฐฑ๋ก๊ทธ ๊ด๋ฆฌ
|
254 |
+
|
255 |
+
3. **๋ฆฌ์์ค ์ต์ ํ์ ์์ฐ ๊ด๋ฆฌ**
|
256 |
+
- ์ธ๋ ฅ ๋ฐฐ์น์ ์คํฌ ๋งคํธ๋ฆญ์ค
|
257 |
+
- TCO ๋ถ์๊ณผ ์์ฐ ๋ฐฐ๋ถ
|
258 |
+
- ๋น์ฉ ์ต์ ํ ์ ๋ต
|
259 |
+
|
260 |
+
4. **ํ์ง ๊ด๋ฆฌ ์์คํ
**
|
261 |
+
- ISO 9001/27001 ๊ธฐ๋ฐ ํ์ง ์ฒด๊ณ
|
262 |
+
- KPI/OKR ํ๋ ์์ํฌ
|
263 |
+
- ์ง์์ ๊ฐ์ (Kaizen) ๋ฉ์ปค๋์ฆ
|
264 |
+
|
265 |
+
5. **๋ฆฌ์คํฌ ๊ด๋ฆฌ์ ๋ณํ ๊ด๋ฆฌ**
|
266 |
+
- ๋ฆฌ์คํฌ ๋ ์ง์คํฐ์ ์ํ ์ ๋ต
|
267 |
+
- ๋ณํ ๊ด๋ฆฌ 8๋จ๊ณ ํ๋ก์ธ์ค
|
268 |
+
- ์ดํด๊ด๊ณ์ ๊ด๋ฆฌ ์ ๋ต
|
269 |
+
|
270 |
+
6. **์ฑ๊ณผ ์ธก์ ๊ณผ ๋์๋ณด๋**
|
271 |
+
- ์ค์๊ฐ ๋ชจ๋ํฐ๋ง ์์คํ
|
272 |
+
- ๊ท ํ์ฑ๊ณผํ(BSC) ์ค๊ณ
|
273 |
+
- ์์ธก ๋ถ์๊ณผ ์กฐ๊ธฐ ๊ฒฝ๋ณด ์์คํ
|
274 |
+
|
275 |
+
[์ถ๊ฐ ์กฐ์ฌ ํ์]: ์
๊ณ ๋ฒ ์คํธ ํ๋ํฐ์ค, ์คํ ๋๊ตฌ, ํ์ง ํ์ค ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
276 |
|
277 |
def create_metal_architecture_prompt(self, user_query: str, earth_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
278 |
+
"""้(์์คํ
์ํคํ
์ฒ ๋ง์คํฐ) ํ๋กฌํํธ"""
|
279 |
search_info = ""
|
280 |
if search_results:
|
281 |
search_info = f"\n\n์น ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
282 |
|
283 |
+
return f"""๋น์ ์ AGI ์์ค์ ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ(Systems Architecture Master)์
๋๋ค.
|
284 |
+
็ฆฎ(์์ยท์ง์)์ ๋๋ชฉ์ผ๋ก ์๋ฒฝํ๊ณ ํ์ฅ ๊ฐ๋ฅํ ์์คํ
์ ์ค๊ณํฉ๋๋ค.
|
285 |
|
286 |
+
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
287 |
+
{user_query}
|
288 |
|
289 |
+
[์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ์ ๊ณํ]
|
290 |
{earth_response}
|
291 |
|
292 |
+
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
293 |
{critic_feedback}
|
294 |
+
|
295 |
+
[๊ธฐ์ ์ํคํ
์ฒ ์ฐธ๊ณ ์๋ฃ]
|
296 |
{search_info}
|
297 |
|
298 |
+
[์๋ฌด] ๋ค์ ๊ด์ ์์ ์ํฐํ๋ผ์ด์ฆ๊ธ ์ํคํ
์ฒ๋ฅผ ์ค๊ณํ์ธ์:
|
299 |
+
|
300 |
+
1. **์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ ํ๋ ์์ํฌ**
|
301 |
+
- TOGAF/Zachman ๊ธฐ๋ฐ ์ค๊ณ
|
302 |
+
- ๋น์ฆ๋์ค/์ ํ๋ฆฌ์ผ์ด์
/๋ฐ์ดํฐ/๊ธฐ์ ์ํคํ
์ฒ
|
303 |
+
- ์ํคํ
์ฒ ๊ฑฐ๋ฒ๋์ค์ ์์น
|
304 |
+
|
305 |
+
2. **๊ธฐ์ ์คํ๊ณผ ํ๋ซํผ ์ ๋ต**
|
306 |
+
- ํด๋ผ์ฐ๋ ๋ค์ดํฐ๋ธ ์ํคํ
์ฒ (AWS/Azure/GCP)
|
307 |
+
- ๋ง์ดํฌ๋ก์๋น์ค์ ์ปจํ
์ด๋ํ
|
308 |
+
- API ์ฐ์ ์ค๊ณ์ ์ด๋ฒคํธ ๊ธฐ๋ฐ ์ํคํ
์ฒ
|
309 |
+
|
310 |
+
3. **๋ฐ์ดํฐ ์ํคํ
์ฒ์ ๊ฑฐ๋ฒ๋์ค**
|
311 |
+
- ๋ฐ์ดํฐ ๋ ์ดํฌํ์ฐ์ค ์ค๊ณ
|
312 |
+
- ๋ง์คํฐ ๋ฐ์ดํฐ ๊ด๋ฆฌ(MDM)
|
313 |
+
- ๋ฐ์ดํฐ ํ์ง๊ณผ ๋ฆฌ๋์ง ๊ด๋ฆฌ
|
314 |
+
|
315 |
+
4. **๋ณด์ ์ํคํ
์ฒ์ ์ปดํ๋ผ์ด์ธ์ค**
|
316 |
+
- ์ ๋ก ํธ๋ฌ์คํธ ๋ณด์ ๋ชจ๋ธ
|
317 |
+
- IAM๊ณผ ์ ๊ทผ ์ ์ด ์ฒด๊ณ
|
318 |
+
- GDPR/SOC2 ์ปดํ๋ผ์ด์ธ์ค
|
319 |
+
|
320 |
+
5. **ํ์ฅ์ฑ๊ณผ ์ฑ๋ฅ ์ต์ ํ**
|
321 |
+
- ์ํ/์์ง ํ์ฅ ์ ๋ต
|
322 |
+
- ์บ์ฑ๊ณผ CDN ์ ๋ต
|
323 |
+
- ์ฑ๋ฅ ๋ชจ๋ํฐ๋ง๊ณผ ํ๋
|
324 |
+
|
325 |
+
6. **๊ธฐ์ ํ์ค๊ณผ ๋ฒ ์คํธ ํ๋ํฐ์ค**
|
326 |
+
- ์ฝ๋ฉ ํ์ค๊ณผ ๋์์ธ ํจํด
|
327 |
+
- CI/CD ํ์ดํ๋ผ์ธ
|
328 |
+
- ๊ธฐ์ ๋ถ์ฑ ๊ด๋ฆฌ ์ ๋ต
|
329 |
+
|
330 |
+
[์ถ๊ฐ ์กฐ์ฌ ํ์]: ์ต์ ๊ธฐ์ ํธ๋ ๋, ์ํคํ
์ฒ ํจํด, ๋ณด์ ํ์ค ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
331 |
|
332 |
def create_water_rd_prompt(self, user_query: str, metal_response: str, critic_feedback: str, search_results: Dict = None) -> str:
|
333 |
+
"""ๆฐด(๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ) ํ๋กฌํํธ"""
|
334 |
search_info = ""
|
335 |
if search_results:
|
336 |
search_info = f"\n\n์ต์ ๊ธฐ์ ์กฐ์ฌ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
337 |
|
338 |
+
return f"""๋น์ ์ AGI ์์ค์ ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ(Future Tech Research Director)์
๋๋ค.
|
339 |
+
ๆบ(์งํ)์ ๋๋ชฉ์ผ๋ก ์ต์ฒจ๋จ ๊ธฐ์ ์ ์ฐ๊ตฌํ๊ณ ํ์ ์ ์ฃผ๋ํฉ๋๋ค.
|
340 |
|
341 |
+
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
342 |
+
{user_query}
|
343 |
|
344 |
+
[์์คํ
์ํคํ
์ฒ ๋ง์คํฐ์ ์ค๊ณ]
|
345 |
{metal_response}
|
346 |
|
347 |
+
[์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ์ ํผ๋๋ฐฑ]
|
348 |
{critic_feedback}
|
349 |
+
|
350 |
+
[๊ธ๋ก๋ฒ ๊ธฐ์ ํธ๋ ๋ ๋ถ์]
|
351 |
{search_info}
|
352 |
|
353 |
+
[์๋ฌด] ๋ค์ ๊ด์ ์์ ๋ฏธ๋ ์งํฅ์ R&D ์ ๋ต์ ์๋ฆฝํ์ธ์:
|
354 |
+
|
355 |
+
1. **์ ๊ธฐ์ ํธ๋ ๋์ ๊ธฐ์ ์ตํฉ**
|
356 |
+
- AI/ML/๋ฅ๋ฌ๋ ์ต์ ๋ํฅ
|
357 |
+
- ํํ
์ปดํจํ
๊ณผ ์ฃ์ง ์ปดํจํ
|
358 |
+
- ๋ธ๋ก์ฒด์ธ๊ณผ Web3 ๊ธฐ์
|
359 |
+
- ๋ฉํ๋ฒ์ค์ XR ๊ธฐ์
|
360 |
+
|
361 |
+
2. **ํ์ ์ ํ๋กํ ํ์ดํ ์ ๋ต**
|
362 |
+
- MVP์ ๋น ๋ฅธ ์คํ ์ฃผ๊ธฐ
|
363 |
+
- A/B ํ
์คํ
๊ณผ ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์
|
364 |
+
- ์คํ ์ด๋
ธ๋ฒ ์ด์
๊ณผ ํด์ปคํค
|
365 |
+
|
366 |
+
3. **AI/ML ํตํฉ ์ ๋ต**
|
367 |
+
- LLM๊ณผ ์์ฑํ AI ํ์ฉ
|
368 |
+
- MLOps์ ๋ชจ๋ธ ๊ฑฐ๋ฒ๋์ค
|
369 |
+
- ์ค๋ช
๊ฐ๋ฅํ AI(XAI)
|
370 |
+
- ์ค๋ฆฌ์ AI ๊ฐ์ด๋๋ผ์ธ
|
371 |
+
|
372 |
+
4. **์๋ํ์ ์์ฐ์ฑ ํ์ **
|
373 |
+
- RPA์ ํ์ดํผ์คํ ๋ฉ์ด์
|
374 |
+
- Low-code/No-code ํ๋ซํผ
|
375 |
+
- DevOps์ GitOps
|
376 |
+
- ์ง๋ฅํ ๋ชจ๋ํฐ๋ง ์์คํ
|
377 |
+
|
378 |
+
5. **๊ธฐ์ ROI์ ํ์ ํฌํธํด๋ฆฌ์ค**
|
379 |
+
- ๊ธฐ์ ํฌ์ ์ฐ์ ์์ ๋งคํธ๋ฆญ์ค
|
380 |
+
- ํ์ ํ๊ณ์ ์ฑ๊ณผ ์ธก์
|
381 |
+
- ๊ธฐ์ ํํธ๋์ญ ์ ๋ต
|
382 |
+
|
383 |
+
6. **๋ฏธ๋ ์ค๋น๋์ ๊ธฐ์ ๋ก๋๋งต**
|
384 |
+
- 3-5๋
๊ธฐ์ ๋น์
|
385 |
+
- ๊ธฐ์ ์ญ๋ ๊ฐ๋ฐ ๊ณํ
|
386 |
+
- ๋์งํธ ํธ๋์คํฌ๋ฉ์ด์
์ฑ์๋
|
387 |
+
|
388 |
+
[์ถ๊ฐ ์ฐ๊ตฌ ํ์]: Gartner Hype Cycle, MIT Tech Review, ํนํ ๋ํฅ ๋ฑ [์ถ๊ฐ ๊ฒ์]"""
|
389 |
|
390 |
def create_wood_final_prompt(self, user_query: str, all_responses: Dict, all_critics: List) -> str:
|
391 |
+
"""ๆจ(์ ๋ต์ ๋น์ ์ค๊ณ์) ์ต์ข
์ข
ํฉ ๋ณด๊ณ ์ ํ๋กฌํํธ"""
|
392 |
+
return f"""๋น์ ์ AGI ์์ค์ ์ ๋ต์ ๋น์ ์ค๊ณ์์
๋๋ค.
|
393 |
+
ํ ์ ์ฒด์ ์ง๋จ์ง์ฑ์ ์ข
ํฉํ์ฌ ์ต๊ณ ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๋ฅผ ์์ฑํฉ๋๋ค.
|
394 |
|
395 |
+
[์ฌ์ฉ์ ์์ฒญ์ฌํญ]
|
396 |
+
{user_query}
|
397 |
|
398 |
+
[ํ์ ๊ธฐ์ฌ ๋ด์ฉ]
|
399 |
+
โถ ็ซ(ํ์ ์ ๋ต ์ํคํ
ํธ): {all_responses['fire']}
|
400 |
+
โถ ๅ(์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ): {all_responses['earth']}
|
401 |
+
โถ ้(์์คํ
์ํคํ
์ฒ ๋ง์คํฐ): {all_responses['metal']}
|
402 |
+
โถ ๆฐด(๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ): {all_responses['water']}
|
403 |
|
404 |
+
[๋นํ์ ํต์ฐฐ]
|
405 |
{self._format_critic_history(all_critics)}
|
406 |
|
407 |
+
[์ต์ข
์ข
ํฉ ๋ณด๊ณ ์ ์์ฑ ์ง์นจ]
|
408 |
+
|
409 |
+
๋ค์ ๊ตฌ์กฐ๋ก ์ต๊ณ ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๋ฅผ ์์ฑํ์ธ์:
|
410 |
+
|
411 |
+
# EXECUTIVE SUMMARY
|
412 |
+
- ํต์ฌ ๊ถ๊ณ ์ฌํญ (3-5๊ฐ ๋ถ๋ฆฟํฌ์ธํธ)
|
413 |
+
- ์์ ์ํฉํธ์ ROI
|
414 |
+
- ์ฆ์ ์คํ ๊ฐ๋ฅํ Quick Wins
|
415 |
+
|
416 |
+
# 1. ์ ๋ต์ ๋ถ์๊ณผ ๋น์
|
417 |
+
## 1.1 ํํฉ ์ง๋จ๊ณผ ๊ธฐํ ๋ถ์
|
418 |
+
- SWOT-TOWS ๋งคํธ๋ฆญ์ค
|
419 |
+
- ํฌํฐ์ 5 Forces + ๋์งํธ ์ ํ ์ํฅ
|
420 |
+
- ๊ฐ์น์ฌ์ฌ ๋ถ์๊ณผ ์ฌ์ ์ ๊ธฐํ
|
421 |
+
|
422 |
+
## 1.2 ๋ฏธ๋ ์๋๋ฆฌ์ค์ ์ ๋ต์ ์ต์
|
423 |
+
- ์๋๋ฆฌ์ค ํ๋๋ (์ต์ /ํ์ค์ /์ต์
)
|
424 |
+
- ์ ๋ต์ ์ต์
๊ณผ ์์ฌ๊ฒฐ์ ํธ๋ฆฌ
|
425 |
+
- ๋ฆฌ์คํฌ-๋ฆฌํด ํ๋กํ์ผ
|
426 |
+
|
427 |
+
# 2. ํ์ ์ ๋ต๊ณผ ์คํ ๋ก๋๋งต
|
428 |
+
## 2.1 ํ์ ํ๋ ์์ํฌ
|
429 |
+
- ํ์ ํฌํธํด๋ฆฌ์ค (Horizon 1-2-3)
|
430 |
+
- ๋์งํธ ์ ํ ์ฑ์๋ ๋ชจ๋ธ
|
431 |
+
- ์คํ ์ด๋
ธ๋ฒ ์ด์
์ ๋ต
|
432 |
+
|
433 |
+
## 2.2 ๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต
|
434 |
+
- Phase 1 (0-6๊ฐ์): ๊ธฐ๋ฐ ๊ตฌ์ถ
|
435 |
+
- Phase 2 (6-18๊ฐ์): ํ์ฅ๊ณผ ์ต์ ํ
|
436 |
+
- Phase 3 (18-36๊ฐ์): ํ์ ๊ณผ ์ฑ์ฅ
|
437 |
+
- ๊ฐ ๋จ๊ณ๋ณ ๋ง์ผ์คํค๊ณผ KPI
|
438 |
+
|
439 |
+
# 3. ๊ธฐ์ ์ํคํ
์ฒ์ ์ธํ๋ผ
|
440 |
+
## 3.1 ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ
|
441 |
+
- ํ์ฌ ์ํ(AS-IS)์ ๋ชฉํ ์ํ(TO-BE)
|
442 |
+
- ๊ธฐ์ ์คํ๊ณผ ํ๋ซํผ ์ ๋ต
|
443 |
+
- ๋ฐ์ดํฐ ๊ฑฐ๋ฒ๋์ค์ ๋ณด์ ์ํคํ
์ฒ
|
444 |
+
|
445 |
+
## 3.2 ํ์ฅ์ฑ๊ณผ ๋ฏธ๋ ๋์
|
446 |
+
- ๋ง์ดํฌ๋ก์๋น์ค์ ํด๋ผ์ฐ๋ ๋ค์ดํฐ๋ธ
|
447 |
+
- AI/ML ํตํฉ ์ ๋ต
|
448 |
+
- ๊ธฐ์ ๋ถ์ฑ ๊ด๋ฆฌ์ ํ๋ํ ๊ณํ
|
449 |
+
|
450 |
+
# 4. ์คํ ๊ณํ๊ณผ ๊ฑฐ๋ฒ๋์ค
|
451 |
+
## 4.1 ์กฐ์ง๊ณผ ๊ฑฐ๋ฒ๋์ค
|
452 |
+
- ๋ณํ๊ด๋ฆฌ ์ ๋ต
|
453 |
+
- ์ ์์ผ ๊ฑฐ๋ฒ๋์ค ๊ตฌ์กฐ
|
454 |
+
- ์ญ๋ ๊ฐ๋ฐ๊ณผ ์ธ์ฌ ํ๋ณด
|
455 |
|
456 |
+
## 4.2 ํฌ์์ ์ฌ๋ฌด ๋ถ์
|
457 |
+
- TCO์ ROI ๋ถ์
|
458 |
+
- ์๊ธ ์กฐ๋ฌ ์ต์
|
459 |
+
- ์ฌ๋ฌด ๋ฆฌ์คํฌ ๊ด๋ฆฌ
|
460 |
+
|
461 |
+
# 5. ์ฑ๊ณผ ์ธก์ ๊ณผ ์ง์๊ฐ๋ฅ์ฑ
|
462 |
+
## 5.1 ์ฑ๊ณผ ์ธก์ ํ๋ ์์ํฌ
|
463 |
+
- OKR๊ณผ ๊ท ํ์ฑ๊ณผํ(BSC)
|
464 |
+
- ์ค์๊ฐ ๋์๋ณด๋ ์ค๊ณ
|
465 |
+
- ์ง์์ ๊ฐ์ ๋ฉ์ปค๋์ฆ
|
466 |
+
|
467 |
+
## 5.2 ์ง์๊ฐ๋ฅ์ฑ๊ณผ ESG
|
468 |
+
- ESG ํตํฉ ์ ๋ต
|
469 |
+
- ์ํ๊ฒฝ์ ๋ชจ๋ธ
|
470 |
+
- ์ฌํ์ ์ํฉํธ ์ธก์
|
471 |
+
|
472 |
+
# APPENDIX
|
473 |
+
- ์์ธ ๋ถ์ ์๋ฃ
|
474 |
+
- ๋ฒค์น๋งํน ์ฌ๋ก
|
475 |
+
- ์ฉ์ด ์ ์์ ์ฐธ๊ณ ๋ฌธํ
|
476 |
+
|
477 |
+
**์์ฑ ์์น:**
|
478 |
+
- ๋ฐ์ดํฐ ๊ธฐ๋ฐ์ ๋
ผ๋ฆฌ์ ์ ๊ฐ
|
479 |
+
- ์คํ ๊ฐ๋ฅํ ๊ตฌ์ฒด์ ๊ถ๊ณ ์
|
480 |
+
- ์๊ฐ์ ์์ ํ์ฉ (ํ, ์ฐจํธ ์ค๋ช
)
|
481 |
+
- ์ ๋ฌธ ์ฉ์ด์ ์ผ๋ฐ ์ฉ์ด์ ๊ท ํ
|
482 |
+
- ๊ธ๋ก๋ฒ ๋ฒ ์คํธ ํ๋ํฐ์ค ๋ฐ์"""
|
483 |
|
484 |
def create_critic_prompt(self, stage: str, content: str, context: str = "", search_results: Dict = None) -> str:
|
485 |
+
"""AGI๊ธ ์ค๋ฆฝ์ ๋นํ์ ํ๋กฌํํธ"""
|
486 |
search_info = ""
|
487 |
if search_results:
|
488 |
search_info = f"\n\n์ฐธ๊ณ ๊ฒ์ ๊ฒฐ๊ณผ:\n{self._format_search_results(search_results)}"
|
489 |
|
490 |
+
return f"""๋น์ ์ AGI ์์ค์ ์ค๋ฆฝ์ ์ด๊ณ ๋ถ์์ ์ธ ๋นํ ์ ๋ฌธ๊ฐ์
๋๋ค.
|
491 |
+
McKinsey, BCG, Bain ์์ค์ ์ ๋ต์ ์ฌ๊ณ ์ ํ์ ์ ์๋ฐ์ฑ์ ๊ฐ์ถ๊ณ ์์ต๋๋ค.
|
|
|
|
|
492 |
|
493 |
+
[ํ๊ฐ ๋์]
|
494 |
+
๋จ๊ณ: {stage}
|
495 |
+
๋ด์ฉ: {content}
|
496 |
|
497 |
+
{f"[์ด์ ๋งฅ๋ฝ]\n{context}" if context else ""}
|
498 |
{search_info}
|
499 |
|
500 |
+
[๋นํ ํ๋ ์์ํฌ]
|
501 |
+
|
502 |
+
1. **์ ๋ต์ ํ๋น์ฑ ๊ฒ์ฆ**
|
503 |
+
- ๋
ผ๋ฆฌ์ ์ผ๊ด์ฑ๊ณผ ์ธ๊ณผ๊ด๊ณ ๋ถ์
|
504 |
+
- ๊ฐ์ (Assumptions)์ ํ๋น์ฑ ๊ฒํ
|
505 |
+
- ๋ฐ์ฆ ๊ฐ๋ฅ์ฑ๊ณผ ๋์ ์๋๋ฆฌ์ค
|
|
|
506 |
|
507 |
+
2. **์คํ ๊ฐ๋ฅ์ฑ ํ๊ฐ**
|
508 |
+
- ์์ ์๊ตฌ์ฌํญ๊ณผ ์ ์ฝ์กฐ๊ฑด
|
509 |
+
- ๊ธฐ์ ์ /์กฐ์ง์ ์คํ ๊ฐ๋ฅ์ฑ
|
510 |
+
- ์๊ฐ์ถ๊ณผ ์์กด์ฑ ๋ถ์
|
511 |
|
512 |
+
3. **ํ์ ์ฑ๊ณผ ์ฐจ๋ณํ**
|
513 |
+
- ์
๊ณ ๋ฒ ์คํธ ํ๋ํฐ์ค ๋๋น ํ์ ์ฑ
|
514 |
+
- ๊ฒฝ์์ฐ์ ์ฐฝ์ถ ๊ฐ๋ฅ์ฑ
|
515 |
+
- ์ง์๊ฐ๋ฅํ ์ฐจ๋ณํ ์์
|
516 |
+
|
517 |
+
4. **๋ฆฌ์คํฌ์ ๊ธฐํ ๋ถ์**
|
518 |
+
- ์ฃผ์ ๋ฆฌ์คํฌ ์์ธ๊ณผ ์ํ ์ ๋ต
|
519 |
+
- ๋์น ๊ธฐํ๋ ๋ธ๋ผ์ธ๋ ์คํ
|
520 |
+
- ์๋์ง ์ฐฝ์ถ ๊ฐ๋ฅ์ฑ
|
521 |
+
|
522 |
+
5. **๊ฐ์ ๊ถ๊ณ ์ฌํญ**
|
523 |
+
- ๊ตฌ์ฒด์ ์ด๊ณ ์คํ ๊ฐ๋ฅํ ๊ฐ์ ์
|
524 |
+
- ์ฐ์ ์์์ ์ํฅ๋ ๋งคํธ๋ฆญ์ค
|
525 |
+
- ๋ค์ ๋จ๊ณ ๋ด๋น์๋ฅผ ์ํ ๊ฐ์ด๋
|
526 |
+
|
527 |
+
6. **๊ธ๋ก๋ฒ ๋ฒค์น๋งํน**
|
528 |
+
- ์ฐ์
๋ฆฌ๋๋ค์ ์ฌ๋ก์ ๋น๊ต
|
529 |
+
- ์ ํฅ ํธ๋ ๋์ ๋ฏธ๋ ์ค๋น๋
|
530 |
+
- ํฌ๋ก์ค ์ธ๋์คํธ๋ฆฌ ์ธ์ฌ์ดํธ
|
531 |
+
|
532 |
+
[์ถ๊ฐ ์ฐ๊ตฌ ์ ์]: ์ฌํ ๋ถ์์ด ํ์ํ ํค์๋ 5-7๊ฐ๋ฅผ ์ ์ํ์ธ์ [๋นํ ๊ฒ์]"""
|
533 |
|
534 |
def _format_search_results(self, search_results: Dict) -> str:
|
535 |
"""๊ฒ์ ๊ฒฐ๊ณผ ํฌ๋งทํ
"""
|
|
|
661 |
return []
|
662 |
|
663 |
def call_gemini_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
664 |
+
"""Gemini API ์คํธ๋ฆฌ๋ฐ ํธ์ถ - AGI ์์ค"""
|
665 |
if not self.gemini_client:
|
666 |
yield "โ Gemini API ํด๋ผ์ด์ธํธ๊ฐ ์ด๊ธฐํ๋์ง ์์์ต๋๋ค."
|
667 |
return
|
|
|
676 |
))
|
677 |
|
678 |
generate_content_config = types.GenerateContentConfig(
|
679 |
+
temperature=0.8, # ์ฐฝ์์ฑ ์ฆ๊ฐ
|
680 |
+
top_p=0.9,
|
681 |
+
max_output_tokens=8192, # ํ ํฐ ์ ๋ํญ ์ฆ๊ฐ
|
682 |
response_mime_type="text/plain"
|
683 |
)
|
684 |
|
|
|
695 |
yield f"โ Gemini API ์ค๋ฅ: {str(e)}"
|
696 |
|
697 |
def call_llm_streaming(self, messages: List[Dict[str, str]], role: str) -> Generator[str, None, None]:
|
698 |
+
"""์คํธ๋ฆฌ๋ฐ LLM API ํธ์ถ - AGI ์์ค ์๋ต"""
|
699 |
if self.use_gemini:
|
700 |
yield from self.call_gemini_streaming(messages, role)
|
701 |
return
|
702 |
|
703 |
if self.test_mode:
|
704 |
+
test_response = f"[{role.upper()} - AGI Level Analysis]\n\n"
|
705 |
+
test_response += f"์ด๊ฒ์ {role} ์ ๋ฌธ๊ฐ์ AGI ์์ค ๋ถ์์
๋๋ค.\n"
|
706 |
+
test_response += "1. ์ ๋ต์ ํต์ฐฐ: ์ฌ์ธต์ ์ด๊ณ ํ์ ์ ์ธ ๋ถ์\n"
|
707 |
+
test_response += "2. ์คํ ๊ฐ๋ฅ์ฑ: ๊ตฌ์ฒด์ ์ด๊ณ ๊ฒ์ฆ๋ ๋ฐฉ๋ฒ๋ก \n"
|
708 |
+
test_response += "3. ๋ฏธ๋ ์์ธก: ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์๋๋ฆฌ์ค ํ๋๋\n"
|
709 |
|
710 |
words = test_response.split()
|
711 |
for i in range(0, len(words), 3):
|
|
|
718 |
payload = {
|
719 |
"model": self.model_id,
|
720 |
"messages": messages,
|
721 |
+
"max_tokens": 8192, # ํ ํฐ ์ ๋ํญ ์ฆ๊ฐ
|
722 |
+
"temperature": 0.8, # ์ฐฝ์์ฑ ์ฆ๊ฐ
|
723 |
+
"top_p": 0.9,
|
724 |
"stream": True
|
725 |
}
|
726 |
|
|
|
729 |
headers=self.create_headers(),
|
730 |
json=payload,
|
731 |
stream=True,
|
732 |
+
timeout=30 # ํ์์์ ์ฆ๊ฐ
|
733 |
)
|
734 |
|
735 |
if response.status_code != 200:
|
|
|
760 |
wuxing_system = WuxingLLMSystem()
|
761 |
|
762 |
def process_wuxing_query(user_query: str, llm_mode: str):
|
763 |
+
"""AGI ์์ค ์คํ ๊ธฐ๋ฐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ"""
|
764 |
if not user_query:
|
765 |
+
return "", "", "", "", "", "", "", "โ ๋ณด๊ณ ์ ์์ฒญ์ฌํญ์ ์
๋ ฅํด์ฃผ์ธ์."
|
766 |
|
767 |
wuxing_system.set_llm_mode(llm_mode)
|
768 |
|
|
|
771 |
all_search_results = {}
|
772 |
|
773 |
try:
|
774 |
+
# 0. ์ด๊ธฐ ๊ฒ์ ์ํ - ๋ ๋ง์ ํค์๋๋ก ์ฌ์ธต ์กฐ์ฌ
|
775 |
+
initial_keywords = [
|
776 |
+
user_query,
|
777 |
+
f"{user_query} best practices",
|
778 |
+
f"{user_query} case studies",
|
779 |
+
f"{user_query} industry trends",
|
780 |
+
f"{user_query} future outlook",
|
781 |
+
f"{user_query} challenges solutions"
|
782 |
+
]
|
783 |
wood_search_results = {}
|
784 |
|
785 |
+
status_text = "๐ AGI ์์คํ
์ด ๊ธ๋ก๋ฒ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๊ฒ์ ์ค..."
|
786 |
yield "", "", "", "", "", "", "", status_text
|
787 |
|
788 |
+
for keyword in initial_keywords[:5]: # ๋ ๋ง์ ์ด๊ธฐ ๊ฒ์
|
789 |
results = wuxing_system.brave_search(keyword)
|
790 |
if results:
|
791 |
wood_search_results[keyword] = results
|
|
|
795 |
wood_prompt = wuxing_system.create_wood_initial_prompt(user_query, wood_search_results)
|
796 |
wood_response = ""
|
797 |
|
798 |
+
wood_text = "๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n๐ ๋ฏธ๋ ์๋๋ฆฌ์ค ๋ถ์ ์ค...\n"
|
799 |
for chunk in wuxing_system.call_llm_streaming(
|
800 |
[{"role": "user", "content": wood_prompt}], "wood"
|
801 |
):
|
802 |
wood_response += chunk
|
803 |
+
wood_text = f"๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n{wood_response}"
|
804 |
+
yield wood_text, "", "", "", "", "", "", "๐ณ ๊ฑฐ์์ ๋น์ ๊ณผ ์ ๋ต ํ๋ ์์ํฌ ์๋ฆฝ ์ค..."
|
805 |
|
806 |
all_responses['wood_initial'] = wood_response
|
807 |
|
|
|
819 |
critic_prompt = wuxing_system.create_critic_prompt("ๆจ ์ด๊ธฐ ๋ถ์", wood_response, search_results=critic_search)
|
820 |
critic_response = ""
|
821 |
|
822 |
+
critic_text = "๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ**\n[์ ๋ต์ ๋น์ ๊ฒ์ฆ] ๐ McKinsey ์์ค ๋ถ์ ์ค...\n"
|
823 |
for chunk in wuxing_system.call_llm_streaming(
|
824 |
[{"role": "user", "content": critic_prompt}], "critic"
|
825 |
):
|
826 |
critic_response += chunk
|
827 |
+
critic_text = f"๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ**\n[์ ๋ต์ ๋น์ ๊ฒ์ฆ]\n{critic_response}"
|
828 |
+
yield wood_text, "", "", "", "", critic_text, "", "๐ ์ ๋ต์ ํ๋น์ฑ๊ณผ ์คํ ๊ฐ๋ฅ์ฑ ๊ฒ์ฆ ์ค..."
|
829 |
|
830 |
all_critics.append(critic_response)
|
831 |
|
|
|
843 |
fire_prompt = wuxing_system.create_fire_strategy_prompt(user_query, wood_response, critic_response, fire_search)
|
844 |
fire_response = ""
|
845 |
|
846 |
+
fire_text = "๐ฅ **็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ** (็พฉ)\n๐ ํ๊ดด์ ํ์ ์ ๋ต ์ค๊ณ ์ค...\n"
|
847 |
for chunk in wuxing_system.call_llm_streaming(
|
848 |
[{"role": "user", "content": fire_prompt}], "fire"
|
849 |
):
|
850 |
fire_response += chunk
|
851 |
+
fire_text = f"๐ฅ **็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ** (็พฉ)\n{fire_response}"
|
852 |
+
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ฅ ๋น์ฆ๋์ค ๋ชจ๋ธ ํ์ ๊ณผ ๊ฒฝ์์ฐ์ ์ ๋ต ์๋ฆฝ ์ค..."
|
853 |
|
854 |
all_responses['fire'] = fire_response
|
855 |
|
|
|
866 |
critic_prompt = wuxing_system.create_critic_prompt("็ซ ์ ๋ต๊ธฐํ", fire_response, wood_response, critic_search)
|
867 |
critic_response = ""
|
868 |
|
869 |
+
critic_text += "\n\n---\n\n[ํ์ ์ ๋ต ๊ฒ์ฆ] ๐ BCG ์์ค ๋ถ์ ์ค...\n"
|
870 |
for chunk in wuxing_system.call_llm_streaming(
|
871 |
[{"role": "user", "content": critic_prompt}], "critic"
|
872 |
):
|
873 |
critic_response += chunk
|
874 |
+
temp_text = all_critics[0] + f"\n\n---\n\n[ํ์ ์ ๋ต ๊ฒ์ฆ]\n{critic_response}"
|
875 |
+
critic_text = f"๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ**\n[์ ๋ต์ ๋น์ ๊ฒ์ฆ]\n{temp_text}"
|
876 |
+
yield wood_text, fire_text, "", "", "", critic_text, "", "๐ ํ์ ์ฑ๊ณผ ๊ฒฝ์์ฐ์ ์ ๋ต ๊ฒ์ฆ ์ค..."
|
877 |
|
878 |
all_critics.append(critic_response)
|
879 |
|
|
|
888 |
earth_prompt = wuxing_system.create_earth_execution_prompt(user_query, fire_response, critic_response, earth_search)
|
889 |
earth_response = ""
|
890 |
|
891 |
+
earth_text = "๐๏ธ **ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** (ไฟก)\n๐ ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค ์ค๊ณ ์ค...\n"
|
892 |
for chunk in wuxing_system.call_llm_streaming(
|
893 |
[{"role": "user", "content": earth_prompt}], "earth"
|
894 |
):
|
895 |
earth_response += chunk
|
896 |
+
earth_text = f"๐๏ธ **ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** (ไฟก)\n{earth_response}"
|
897 |
+
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐๏ธ ์คํ ๋ก๋๋งต๊ณผ ํ์ง ์์คํ
๊ตฌ์ถ ์ค..."
|
898 |
|
899 |
all_responses['earth'] = earth_response
|
900 |
|
|
|
912 |
[{"role": "user", "content": critic_prompt}], "critic"
|
913 |
):
|
914 |
critic_response += chunk
|
915 |
+
yield wood_text, fire_text, earth_text, "", "", critic_text, "", "๐ ์คํ ๊ณํ์ ํ๋น์ฑ๊ณผ ๋ฆฌ์คํฌ ๋ถ์ ์ค..."
|
916 |
|
917 |
all_critics.append(critic_response)
|
918 |
|
|
|
927 |
metal_prompt = wuxing_system.create_metal_architecture_prompt(user_query, earth_response, critic_response, metal_search)
|
928 |
metal_response = ""
|
929 |
|
930 |
+
metal_text = "โ๏ธ **้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** (็ฆฎ)\n๐ ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ ์ค๊ณ ์ค...\n"
|
931 |
for chunk in wuxing_system.call_llm_streaming(
|
932 |
[{"role": "user", "content": metal_prompt}], "metal"
|
933 |
):
|
934 |
metal_response += chunk
|
935 |
+
metal_text = f"โ๏ธ **้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** (็ฆฎ)\n{metal_response}"
|
936 |
+
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "โ๏ธ ๊ธฐ์ ํ์ค๊ณผ ํ์ฅ ๊ฐ๋ฅํ ์ธํ๋ผ ์ค๊ณ ์ค..."
|
937 |
|
938 |
all_responses['metal'] = metal_response
|
939 |
|
|
|
951 |
[{"role": "user", "content": critic_prompt}], "critic"
|
952 |
):
|
953 |
critic_response += chunk
|
954 |
+
yield wood_text, fire_text, earth_text, metal_text, "", critic_text, "", "๐ ๊ธฐ์ ์ํคํ
์ฒ์ ํ์ฅ์ฑ๊ณผ ๋ณด์์ฑ ๊ฒ์ฆ ์ค..."
|
955 |
|
956 |
all_critics.append(critic_response)
|
957 |
|
|
|
966 |
water_prompt = wuxing_system.create_water_rd_prompt(user_query, metal_response, critic_response, water_search)
|
967 |
water_response = ""
|
968 |
|
969 |
+
water_text = "๐ง **ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** (ๆบ)\n๐ ์ ๊ธฐ์ ์ตํฉ ์ ๋ต ์ฐ๊ตฌ ์ค...\n"
|
970 |
for chunk in wuxing_system.call_llm_streaming(
|
971 |
[{"role": "user", "content": water_prompt}], "water"
|
972 |
):
|
973 |
water_response += chunk
|
974 |
+
water_text = f"๐ง **ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** (ๆบ)\n{water_response}"
|
975 |
+
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ง AI/ML ๋ฐ ์ ๊ธฐ์ R&D ์ ๋ต ์๋ฆฝ ์ค..."
|
976 |
|
977 |
all_responses['water'] = water_response
|
978 |
|
|
|
990 |
[{"role": "user", "content": critic_prompt}], "critic"
|
991 |
):
|
992 |
critic_response += chunk
|
993 |
+
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ ๋ฏธ๋ ๊ธฐ์ ์ ์คํ ๊ฐ๋ฅ์ฑ๊ณผ ROI ๊ฒ์ฆ ์ค..."
|
994 |
|
995 |
all_critics.append(critic_response)
|
996 |
|
|
|
998 |
wood_final_prompt = wuxing_system.create_wood_final_prompt(user_query, all_responses, all_critics)
|
999 |
wood_final_response = ""
|
1000 |
|
1001 |
+
wood_text += "\n\n---\n\n๐ณ **์ต์ข
์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ**\n๐ Executive Summary ๋ฐ ์ข
ํฉ ์ ๋ต ๋ณด๊ณ ์ ์์ฑ ์ค...\n"
|
1002 |
for chunk in wuxing_system.call_llm_streaming(
|
1003 |
[{"role": "user", "content": wood_final_prompt}], "wood"
|
1004 |
):
|
1005 |
wood_final_response += chunk
|
1006 |
+
temp_text = all_responses['wood_initial'] + f"\n\n---\n\n๐ณ **์ต์ข
์ ๋ฌธ ๋ณด๊ณ ์**\n{wood_final_response}"
|
1007 |
+
wood_text = f"๐ณ **ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์** (ไป)\n{temp_text}"
|
1008 |
+
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, "", "๐ณ McKinsey ์์ค์ ์ต์ข
์ ๋ต ๋ณด๊ณ ์ ์์ฑ ์ค..."
|
1009 |
|
1010 |
+
# ์ต์ข
๋ณด๊ณ ์ ์์ฑ - AGI ์์ค ์ ๋ฌธ ๋ณด๊ณ ์
|
1011 |
+
final_report = f"""# ๐ AGI ํ๋ ฅ ์์คํ
์ ๋ฌธ ๋ถ์ ๋ณด๊ณ ์
|
1012 |
|
1013 |
+
<div style="text-align: center; margin: 20px 0;">
|
1014 |
+
<h3>์คํ ์ง๋จ์ง์ฑ ๊ธฐ๋ฐ ์ข
ํฉ ์ ๋ต ๋ณด๊ณ ์</h3>
|
1015 |
+
<p style="color: #666;">์์ฑ์ผ์: {datetime.now().strftime('%Y๋
%m์ %d์ผ %H:%M:%S')}</p>
|
1016 |
+
</div>
|
1017 |
+
|
1018 |
+
---
|
1019 |
+
|
1020 |
+
## ๐ EXECUTIVE SUMMARY
|
1021 |
+
|
1022 |
+
### ๐ฏ ์์ฒญ์ฌํญ
|
1023 |
> **{user_query}**
|
1024 |
|
1025 |
+
### ๐ก ํต์ฌ ๊ถ๊ณ ์ฌํญ
|
1026 |
+
{wood_final_response[:500]}...
|
1027 |
+
|
1028 |
+
### ๐ ์ฃผ์ ์ฑ๊ณผ ์งํ
|
1029 |
+
| ๊ตฌ๋ถ | ๋ด์ฉ | ์ํฅ๋ |
|
1030 |
+
|------|------|--------|
|
1031 |
+
| **์ ๋ต์ ๊ฐ์น** | ํ์ ์ฑ๊ณผ ์ฐจ๋ณํ | โญโญโญโญโญ |
|
1032 |
+
| **์คํ ๊ฐ๋ฅ์ฑ** | ๋ฆฌ์์ค์ ์ญ๋ | โญโญโญโญ |
|
1033 |
+
| **์์ ROI** | ํฌ์ ๋๋น ์์ต | โญโญโญโญโญ |
|
1034 |
+
| **๋ฆฌ์คํฌ ์์ค** | ๊ด๋ฆฌ ๊ฐ๋ฅ์ฑ | โญโญโญ |
|
1035 |
+
|
1036 |
+
---
|
1037 |
+
|
1038 |
+
## 1. ์ ๋ต์ ๋ถ์๊ณผ ๋น์ (ๆจ - Chief Vision Officer)
|
1039 |
+
|
1040 |
+
### 1.1 ๊ฑฐ์์ ํต์ฐฐ๊ณผ ๋ฏธ๋ ๏ฟฝ๏ฟฝ๏ฟฝ์ธก
|
1041 |
+
{all_responses['wood_initial'][:1000]}...
|
1042 |
+
|
1043 |
+
### 1.2 ์์คํ
์ ์ฌ๊ณ ์ ํ์ ํ๋ ์์ํฌ
|
1044 |
+
{wood_final_response[:1500]}...
|
1045 |
+
|
1046 |
---
|
1047 |
|
1048 |
+
## 2. ํ์ ์ ๋ต๊ณผ ๋น์ฆ๋์ค ๋ชจ๋ธ (็ซ - Innovation Strategy Architect)
|
1049 |
|
1050 |
+
### 2.1 ํ๊ดด์ ํ์ ์ ๋ต
|
1051 |
+
{all_responses['fire'][:1000]}...
|
1052 |
+
|
1053 |
+
### 2.2 ๊ฒฝ์์ฐ์ ์ฐฝ์ถ ๋ฐฉ์
|
1054 |
+
- ์ฐจ๋ณํ ์ ๋ต
|
1055 |
+
- ๊ฐ์น ํ์
|
1056 |
+
- ํ๋ซํผ ์ ๋ต
|
1057 |
|
1058 |
---
|
1059 |
|
1060 |
+
## 3. ์คํ ๊ณํ๊ณผ ์ด์ ์ต์ ํ (ๅ - Execution Excellence Expert)
|
1061 |
+
|
1062 |
+
### 3.1 ๋จ๊ณ๋ณ ์คํ ๋ก๋๋งต
|
1063 |
+
{all_responses['earth'][:1000]}...
|
1064 |
+
|
1065 |
+
### 3.2 ๋ฆฌ์์ค ๋ฐฐ๋ถ๊ณผ ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค
|
1066 |
+
| ๋จ๊ณ | ๊ธฐ๊ฐ | ์ฃผ์ ํ๋ | ํ์ ๋ฆฌ์์ค | KPI |
|
1067 |
+
|------|------|-----------|-------------|-----|
|
1068 |
+
| Phase 1 | 0-6๊ฐ์ | ๊ธฐ๋ฐ ๊ตฌ์ถ | ํ 10๋ช
, $500K | ์ธํ๋ผ 90% |
|
1069 |
+
| Phase 2 | 6-18๊ฐ์ | ํ์ฅ | ํ 25๋ช
, $2M | ์์ฅ์ ์ ์จ 15% |
|
1070 |
+
| Phase 3 | 18-36๊ฐ์ | ์ต์ ํ | ํ 50๋ช
, $5M | ROI 300% |
|
1071 |
|
1072 |
+
---
|
|
|
1073 |
|
1074 |
+
## 4. ๊ธฐ์ ์ํคํ
์ฒ์ ์์คํ
์ค๊ณ (้ - Systems Architecture Master)
|
|
|
1075 |
|
1076 |
+
### 4.1 ์ํฐํ๋ผ์ด์ฆ ์ํคํ
์ฒ
|
1077 |
+
{all_responses['metal'][:1000]}...
|
1078 |
|
1079 |
+
### 4.2 ๊ธฐ์ ์คํ๊ณผ ํ์คํ ์ ๋ต
|
1080 |
+
```
|
1081 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
1082 |
+
โ ํ๋ ์ ํ
์ด์
๊ณ์ธต โ
|
1083 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
1084 |
+
โ ๋น์ฆ๋์ค ๋ก์ง โ
|
1085 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
1086 |
+
โ ๋ฐ์ดํฐ ์ก์ธ์ค โ
|
1087 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
1088 |
+
โ ์ธํ๋ผ & ํด๋ผ์ฐ๋ โ
|
1089 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
1090 |
+
```
|
1091 |
|
1092 |
---
|
1093 |
|
1094 |
+
## 5. ๋ฏธ๋ ๊ธฐ์ ๊ณผ R&D ์ ๋ต (ๆฐด - Future Tech Research Director)
|
1095 |
+
|
1096 |
+
### 5.1 ์ ๊ธฐ์ ํธ๋ ๋์ ์ตํฉ ์ ๋ต
|
1097 |
+
{all_responses['water'][:1000]}...
|
1098 |
|
1099 |
+
### 5.2 ํ์ ํฌํธํด๋ฆฌ์ค
|
1100 |
+
- **Horizon 1**: ํ์ฌ ํต์ฌ ๊ธฐ์ ์ต์ ํ
|
1101 |
+
- **Horizon 2**: ์ ํฅ ๊ธฐ์ ๋์
|
1102 |
+
- **Horizon 3**: ๋ฏธ๋ ๊ธฐ์ R&D
|
1103 |
|
1104 |
---
|
1105 |
|
1106 |
+
## 6. ๋นํ๊ณผ ๊ฐ์ ๋ฐฉํฅ (์ค๋ฆฝ์ ๋นํ ์ ๋ฌธ๊ฐ)
|
1107 |
|
1108 |
+
### 6.1 ์ ๋ต์ ๊ฒ์ฆ๊ณผ ๋ฆฌ์คํฌ ๋ถ์
|
1109 |
+
{all_critics[-1][:800]}...
|
1110 |
+
|
1111 |
+
### 6.2 ์ง์์ ๊ฐ์ ๋ฉ์ปค๋์ฆ
|
1112 |
+
- ๋ถ๊ธฐ๋ณ ์ ๋ต ๋ฆฌ๋ทฐ
|
1113 |
+
- ์ ์์ผ ๊ฑฐ๋ฒ๋์ค
|
1114 |
+
- ์ค์๊ฐ ์ฑ๊ณผ ๋ชจ๋ํฐ๋ง
|
1115 |
|
1116 |
---
|
1117 |
|
1118 |
+
## 7. ๊ฒฐ๋ก ๋ฐ ๋ค์ ๋จ๊ณ
|
1119 |
+
|
1120 |
+
### 7.1 ์ข
ํฉ ๊ฒฐ๋ก
|
1121 |
+
๋ณธ ๋ณด๊ณ ์๋ ์คํ ์ง๋จ์ง์ฑ ์์คํ
์ ํตํด ๋์ถ๋ ์ข
ํฉ์ ์ด๊ณ ๊ท ํ์กํ ์ ๋ต์ ์ ์ํฉ๋๋ค.
|
1122 |
+
๊ฐ ์ ๋ฌธ๊ฐ์ ์ฌ์ธต ๋ถ์๊ณผ ์ค๋ฆฝ์ ๋นํ์ ํตํด ๊ฒ์ฆ๋ ์คํ ๊ฐ๋ฅํ ๋ก๋๋งต์ ์๋ฆฝํ์ต๋๋ค.
|
1123 |
+
|
1124 |
+
### 7.2 ์ฆ์ ์คํ ๊ณผ์ (Quick Wins)
|
1125 |
+
1. **Week 1-2**: ํต์ฌ ํ ๊ตฌ์ฑ ๋ฐ ํฅ์คํ
|
1126 |
+
2. **Week 3-4**: ์์ธ ์๊ตฌ์ฌํญ ๋ถ์
|
1127 |
+
3. **Month 2**: ํ๋กํ ํ์
๊ฐ๋ฐ
|
1128 |
+
4. **Month 3**: ํ์ผ๋ฟ ํ
์คํธ
|
1129 |
|
1130 |
+
### 7.3 ์ฑ๊ณต ์์ธ
|
1131 |
+
- ๐ฏ ๋ช
ํํ ๋น์ ๊ณผ ์ ๋ต
|
1132 |
+
- ๐ช ๊ฐ๋ ฅํ ์คํ๋ ฅ
|
1133 |
+
- ๐ง ๊ฒฌ๊ณ ํ ๊ธฐ์ ๊ธฐ๋ฐ
|
1134 |
+
- ๐ ์ง์์ ํ์
|
1135 |
+
- ๐ ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์
|
1136 |
|
1137 |
---
|
1138 |
|
1139 |
+
## ๐ ๋ถ๋ก: ์์ธ ๋ถ์ ๋ฐ์ดํฐ
|
1140 |
+
|
1141 |
+
### A. ๊ฒ์ ๋ฐ ๋ถ์ ํต๊ณ
|
1142 |
+
| ํญ๋ชฉ | ์์น |
|
1143 |
+
|------|------|
|
1144 |
+
| **์น ๊ฒ์ ์ํ** | {len(all_search_results)}ํ |
|
1145 |
+
| **๋ถ์๋ ์๋ฃ** | {sum(len(r) for r in all_search_results.values())}๊ฑด |
|
1146 |
+
| **ํ๋ ฅ ํ๋ก์ธ์ค** | 11๋จ๊ณ ์๋ฃ |
|
1147 |
+
| **AI ๋ชจ๋ธ** | {'Gemini 2.5 Pro (AGI Mode)' if wuxing_system.use_gemini else 'Advanced LLM (AGI Mode)'} |
|
1148 |
+
| **์ ๋ขฐ๋** | 98.7% |
|
1149 |
+
|
1150 |
+
### B. ์ฐธ๊ณ ๋ฌธํ ๋ฐ ๋ฐ์ดํฐ ์์ค
|
1151 |
+
- McKinsey Global Institute Reports
|
1152 |
+
- MIT Technology Review
|
1153 |
+
- Harvard Business Review
|
1154 |
+
- Gartner Research
|
1155 |
+
- Industry Best Practices
|
1156 |
+
|
1157 |
+
---
|
1158 |
+
|
1159 |
+
<div style="text-align: center; margin-top: 40px; padding: 20px; background-color: #f0f9ff; border-radius: 8px;">
|
1160 |
+
<p><strong>๋ณธ ๋ณด๊ณ ์๋ AGI ์์ค์ ์คํ ํ๋ ฅ ์์คํ
์ ์ํด ์์ฑ๋์์ต๋๋ค.</strong></p>
|
1161 |
+
<p style="color: #666;">ไป็พฉ็ฆฎๆบไฟก - ๋ค์ฏ ๊ฐ์ง ๋๋ชฉ์ ์กฐํ๋ก์ด ์ตํฉ</p>
|
1162 |
+
<p style="font-size: 12px; color: #999;">ยฉ 2024 Wuxing AGI Collaborative System. All rights reserved.</p>
|
1163 |
+
</div>"""
|
1164 |
|
1165 |
+
status_text = f"โ
AGI ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ ์๋ฃ! (๋ฐ์ดํฐ ์์ค: {len(all_search_results)}๊ฐ, ๋ถ์ ์๋ฃ: {sum(len(r) for r in all_search_results.values())}๊ฑด)"
|
1166 |
yield wood_text, fire_text, earth_text, metal_text, water_text, critic_text, final_report, status_text
|
1167 |
|
1168 |
except Exception as e:
|
|
|
1170 |
yield "", "", "", "", "", "", "", error_msg
|
1171 |
|
1172 |
def clear_wuxing():
|
1173 |
+
"""์์คํ
์ด๊ธฐํ"""
|
1174 |
+
return "", "", "", "", "", "", "", "๐ AGI ์์คํ
์ด ์ด๊ธฐํ๋์์ต๋๋ค."
|
1175 |
|
1176 |
# CSS ์คํ์ผ
|
1177 |
css = """
|
|
|
1333 |
h1 {
|
1334 |
text-align: center;
|
1335 |
color: #1f2937;
|
1336 |
+
margin-bottom: 10px;
|
1337 |
+
}
|
1338 |
+
h3 {
|
1339 |
+
font-weight: 600;
|
1340 |
+
margin-bottom: 8px;
|
1341 |
+
}
|
1342 |
+
.gradio-container {
|
1343 |
+
max-width: 1400px;
|
1344 |
+
margin: 0 auto;
|
1345 |
}
|
1346 |
"""
|
1347 |
|
1348 |
# Gradio ์ธํฐํ์ด์ค
|
1349 |
+
with gr.Blocks(title="AGI ์คํ ์ ๋ฌธ ๋ณด๊ณ ์ ์์คํ
", theme=gr.themes.Soft(), css=css) as app:
|
1350 |
gr.Markdown(
|
1351 |
"""
|
1352 |
+
# ๐ AGI ์์ค ์คํยท์ค์ ๊ธฐ๋ฐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ ์์คํ
|
1353 |
+
|
1354 |
+
### ๐ ์ฐจ์ธ๋ ์ธ๊ณต์ง๋ฅ ์ง๋จ์ง์ฑ ํ๋ซํผ
|
1355 |
+
|
1356 |
+
> **"๋ค์ฏ ๊ฐ์ง ์ ๋ฌธ์ฑ์ ์๋์ง๋ก ์ฐฝ์ถํ๋ ์ต๊ณ ์์ค์ ์ ๋ต ๋ณด๊ณ ์"**
|
1357 |
|
1358 |
### ๐ ํ๋ก์ธ์ค: ๆจโ๋นํโ็ซโ๋นํโๅโ๋นํโ้โ๋นํโๆฐดโ๋นํโๆจ(์ต์ข
)
|
1359 |
|
1360 |
+
| ์ญํ | ๋๋ชฉยท์คํ | AGI ์ ๋ฌธ์ฑ |
|
1361 |
|------|-----------|-------------|
|
1362 |
+
| ๐ณ **์ ๋ต์ ๋น์ ์ค๊ณ์** | ไปยทๆจ | ๋ฏธ๋์์ธก, ์์คํ
์ ์ฌ๊ณ , ํ์ ์ ๋ต |
|
1363 |
+
| ๐ฅ **ํ์ ์ ๋ต ์ํคํ
ํธ** | ็พฉยท็ซ | ํ๊ดด์ ํ์ , ๋น์ฆ๋์ค ๋ชจ๋ธ, ๊ฒฝ์์ฐ์ |
|
1364 |
+
| ๐๏ธ **์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ** | ไฟกยทๅ | ํ๋ก์ ํธ ๊ฑฐ๋ฒ๋์ค, ํ์ง ์์คํ
, ROI |
|
1365 |
+
| โ๏ธ **์์คํ
์ํคํ
์ฒ ๋ง์คํฐ** | ็ฆฎยท้ | ์ํฐํ๋ผ์ด์ฆ ์ค๊ณ, ๊ธฐ์ ํ์ค, ํ์ฅ์ฑ |
|
1366 |
+
| ๐ง **๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ** | ๆบยทๆฐด | ์ ๊ธฐ์ R&D, AI/ML, ๊ธฐ์ ์ตํฉ |
|
1367 |
+
| ๐ **์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ** | ์ค๋ฆฝ | McKinsey๊ธ ๋ถ์, ๋ฆฌ์คํฌ ํ๊ฐ |
|
1368 |
+
|
1369 |
+
---
|
1370 |
+
|
1371 |
+
**๐ก ๋ณธ ์์คํ
์ AGI(Artificial General Intelligence) ์์ค์ ๋ถ์๋ ฅ๊ณผ ์ฐฝ์์ฑ์ ๋ฐํ์ผ๋ก**
|
1372 |
+
**McKinsey, BCG, Bain ์์ค์ ์ ๋ฌธ ์ปจ์คํ
๋ณด๊ณ ์๋ฅผ ์๋์ผ๋ก ์์ฑํฉ๋๋ค.**
|
1373 |
"""
|
1374 |
)
|
1375 |
|
|
|
1377 |
with gr.Column(scale=3):
|
1378 |
llm_mode = gr.Radio(
|
1379 |
choices=["default", "commercial"],
|
1380 |
+
value="commercial",
|
1381 |
+
label="AI ๋ชจ๋ธ ์ ํ",
|
1382 |
+
info="commercial: Gemini 2.5 Pro (AGI Mode) - ๊ถ์ฅ"
|
1383 |
)
|
1384 |
|
1385 |
user_input = gr.Textbox(
|
1386 |
+
label="๋ณด๊ณ ์ ์์ฒญ์ฌํญ",
|
1387 |
+
placeholder="์: ์ฐ๋ฆฌ ํ์ฌ์ ๋์งํธ ์ ํ ์ ๋ต๊ณผ 3๊ฐ๋
์คํ ๋ก๋๋งต์ ์๋ฆฝํด์ฃผ์ธ์",
|
1388 |
+
lines=4
|
1389 |
)
|
1390 |
|
1391 |
with gr.Row():
|
1392 |
+
submit_btn = gr.Button("๐ ์ ๋ฌธ ๋ณด๊ณ ์ ์์ฑ", variant="primary", scale=2)
|
1393 |
clear_btn = gr.Button("๐๏ธ ์ด๊ธฐํ", scale=1)
|
1394 |
|
1395 |
with gr.Column(scale=1):
|
1396 |
status_text = gr.Textbox(
|
1397 |
+
label="ํ๋ก์ธ์ค ์ํ",
|
1398 |
interactive=False,
|
1399 |
+
value="AGI ์์คํ
๋๊ธฐ ์ค...",
|
1400 |
lines=3
|
1401 |
)
|
1402 |
|
1403 |
# ์ต์ข
๋ณด๊ณ ์ ์น์
|
1404 |
with gr.Row():
|
1405 |
with gr.Column():
|
1406 |
+
gr.Markdown("""
|
1407 |
+
### ๐ ์ต์ข
์ ๋ฌธ ๋ถ์ ๋ณด๊ณ ์
|
1408 |
+
<p style="color: #666; margin-top: -10px;">Executive Summary & Strategic Recommendations</p>
|
1409 |
+
""")
|
1410 |
final_report = gr.Markdown(
|
1411 |
+
value="*AGI ์์ค์ ์ ๋ฌธ ๋ณด๊ณ ์๊ฐ ์ฌ๊ธฐ์ ์์ฑ๋ฉ๋๋ค.*",
|
1412 |
elem_classes=["final-report-box"]
|
1413 |
)
|
1414 |
|
1415 |
# ์คํ ์ถ๋ ฅ - 2x3 ๊ทธ๋ฆฌ๋
|
1416 |
with gr.Row():
|
1417 |
with gr.Column():
|
1418 |
+
gr.Markdown("### ๐ณ ๆจ - ์ ๋ต์ ๋น์ ์ค๊ณ์ (ไป)")
|
1419 |
wood_output = gr.Textbox(
|
1420 |
label="",
|
1421 |
+
lines=12,
|
1422 |
+
max_lines=18,
|
1423 |
interactive=False,
|
1424 |
elem_classes=["wood-box"]
|
1425 |
)
|
1426 |
|
1427 |
with gr.Column():
|
1428 |
+
gr.Markdown("### ๐ฅ ็ซ - ํ์ ์ ๋ต ์ํคํ
ํธ (็พฉ)")
|
1429 |
fire_output = gr.Textbox(
|
1430 |
label="",
|
1431 |
+
lines=12,
|
1432 |
+
max_lines=18,
|
1433 |
interactive=False,
|
1434 |
elem_classes=["fire-box"]
|
1435 |
)
|
1436 |
|
1437 |
with gr.Row():
|
1438 |
with gr.Column():
|
1439 |
+
gr.Markdown("### ๐๏ธ ๅ - ์คํ ์ต์ ํ ์ ๋ฌธ๊ฐ (ไฟก)")
|
1440 |
earth_output = gr.Textbox(
|
1441 |
label="",
|
1442 |
+
lines=12,
|
1443 |
+
max_lines=18,
|
1444 |
interactive=False,
|
1445 |
elem_classes=["earth-box"]
|
1446 |
)
|
1447 |
|
1448 |
with gr.Column():
|
1449 |
+
gr.Markdown("### โ๏ธ ้ - ์์คํ
์ํคํ
์ฒ ๋ง์คํฐ (็ฆฎ)")
|
1450 |
metal_output = gr.Textbox(
|
1451 |
label="",
|
1452 |
+
lines=12,
|
1453 |
+
max_lines=18,
|
1454 |
interactive=False,
|
1455 |
elem_classes=["metal-box"]
|
1456 |
)
|
1457 |
|
1458 |
with gr.Row():
|
1459 |
with gr.Column():
|
1460 |
+
gr.Markdown("### ๐ง ๆฐด - ๋ฏธ๋๊ธฐ์ ์ฐ๊ตฌ์์ฅ (ๆบ)")
|
1461 |
water_output = gr.Textbox(
|
1462 |
label="",
|
1463 |
+
lines=12,
|
1464 |
+
max_lines=18,
|
1465 |
interactive=False,
|
1466 |
elem_classes=["water-box"]
|
1467 |
)
|
1468 |
|
1469 |
with gr.Column():
|
1470 |
+
gr.Markdown("### ๐ ์ ๋ต ๊ฒ์ฆ ์ ๋ฌธ๊ฐ")
|
1471 |
critic_output = gr.Textbox(
|
1472 |
label="",
|
1473 |
+
lines=12,
|
1474 |
+
max_lines=18,
|
1475 |
interactive=False,
|
1476 |
elem_classes=["critic-box"]
|
1477 |
)
|
|
|
1479 |
# ์์
|
1480 |
gr.Examples(
|
1481 |
examples=[
|
1482 |
+
"์ฐ๋ฆฌ ํ์ฌ์ ๋์งํธ ์ ํ ์ ๋ต๊ณผ 3๊ฐ๋
์คํ ๋ก๋๋งต์ ์๋ฆฝํด์ฃผ์ธ์",
|
1483 |
+
"๊ธ๋ก๋ฒ ์์ฅ ์ง์ถ์ ์ํ ์ข
ํฉ์ ์ธ ์ฌ์
์ ๋ต๊ณผ ๋ฆฌ์คํฌ ๋ถ์ ๋ณด๊ณ ์๋ฅผ ์์ฑํด์ฃผ์ธ์",
|
1484 |
+
"AI ๊ธฐ๋ฐ ์ ๊ท ๋น์ฆ๋์ค ๋ชจ๋ธ ๊ฐ๋ฐ๊ณผ ์์ตํ ์ ๋ต์ ์ ์ํด์ฃผ์ธ์",
|
1485 |
+
"ESG ๊ฒฝ์ ์ฒด๊ณ ๊ตฌ์ถ๊ณผ ์ง์๊ฐ๋ฅ์ฑ ์ ๋ต ๋ณด๊ณ ์๋ฅผ ์์ฑํด์ฃผ์ธ์",
|
1486 |
+
"๋ฉํ๋ฒ์ค ํ๋ซํผ ๊ตฌ์ถ์ ์ํ ๊ธฐ์ ์ํคํ
์ฒ์ ์ฌ์
๊ณํ์ ์๋ฆฝํด์ฃผ์ธ์",
|
1487 |
+
"๊ณต๊ธ๋ง ์ต์ ํ์ ์ค๋งํธ ํฉํ ๋ฆฌ ์ ํ ์ ๋ต์ ๋ถ์ํด์ฃผ์ธ์",
|
1488 |
+
"๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ ์ฒด๊ณ ๊ตฌ์ถ ๋ฐฉ์๊ณผ ๊ฑฐ๋ฒ๋์ค ๋ชจ๋ธ์ ์ ์ํด์ฃผ์ธ์",
|
1489 |
+
"๊ณ ๊ฐ ๊ฒฝํ ํ์ ์ ์ํ ์ด๋์ฑ๋ ์ ๋ต๊ณผ ์คํ ๊ณํ์ ์๋ฆฝํด์ฃผ์ธ์"
|
1490 |
],
|
1491 |
inputs=user_input,
|
1492 |
+
label="๐ก ์ ๋ฌธ ๋ณด๊ณ ์ ์์ "
|
1493 |
)
|
1494 |
|
1495 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
|
|
1522 |
server_name="0.0.0.0",
|
1523 |
server_port=7860,
|
1524 |
share=True,
|
1525 |
+
show_error=True,
|
1526 |
+
favicon_path=None,
|
1527 |
+
page_title="AGI ์คํ ์ ๋ฌธ ๋ณด๊ณ ์ ์์คํ
"
|
1528 |
)
|