springwater commited on
Commit
4ce9632
β€’
1 Parent(s): 85f4883

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import os
5
  import sys
6
  import json
7
 
 
8
 
9
  def exception_handler(exception_type, exception, traceback):
10
  print(f"{exception_type.__name__}: {exception}")
@@ -187,7 +188,7 @@ def get_famous_people(lunIljin):
187
  return famous_people.get(lunIljin[:2], "ν•΄λ‹Ή 일주에 λŒ€ν•œ 유λͺ…인 정보가 μ—†μŠ΅λ‹ˆλ‹€.")
188
 
189
 
190
- def analyze_character(lunIljin, OPENAI_API_KEY="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"):
191
  API_URL = "https://api.openai.com/v1/chat/completions"
192
  payload = {
193
  "model": "gpt-4-0125-preview", # λͺ¨λΈ 이름 확인 ν•„μš”
@@ -212,7 +213,7 @@ def analyze_character(lunIljin, OPENAI_API_KEY="sk-FIY8XdJm4zrEpW27NrRgT3BlbkFJX
212
  # 였λ₯˜ λ©”μ‹œμ§€ κ°œμ„ 
213
  return f"였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μƒνƒœ μ½”λ“œ: {response.status_code}, λ©”μ‹œμ§€: {response.json().get('error', {}).get('message', 'Unknown error')}", ""
214
 
215
- def analyze_character_two(lunIljin, lunIljin2, OPENAI_API_KEY="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"):
216
  API_URL = "https://api.openai.com/v1/chat/completions"
217
  payload = {
218
  "model": "gpt-4-0125-preview", # λͺ¨λΈ 이름 확인 ν•„μš”
 
5
  import sys
6
  import json
7
 
8
+ api_key = os.getenv('API_KEY')
9
 
10
  def exception_handler(exception_type, exception, traceback):
11
  print(f"{exception_type.__name__}: {exception}")
 
188
  return famous_people.get(lunIljin[:2], "ν•΄λ‹Ή 일주에 λŒ€ν•œ 유λͺ…인 정보가 μ—†μŠ΅λ‹ˆλ‹€.")
189
 
190
 
191
+ def analyze_character(lunIljin, OPENAI_API_KEY=api_key):
192
  API_URL = "https://api.openai.com/v1/chat/completions"
193
  payload = {
194
  "model": "gpt-4-0125-preview", # λͺ¨λΈ 이름 확인 ν•„μš”
 
213
  # 였λ₯˜ λ©”μ‹œμ§€ κ°œμ„ 
214
  return f"였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μƒνƒœ μ½”λ“œ: {response.status_code}, λ©”μ‹œμ§€: {response.json().get('error', {}).get('message', 'Unknown error')}", ""
215
 
216
+ def analyze_character_two(lunIljin, lunIljin2, OPENAI_API_KEY=api_key):
217
  API_URL = "https://api.openai.com/v1/chat/completions"
218
  payload = {
219
  "model": "gpt-4-0125-preview", # λͺ¨λΈ 이름 확인 ν•„μš”