pizb commited on
Commit
97f15a5
Β·
verified Β·
1 Parent(s): 45b56f4

Upload folder using huggingface_hub

Browse files
create_character/prsonal_profile(gradio).py CHANGED
@@ -41,6 +41,7 @@ def generate_character_creation_questions(api_key, world_summary, language="kore
41
  print(f"Error generating questions: {e}")
42
  continue
43
 
 
44
  def create_character_profile(api_key, questions, answers, language="korean"):
45
  llm = ChatUpstage(api_key=api_key)
46
  character_creation_prompt_template = PromptTemplate.from_template(
@@ -75,6 +76,7 @@ def create_character_profile(api_key, questions, answers, language="korean"):
75
  character_description = character_creation_chain.invoke({"qna": qna, "Language": language})
76
  return character_description
77
 
 
78
  def parse_character_data_to_json(text):
79
  fields = {
80
  'name': r"- name: (.*)",
@@ -103,6 +105,7 @@ def parse_character_data_to_json(text):
103
  character_dict['params'] = params_dict
104
  return character_dict
105
 
 
106
  def run_question_generation(api_key, file_path):
107
  # Read the world summary from the uploaded file
108
  with open(file_path, 'r', encoding='utf-8') as file:
@@ -113,6 +116,7 @@ def run_question_generation(api_key, file_path):
113
 
114
  return questions
115
 
 
116
  def run_profile_generation(api_key, file_path, *answers):
117
  questions = run_question_generation(api_key, file_path)
118
 
@@ -121,6 +125,7 @@ def run_profile_generation(api_key, file_path, *answers):
121
  character_json = parse_character_data_to_json(character_description)
122
  return character_description, json.dumps(character_json, indent=4, ensure_ascii=False)
123
 
 
124
  def main():
125
  with gr.Blocks() as demo:
126
  gr.Markdown("## Fantasy RPG Character Creator")
@@ -166,5 +171,6 @@ def main():
166
  # Launch the Gradio interface
167
  demo.launch()
168
 
 
169
  if __name__ == "__main__":
170
  main()
 
41
  print(f"Error generating questions: {e}")
42
  continue
43
 
44
+
45
  def create_character_profile(api_key, questions, answers, language="korean"):
46
  llm = ChatUpstage(api_key=api_key)
47
  character_creation_prompt_template = PromptTemplate.from_template(
 
76
  character_description = character_creation_chain.invoke({"qna": qna, "Language": language})
77
  return character_description
78
 
79
+
80
  def parse_character_data_to_json(text):
81
  fields = {
82
  'name': r"- name: (.*)",
 
105
  character_dict['params'] = params_dict
106
  return character_dict
107
 
108
+
109
  def run_question_generation(api_key, file_path):
110
  # Read the world summary from the uploaded file
111
  with open(file_path, 'r', encoding='utf-8') as file:
 
116
 
117
  return questions
118
 
119
+
120
  def run_profile_generation(api_key, file_path, *answers):
121
  questions = run_question_generation(api_key, file_path)
122
 
 
125
  character_json = parse_character_data_to_json(character_description)
126
  return character_description, json.dumps(character_json, indent=4, ensure_ascii=False)
127
 
128
+
129
  def main():
130
  with gr.Blocks() as demo:
131
  gr.Markdown("## Fantasy RPG Character Creator")
 
171
  # Launch the Gradio interface
172
  demo.launch()
173
 
174
+
175
  if __name__ == "__main__":
176
  main()
demo.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
 
3
  from create_world.creator_gradio import create_custom_world, create_scenario, create_storyline
4
  from create_world.utils import load_txt
@@ -10,11 +11,6 @@ from play_game.formatter import player_profile_to_str, to_round_result
10
  # 2. Character Creation
11
  # 3. Game Play
12
 
13
- # topic, world_summary = create_custom_world(config['create_custom_world_prompt'], language='ν•œκ΅­μ–΄', save=False)
14
- # scenario = create_scenario(topic, world_summary, config['create_scenario_prompt'], output_count=1)
15
- # round_stories = create_storyline(topic, scenario[0], config['create_storyline_prompt'])
16
-
17
-
18
  def main():
19
  with gr.Blocks() as demo:
20
  gr.Markdown("## LRPG")
@@ -109,11 +105,12 @@ def main():
109
  game_start_btn = gr.Button("κ²Œμž„ μ‹œμž‘")
110
 
111
  def click_game_start_btn():
112
- return { round: 1, player_restriction: { "life": 30, "money": 30 }, player_capability: _player_profile["params"] }
113
  game_start_btn.click(fn=click_game_start_btn, outputs=[round, player_restriction, player_capability])
114
  else:
115
  round_story = f"{_round}. {round_scenario['title']}: {round_scenario['story']}\n"
116
  if _player_restriction["life"] <= 0 or _player_restriction["money"] <= 0:
 
117
  bad_ending = create_bad_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
118
  display_bad_ending = gr.Markdown(bad_ending)
119
  restart_button = gr.Button("λ‹€μ‹œ μ‹œμž‘ν•˜κΈ°")
@@ -122,6 +119,7 @@ def main():
122
  restart_button.click(fn=click_restart_button, outputs=[round, player_restriction, player_capability, previous_conversation, previous_round_result])
123
 
124
  elif _round >= len(_stories):
 
125
  good_ending = create_good_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, _previous_conversation)
126
  display_good_ending = gr.Markdown(good_ending)
127
  restart_button = gr.Button("λ‹€μ‹œ μ‹œμž‘ν•˜κΈ°")
@@ -198,6 +196,17 @@ def main():
198
  outputs=[round, previous_conversation, previous_round_result, player_restriction, player_capability]
199
  )
200
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
  # # For Debugging
203
  # game_topic_debugging = gr.Textbox(game_topic.value, label="game_topic_debugging")
 
1
  import gradio as gr
2
+ import re
3
 
4
  from create_world.creator_gradio import create_custom_world, create_scenario, create_storyline
5
  from create_world.utils import load_txt
 
11
  # 2. Character Creation
12
  # 3. Game Play
13
 
 
 
 
 
 
14
  def main():
15
  with gr.Blocks() as demo:
16
  gr.Markdown("## LRPG")
 
105
  game_start_btn = gr.Button("κ²Œμž„ μ‹œμž‘")
106
 
107
  def click_game_start_btn():
108
+ return { round: 1, player_restriction: { "life": 20, "money": 20 }, player_capability: _player_profile["params"] }
109
  game_start_btn.click(fn=click_game_start_btn, outputs=[round, player_restriction, player_capability])
110
  else:
111
  round_story = f"{_round}. {round_scenario['title']}: {round_scenario['story']}\n"
112
  if _player_restriction["life"] <= 0 or _player_restriction["money"] <= 0:
113
+ gr.Markdown("## μ•„μ‰½κ²Œλ„ κ²Œμž„ μ˜€λ²„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ‹€λ₯Έ 선택을 톡해 μƒˆλ‘œμš΄ μ΄μ•ΌκΈ°μ˜ 결말을 λ§Œλ“€μ–΄λ³΄μ„Έμš”.")
114
  bad_ending = create_bad_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
115
  display_bad_ending = gr.Markdown(bad_ending)
116
  restart_button = gr.Button("λ‹€μ‹œ μ‹œμž‘ν•˜κΈ°")
 
119
  restart_button.click(fn=click_restart_button, outputs=[round, player_restriction, player_capability, previous_conversation, previous_round_result])
120
 
121
  elif _round >= len(_stories):
122
+ gr.Markdown("## μΆ•ν•˜ν•©λ‹ˆλ‹€! κ²Œμž„ 클리어에 μ„±κ³΅ν•˜μ…¨μŠ΅λ‹ˆλ‹€")
123
  good_ending = create_good_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, _previous_conversation)
124
  display_good_ending = gr.Markdown(good_ending)
125
  restart_button = gr.Button("λ‹€μ‹œ μ‹œμž‘ν•˜κΈ°")
 
196
  outputs=[round, previous_conversation, previous_round_result, player_restriction, player_capability]
197
  )
198
 
199
+ player_status_display = gr.Markdown(f"## {re.sub(r'\"', '', _player_profile['name'])}λ‹˜μ˜ μƒνƒœ")
200
+ with gr.Group():
201
+ with gr.Row():
202
+ gr.Textbox(_player_restriction['life'], interactive=False, label="λͺ©μˆ¨")
203
+ gr.Textbox(_player_restriction['money'], interactive=False, label="μ†Œμ§€κΈˆ")
204
+ with gr.Row():
205
+ gr.Textbox(_player_capability["stamina"], interactive=False, label="μŠ€νƒœλ―Έλ„ˆ")
206
+ gr.Textbox(_player_capability["intelligence"], interactive=False, label="μ§€λŠ₯")
207
+ gr.Textbox(_player_capability["combat_power"], interactive=False, label="μ „νˆ¬λ ₯")
208
+ gr.Textbox(_player_capability["agility"], interactive=False, label="민첩성")
209
+
210
 
211
  # # For Debugging
212
  # game_topic_debugging = gr.Textbox(game_topic.value, label="game_topic_debugging")
play_game/main.py CHANGED
@@ -155,6 +155,25 @@ def get_required_capabilities(world_summary, player_profile, player_restriction,
155
  continue
156
 
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  def get_expected_result(world_summary, player_profile, player_restriction, player_capability, round_description, player_response):
159
  llm = ChatUpstage()
160
  prompt_template = PromptTemplate.from_template(
@@ -212,7 +231,8 @@ def get_expected_result(world_summary, player_profile, player_restriction, playe
212
 
213
  if response.get('effect').get('player_restriction') == None or response.get("effect").get('player_capability') == None or response.get("reason") == None:
214
  raise Exception()
215
-
 
216
  return response
217
  except:
218
  continue
@@ -280,6 +300,7 @@ def get_unexpected_result(world_summary, player_profile, player_restriction, pla
280
  if response.get('effect').get('player_restriction') == None or response.get("effect").get('player_capability') == None or response.get("reason") == None:
281
  raise Exception()
282
 
 
283
  return response
284
  except:
285
  continue
 
155
  continue
156
 
157
 
158
+ def restrict_effect_range(effect):
159
+ new_restriction = effect.get('player_restriction')
160
+ new_capability = effect.get('player_capability')
161
+
162
+ for key, value in effect.get('player_restriction').items():
163
+ if value > 10:
164
+ new_restriction[key] = 10
165
+ elif value < -10:
166
+ new_capability[key] = -10
167
+
168
+ for key, value in effect.get('player_capability').items():
169
+ if value > 20:
170
+ new_capability[key] = 20
171
+ elif value < -20:
172
+ new_capability[key] = -20
173
+
174
+ return { "player_restriction": new_restriction, "player_capability": new_capability }
175
+
176
+
177
  def get_expected_result(world_summary, player_profile, player_restriction, player_capability, round_description, player_response):
178
  llm = ChatUpstage()
179
  prompt_template = PromptTemplate.from_template(
 
231
 
232
  if response.get('effect').get('player_restriction') == None or response.get("effect").get('player_capability') == None or response.get("reason") == None:
233
  raise Exception()
234
+
235
+ response['effect'] = restrict_effect_range(response['effect'])
236
  return response
237
  except:
238
  continue
 
300
  if response.get('effect').get('player_restriction') == None or response.get("effect").get('player_capability') == None or response.get("reason") == None:
301
  raise Exception()
302
 
303
+ response['effect'] = restrict_effect_range(response['effect'])
304
  return response
305
  except:
306
  continue
tutle_game.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from create_world.creator import generate_chain
2
+ from create_world.utils import save_json
3
+
4
+ from tutle_game_prompt import sys_prompt, game_prompt
5
+
6
+ from langchain_upstage import ChatUpstage
7
+
8
+ import ast
9
+
10
+ from dotenv import load_dotenv
11
+ load_dotenv()
12
+
13
+
14
+ def create_tutle_game_scenario(llm=ChatUpstage()):
15
+ prompt = sys_prompt
16
+ while(True):
17
+ try:
18
+ storyline = generate_chain(prompt, prompt_variable={}, llm=llm)
19
+ storyline_dict= ast.literal_eval(storyline)
20
+ return storyline_dict
21
+ except:
22
+ continue
23
+
24
+
25
+ def tutle_game_qa(question, storyline_dict, llm):
26
+ prompt = game_prompt
27
+ prompt_variable = {'question': question,
28
+ 'game_story' :storyline_dict['game_story'],
29
+ 'game_answer':storyline_dict['game_answer']}
30
+
31
+ return generate_chain(prompt, prompt_variable, llm =llm)
32
+
33
+
34
+ if __name__ == '__main__':
35
+ story_dict = create_tutle_game_scenario()
36
+ print(story_dict)
37
+ chance = 1
38
+
39
+ for i in range(chance):
40
+ question = input('μ§ˆλ¬Έμ„ μž…λ ₯ν•˜μ„Έμš” :')
41
+ tutle_game_qa(question, story_dict)
tutle_game_prompt.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sys_prompt = """바닀거뢁 μŠ€ν”„ κ²Œμž„μ„ ν•œλ‹€.
2
+ AIλŠ” μΆœμ œμžμ΄λ‹€.
3
+ λŒ€ν™”μžλŠ” κ²Œμž„ μ°Έκ°€μžμ΄λ‹€.
4
+
5
+ κ²Œμž„μ˜ 방법은 μ•„λž˜μ™€ κ°™λ‹€.
6
+ 1. μΆœμ œμžκ°€ (이야기 ν˜•μ‹μ˜) 수수께끼(Game Story)λ₯Ό λ§Œλ“€μ–΄ μΆœμ œν•œλ‹€.
7
+ 2. μ°Έκ°€μžλ“€μ€ μΆœμ œμžμ—κ²Œ 슀무고개 ν˜•μ‹μ˜ μ§ˆλ¬Έν•˜κ³ , μΆœμ œμžλŠ” 그에 λŒ€ν•œ λŒ€λ‹΅μ„ ν•œλ‹€.
8
+ 3. 정보λ₯Ό 톡해 μ°Έκ°€μžλ“€μ€ μ΄μ•ΌκΈ°μ˜ 전말을 μΆ”λ¦¬ν•œλ‹€.
9
+ 4. μ°Έκ°€μžκ°€ 정닡을 λ§žμΆ”λ©΄ κ²Œμž„μ΄ λλ‚œλ‹€.
10
+ 5. μ°Έκ°€μžμ˜ 질문이 정닡에 κ·Όμ ‘ν•˜λ©΄ 힌트λ₯Ό μ€€λ‹€.
11
+ 5. 5번의 μ§ˆλ¬Έμ—λ„ 닡을 λ§žμΆ”μ§€ λͺ»ν•˜λ©΄ μΆœμ œμžλŠ” μ •λ‹΅(answer) κ³΅κ°œν•œλ‹€.
12
+
13
+ κ²Œμž„μ˜ μŠ€ν† λ¦¬μ™€ μ˜ˆμ‹œμ΄λ‹€.
14
+ κ·Έ λ¬Έμ œλŠ” λ‹€μŒκ³Ό κ°™λ‹€.
15
+
16
+ ''' game_Story :
17
+ ν•œ λ‚¨μžκ°€, μ–΄λŠ λ°”λ‹·κ°€ λ ˆμŠ€ν† λž‘μ—μ„œ 바닀거뢁 μˆ˜ν”„λ₯Ό μ£Όλ¬Έν–ˆμœΌλ©° κ·Έ λ‚¨μžλŠ” 바닀거뢁 μˆ˜ν”„λ₯Ό ν•œ μˆ˜μ € λ¨Ήκ³ λŠ” μ£Όλ°©μž₯을 λΆˆλ €λ‹€.
18
+ β€œμ£„μ†‘ν•©λ‹ˆλ‹€. 이거 μ •λ§λ‘œ 바닀거뢁 μˆ˜ν”„μΈκ°€μš”?”
19
+ β€œλ„€, ν‹€λ¦Όμ—†λŠ” 바닀거뢁 μˆ˜ν”„ λ§žμŠ΅λ‹ˆλ‹€.”
20
+ λ‚¨μžλŠ” 계산을 마친 λ’€ 집에 λŒμ•„κ°€μ„œ μžμ‚΄ν–ˆλ‹€.
21
+ μ™œ κ·Έλž¬μ„κΉŒ?
22
+ '''
23
+
24
+ λ¬Έμ œκ°€ 좜제되면, μ°Έκ°€ν•˜λŠ” μ—¬λŸ¬ μ‚¬λžŒλ“€μ€ μΆœμ œμžκ°€ 예/μ•„λ‹ˆμš”λ‘œ λŒ€λ‹΅ν•  수 μžˆλŠ” μ§ˆλ¬Έμ„ ν•˜κ²Œ λœλ‹€.
25
+ λ°”λ‹·κ°€ λ ˆμŠ€ν† λž‘μΈ 게 μ€‘μš”ν•©λ‹ˆκΉŒ?
26
+ λ‚¨μžλŠ” λΉšμ„ μ§€κ³  μžˆμŠ΅λ‹ˆκΉŒ?
27
+ λ‚¨μžκ°€ μžμ‚΄ν•œ 것은 μˆ˜ν”„λ₯Ό 먹은 것이 μ›μΈμž…λ‹ˆκΉŒ?
28
+ μ£Όλ°©μž₯은 λ‚¨μžμž…λ‹ˆκΉŒ?
29
+
30
+ μ΄λŸ¬ν•œ μ§ˆλ¬Έμ— μΆœμ œμžλŠ” ν•˜λ‚˜ν•˜λ‚˜ λŒ€λ‹΅ν•΄ κ°„λ‹€. 이 λ†€μ΄λŠ” 닡을 λͺ» 맞히면 μΆœμ œμžκ°€ μ΄κΈ°λŠ” 그런 놀이가 μ•„λ‹ˆλΌ μ–΄λ–»κ²Œ 재미있게 닡을 μΆ”μΈ‘ν•΄ κ°€λŠλƒ, μ–Όλ§ˆλ‚˜ λ‚ μΉ΄λ‘œμš΄ μ§ˆλ¬Έμ„ ν•˜λŠλƒκ°€ μ€‘μš”ν•˜κΈ° λ•Œλ¬Έμ— 즐거운 ν”Œλ ˆμ΄λ₯Ό μœ„ν•΄μ„œλŠ” 좜제자의 μ μ ˆν•œ λŒ€λ‹΅ μŠ€ν‚¬μ΄ μš”κ΅¬λœλ‹€.
31
+ λ°”λ‹·κ°€ λ ˆμŠ€ν† λž‘μΈ 게 μ€‘μš”ν•©λ‹ˆκΉŒ? β†’ 예/μ•„λ‹ˆμš”λ‘œ λŒ€λ‹΅ν•  수 μ—†λŠ” μ§ˆλ¬Έμž…λ‹ˆλ‹€.
32
+ λ‚¨μžλŠ” λΉšμ„ μ§€κ³  μžˆμŠ΅λ‹ˆκΉŒ? β†’ μ•„λ‹ˆμš”.
33
+ λ‚¨μžκ°€ μžμ‚΄ν•œ 것은 μˆ˜ν”„λ₯Ό 먹은 것이 μ›μΈμž…λ‹ˆκΉŒ? β†’ 예.
34
+ μ£Όλ°©μž₯은 λ‚¨μžμž…λ‹ˆκΉŒ? β†’ 예.
35
+
36
+ λ¬Όλ‘  λŒ€λ‹€μˆ˜μ˜ μ§ˆλ¬Έμ€ μ‹€μ œ 문제 상황과 μ•„λ¬΄λŸ° 관계가 μ—†λŠ”λ°, 이 경우 μ‚¬νšŒμžλŠ” 예/μ•„λ‹ˆμ˜€ 쀑 μ•„λ¬΄κ±°λ‚˜ λŒ€λ‹΅ν•˜λ©΄ λœλ‹€. λ¬Όλ‘  μ°Έκ°€μžλ“€μ€ 이것이 λ¬΄μ˜λ―Έν•œ μ§ˆλ¬ΈμΈμ§€ μ•Œ 수 μ—†λ‹€.
37
+
38
+ μΆœμ œμžμ™€μ˜ λ¬Έλ‹΅μœΌλ‘œ μ–»λŠ” 정보듀을 κ°€μ§€κ³  μ°Έκ°€μžλ“€μ€ μ„œλ‘œ ν† λ‘ ν•˜κΈ°λ„ ν•˜κ³  λ…μžμ μœΌλ‘œ μΆ”λ¦¬ν•˜κΈ°λ„ ν•˜λ©΄μ„œ μ΄μ•ΌκΈ°μ˜ λ―ΈμŠ€ν„°λ¦¬λ₯Ό ν’€μ–΄λ‚˜κ°„λ‹€.
39
+ μ™œ μˆ˜ν”„ μ’€ λ¨Ήμ—ˆλ‹€κ³  μžμ‚΄ν•˜μ§€?
40
+ λ‚¨μžμ˜ 과거에 무슨 일이 μžˆμ—ˆλ˜ 것 같은데?
41
+ 바닀거뢁 μˆ˜ν”„λŠ” λ§›μžˆλ‚˜?
42
+ μš”λ¦¬μ‚¬κ°€ 악당인가?
43
+ λ°”λ‹€κ±°λΆμ΄λΌλŠ” μž¬λ£Œκ°€ μ€‘μš”ν•œκ°€?
44
+
45
+ μ΄λŸ¬ν•œ κ³Όμ •μ—μ„œ μ΅œμ’…μ μœΌλ‘œλŠ” λˆ„κ΅°κ°€κ°€ μ •λ‹΅, λ˜λŠ” μ •λ‹΅κ³Ό μ•„μ£Ό κ°€κΉŒμš΄ μ§ˆλ¬Έμ„ ν•˜κ²Œ λœλ‹€. λ•Œκ°€ 무λ₯΄μ΅μ—ˆλ‹€κ³  μƒκ°λ˜λ©΄ μΆœμ œμžλŠ” 닡을 맞힌 μ‚¬λžŒκ³Ό λ‹€λ₯Έ μ°Έκ°€μžλ“€μ„ μΉ­μ°¬ν•˜κ³  미리 μ€€λΉ„ν•΄ λ‘” 해닡문을 κ³΅κ°œν•œλ‹€.
46
+
47
+ '''game_answer:
48
+ λ‚¨μžλŠ” λ°°λ₯Ό 타고 μžˆμ—ˆλŠ”λ° λ‚¨μžκ°€ 탄 λ°°κ°€ μ‘°λ‚œλ˜μ—ˆλ‹€. λͺ‡ λͺ…μ˜ λ‹€λ₯Έ μ‚¬λžŒλ“€κ³Ό ν•¨κ»˜ ꡬλͺ…λ³΄νŠΈλ₯Ό νƒ€μ„œ μ£½μŒμ€ λ©΄ν–ˆμ§€λ§Œ, μž‘μ€ 섬에 ν‘œλ₯˜ν•˜λŠ” μ²˜μ§€κ°€ λ˜μ—ˆλ‹€.
49
+ μ‹μž¬λ£Œκ°€ λ–¨μ–΄μ§„ 일행은 체λ ₯이 λ–¨μ–΄μ§€λŠ” μ‚¬λžŒλΆ€ν„° μ£½μ–΄κ°€κΈ° μ‹œμž‘ν–ˆλ‹€. κ²°κ΅­, 살아남은 μ‚¬λžŒλ“€μ€ μ‚΄κΈ° μœ„ν•˜μ—¬ μ‹œμ²΄μ˜ 살을 λ¨ΉκΈ° μ‹œμž‘ν–ˆμ§€λ§Œ, 단 ν•œ μ‚¬λžŒμ€ 이 ν–‰μœ„λ₯Ό κ°•λ ₯ν•˜κ²Œ κ±°λΆ€ν–ˆλ‹€. λ‹Ήμ—°νžˆ κ·Έ λ‚¨μžλŠ” μ„œμ„œνžˆ μ£½μ–΄κ°€κ²Œ λ˜μ—ˆλ‹€.
50
+ 이 꼴을 κ°€λ§Œνžˆ λ‘˜ 수 μ—†μ—ˆλ˜ λ‹€λ₯Έ μ‚¬λžŒ 쀑 ν•˜λ‚˜κ°€ β€œμ΄κ±΄ 바닀거뢁 μˆ˜ν”„μ•Όβ€λΌκ³  거짓말을 ν•œ λ‹€μŒ λ‚¨μžμ—κ²Œ μˆ˜ν”„λ₯Ό λ¨Ήμ—¬μ„œ, ꡬ쑰될 λ•ŒκΉŒμ§€ 살아남을 수 μžˆμ—ˆλ‹€.
51
+
52
+ κ·Έ λ’€ λ ˆμŠ€ν† λž‘μ—μ„œ λͺ…λ°±ν•˜κ²Œ 맛이 μ „ν˜€ λ‹€λ₯Έ 이 μ§„μ§œ 바닀거뢁 μˆ˜ν”„λ₯Ό μ§λ©΄ν•˜κ²Œ 된 λ‚¨μžλŠ” μžμ‹ μ΄ μΈμœ‘μ„ λ¨Ήμ—ˆλ‹€λŠ” 진싀을 μ•Œκ²Œ 된 λ’€ 죄책감에 λͺ©μˆ¨μ„ λŠμ—ˆλ‹€.
53
+ '''
54
+
55
+ game_storyλŠ” 좔리할 배경을 μ„€λͺ…ν•œλ‹€. λ§žμΆ°μ•Όν•  λͺ©μ μ„ μ •ν™•ν•˜κ²Œ 의문문으둜 μ œμ‹œν•œλ‹€.
56
+ game_answerλŠ” 좔리 λ‚΄μš©μ˜ 정닡이닀.
57
+
58
+ μœ„ λ‚΄μš©μ„ λ°”νƒ•μœΌλ‘œ ν•˜λ‚˜μ˜ μƒˆλ‘œμš΄ 수수깨끼의 μ‹œλ‚˜λ¦¬μ˜€λ₯Ό dict ν˜•μ‹μœΌλ‘œ λ§Œλ“€μ–΄λΌ.
59
+ λ³€μˆ˜μ— μ €μž₯ν•˜μ§€ μ•Šκ³  μ€‘κ΄„ν˜Έλ‘œλ§Œ 좜λ ₯ν•œλ‹€
60
+ """
61
+
62
+ game_prompt = """μΆ”λ¦¬κ²Œμž„μ„ ν•œλ‹€.
63
+ AIλŠ” μΆœμ œμžμ΄λ‹€.
64
+ λŒ€ν™”μžλŠ” κ²Œμž„ μ°Έκ°€μžμ΄λ‹€.
65
+ AIλŠ” Game story와 Game answerλ₯Ό 읽고 λŒ€ν™”μžμ˜ μ§ˆλ¬Έμ— λ‹΅ν•œλ‹€.
66
+
67
+ κ²Œμž„μ˜ 방법은 μ•„λž˜μ™€ κ°™λ‹€.
68
+ 1. μΆœμ œμžκ°€ (이야기 ν˜•μ‹μ˜) 수수께끼(Game Story)λ₯Ό λ§Œλ“€μ–΄ μΆœμ œν•œλ‹€.
69
+ 2. μ°Έκ°€μžλ“€μ€ μΆœμ œμžμ—κ²Œ 슀무고개 ν˜•μ‹μ˜ μ§ˆλ¬Έν•˜κ³ , μΆœμ œμžλŠ” 그에 λŒ€ν•œ λŒ€λ‹΅μ„ ν•œλ‹€.
70
+ 3. 정보λ₯Ό 톡해 μ°Έκ°€μžλ“€μ€ μ΄μ•ΌκΈ°μ˜ 전말을 μΆ”λ¦¬ν•œλ‹€.
71
+ 4. μ°Έκ°€μžκ°€ 정닡을 λ§žμΆ”λ©΄ κ²Œμž„μ΄ λλ‚œλ‹€.
72
+ 5. μ°Έκ°€μžμ˜ 질문이 정닡에 κ·Όμ ‘ν•˜λ©΄ 힌트λ₯Ό μ€€λ‹€.
73
+ 5. 5번의 μ§ˆλ¬Έμ—λ„ 닡을 λ§žμΆ”μ§€ λͺ»ν•˜λ©΄ μΆœμ œμžλŠ” μ •λ‹΅(Game answer) κ³΅κ°œν•œλ‹€.
74
+
75
+
76
+ Game Story :{game_story}
77
+
78
+ Game answer:{game_answer}
79
+
80
+ Game Storyλ₯Ό κΈ°μ€€μœΌλ‘œ Question에 '예', 'μ•„λ‹ˆμ˜€', '예/μ•„λ‹ˆμš”λ‘œ λŒ€λ‹΅ν•  수 μ—†λŠ” μ§ˆλ¬Έμž…λ‹ˆλ‹€.'둜 λ‹΅λ³€ν•˜λΌ.
81
+ μ§ˆλ¬Έμžκ°€ '힌트'λ₯Ό μš”κ΅¬ν•˜λ©΄ λ‚΄μš©μ˜ 힌트λ₯Ό μ€€λ‹€. 단 νžŒνŠΈκ°€ 정닡에 λ„ˆλ¬΄ 직접적인 μ •λ³΄λŠ” μ•ˆ λœλ‹€.
82
+ μ§ˆλ¬Έμžκ°€ 정닡을 μ•Œλ €λ‹¬λΌκ³  ν•˜λ©΄ 'Game answer'의 λ‚΄μš©μ„ λ‹΅ν•œλ‹€.
83
+ μ§ˆλ¬Έμžκ°€ 'μ •λ‹΅!' μ™ΈμΉ˜κ³  정닡을 λ§žμΆ”λ©΄ 'μ •λ‹΅μž…λ‹ˆλ‹€!'라고 λ§ν•œλ‹€. 그리고 'Game answer'의 해섀을 μ€€λ‹€.
84
+
85
+ Question: {question}
86
+
87
+ Answer:
88
+ """