FinnNick commited on
Commit
5b95f5c
·
verified ·
1 Parent(s): 9110ad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -12,7 +12,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
- self.api_key = os.getenv("GEMINI_API_KEY")
16
  if not self.api_key:
17
  raise ValueError("❌ GEMINI_API_KEY не найден в переменных окружения.")
18
  self.api_url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent"
@@ -40,7 +40,6 @@ class BasicAgent:
40
  response = requests.post(self.api_url, headers=headers, json=payload, timeout=20)
41
  response.raise_for_status()
42
  result = response.json()
43
- # Получение текста ответа
44
  reply = result["candidates"][0]["content"]["parts"][0]["text"]
45
  print(f"✅ Ответ: {reply[:50]}...")
46
  return reply
 
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
+ self.api_key = os.getenv("GEMINI_API_KEY")
16
  if not self.api_key:
17
  raise ValueError("❌ GEMINI_API_KEY не найден в переменных окружения.")
18
  self.api_url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent"
 
40
  response = requests.post(self.api_url, headers=headers, json=payload, timeout=20)
41
  response.raise_for_status()
42
  result = response.json()
 
43
  reply = result["candidates"][0]["content"]["parts"][0]["text"]
44
  print(f"✅ Ответ: {reply[:50]}...")
45
  return reply