seawolf2357 commited on
Commit
da2d938
Β·
verified Β·
1 Parent(s): cd4994b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -125,11 +125,13 @@ def get_lunar_info(solYear, solMonth, solDay, solHour):
125
  else:
126
  return {"Error": "API ν˜ΈμΆœμ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€."}, "정보 μ—†μŒ", "<p>API ν˜ΈμΆœμ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.</p>"
127
 
 
 
128
  def analyze_character(lunIljin, OPENAI_API_KEY):
129
- API_URL = "https://api.openai.com/v1/chat/completions"
130
  payload = {
131
- "model": "gpt-4-0125-preview",
132
- "prompt": f"일주 '{lunIljin}'에 λŒ€ν•œ 성격과 νŠΉμ§•μ„ μ„€λͺ…ν•΄μ£Όμ„Έμš”.",
133
  "temperature": 0.7,
134
  "max_tokens": 150,
135
  "top_p": 1.0,
@@ -138,7 +140,7 @@ def analyze_character(lunIljin, OPENAI_API_KEY):
138
  }
139
  headers = {
140
  "Content-Type": "application/json",
141
- "Authorization": f"Bearer {OPENAI_API_KEY}"
142
  }
143
  response = requests.post(API_URL, headers=headers, json=payload)
144
  if response.status_code == 200:
@@ -148,7 +150,6 @@ def analyze_character(lunIljin, OPENAI_API_KEY):
148
  return f"였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μƒνƒœ μ½”λ“œ: {response.status_code}"
149
 
150
 
151
-
152
  # 사주 뢄석 데이터 μ˜ˆμ‹œ (κ°„μ†Œν™”λœ 버전)
153
  사주_데이터 = {
154
  'κ°‘μž(甲子)' : 'μƒˆλ‘œμš΄ μ‹œμž‘μ˜ 상징, 리더십과 독립성이 νŠΉμ§•μ΄λ©°, ν˜ΈμΎŒν•˜κ³  μ„±μ‹€ν•œ νŠΉμ„±μ„ μ§€λ‹Œλ‹€. ',
 
125
  else:
126
  return {"Error": "API ν˜ΈμΆœμ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€."}, "정보 μ—†μŒ", "<p>API ν˜ΈμΆœμ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.</p>"
127
 
128
+
129
+
130
  def analyze_character(lunIljin, OPENAI_API_KEY):
131
+ API_URL = "https://api.openai.com/v1/chat/completions" # API URL이 μ •ν™•ν•œμ§€ 확인
132
  payload = {
133
+ "model": "gpt-4-0125-preview", # 'gpt-4-0125-preview' λͺ¨λΈ 이름이 μ •ν™•ν•œμ§€, ν˜Ήμ€ μ‚¬μš© κ°€λŠ₯ν•œμ§€ 확인
134
+ "prompt": f"일주 '{lunIljin}'에 λŒ€ν•œ 성격과 νŠΉμ§•μ„ μ„€λͺ…ν•΄μ£Όμ„Έμš”.", # prompt ꡬ성이 μ μ ˆν•œμ§€ 확인
135
  "temperature": 0.7,
136
  "max_tokens": 150,
137
  "top_p": 1.0,
 
140
  }
141
  headers = {
142
  "Content-Type": "application/json",
143
+ "Authorization": f"Bearer {OPENAI_API_KEY}" # API ν‚€κ°€ μ •ν™•νžˆ μž…λ ₯λ˜μ—ˆλŠ”μ§€ 확인
144
  }
145
  response = requests.post(API_URL, headers=headers, json=payload)
146
  if response.status_code == 200:
 
150
  return f"였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μƒνƒœ μ½”λ“œ: {response.status_code}"
151
 
152
 
 
153
  # 사주 뢄석 데이터 μ˜ˆμ‹œ (κ°„μ†Œν™”λœ 버전)
154
  사주_데이터 = {
155
  'κ°‘μž(甲子)' : 'μƒˆλ‘œμš΄ μ‹œμž‘μ˜ 상징, 리더십과 독립성이 νŠΉμ§•μ΄λ©°, ν˜ΈμΎŒν•˜κ³  μ„±μ‹€ν•œ νŠΉμ„±μ„ μ§€λ‹Œλ‹€. ',