AMDF commited on
Commit
a98dd25
Β·
verified Β·
1 Parent(s): 89ae9ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -22
app.py CHANGED
@@ -1,29 +1,9 @@
1
  import gradio as gr
2
  import requests
3
  import json
4
- pip install python-dotenv
5
-
6
-
7
- import os
8
- # .env νŒŒμΌμ— API_KEY="your_api_key_here" ν˜•νƒœλ‘œ μ €μž₯
9
- from dotenv import load_dotenv
10
-
11
- load_dotenv()
12
- API_KEY = os.environ.get("up_S7cDxYLLt07RZDzCHBvGQnV0zqv4b")
13
-
14
- if not API_KEY:
15
- print("API ν‚€λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€. ν™˜κ²½ λ³€μˆ˜λ₯Ό ν™•μΈν•΄μ£Όμ„Έμš”.")
16
- # ν‚€κ°€ 없을 경우 ν”„λ‘œκ·Έλž¨ μ’…λ£Œ λ˜λŠ” μ—λŸ¬ 처리
17
- exit()
18
-
19
- # κΈ°μ‘΄ μ½”λ“œμ—μ„œ API_KEY λ³€μˆ˜λ₯Ό κ·ΈλŒ€λ‘œ μ‚¬μš©
20
- API_URL = "https://api.upstage.ai/v1"
21
- headers = {
22
- "Authorization": f"Bearer {API_KEY}",
23
- "Content-Type": "application/json"
24
- }
25
-
26
 
 
 
27
 
28
  def chat_with_solar(message, history):
29
  """Solar Pro2와 λŒ€ν™”ν•˜λŠ” ν•¨μˆ˜"""
 
1
  import gradio as gr
2
  import requests
3
  import json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ API_KEY = "up_S7cDxYLLt07RZDzCHBvGQnV0zqv4b"
6
+ API_URL = "https://api.upstage.ai/v1/chat/completions"
7
 
8
  def chat_with_solar(message, history):
9
  """Solar Pro2와 λŒ€ν™”ν•˜λŠ” ν•¨μˆ˜"""