benjamin5607 commited on
Commit
100bf14
·
verified ·
1 Parent(s): 5724da8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -49,20 +49,24 @@ MEMBERS = {
49
  async def band_consulting(user_input, member_name, consult_category):
50
  try:
51
  member = MEMBERS.get(member_name, MEMBERS["서윤 (Korea)"])
52
-
53
- # 언어 강제 로직
54
  requested_lang = "English" if "English" in consult_category else "Korean"
55
 
 
56
  system_instruction = f"""
57
  {member['prompt']}
58
- [CRITICAL RULE] Respond ENTIRELY in {requested_lang}.
59
- Even if you are global, the user selected {requested_lang} as the consultation language.
60
-
 
 
 
61
  조언 후 반드시 포함:
62
- 1. [TAB]: 코드 진행 또는 텍스트 악보.
63
- 2. [MUSIC]: 분야와 어울리는 영어 음악 프롬프트.
64
  """
65
 
 
 
66
  url = f"https://generativelanguage.googleapis.com/v1beta/models/{ACTIVE_MODEL}:generateContent?key={GENAI_KEY}"
67
  payload = {"contents": [{"parts": [{"text": f"{system_instruction}\n질문: {user_input}"}]}]}
68
  res = requests.post(url, json=payload, headers={'Content-Type': 'application/json'})
 
49
  async def band_consulting(user_input, member_name, consult_category):
50
  try:
51
  member = MEMBERS.get(member_name, MEMBERS["서윤 (Korea)"])
 
 
52
  requested_lang = "English" if "English" in consult_category else "Korean"
53
 
54
+ # 답변 5줄 요약 및 상세 설명 악보 이동 지시
55
  system_instruction = f"""
56
  {member['prompt']}
57
+ [CRITICAL: LANGUAGE] You MUST speak 100% in {requested_lang}. NEVER use other languages.
58
+ [CRITICAL: STYLE]
59
+ 1. Your verbal advice (main text) must be VERY CONCISE (under 5 lines).
60
+ 2. Put ALL detailed musical explanations, scales, and tips inside the [TAB] section.
61
+ 3. Start with a cool rockstar greeting.
62
+
63
  조언 후 반드시 포함:
64
+ 1. [TAB]: 상세 설명 + 코드 진행/텍스트 악보.
65
+ 2. [MUSIC]: 영어 음악 프롬프트.
66
  """
67
 
68
+ # ... (Gemini 호출 및 데이터 추출 로직 동일)
69
+
70
  url = f"https://generativelanguage.googleapis.com/v1beta/models/{ACTIVE_MODEL}:generateContent?key={GENAI_KEY}"
71
  payload = {"contents": [{"parts": [{"text": f"{system_instruction}\n질문: {user_input}"}]}]}
72
  res = requests.post(url, json=payload, headers={'Content-Type': 'application/json'})