Aswini96 commited on
Commit
57658e1
·
verified ·
1 Parent(s): a12f885

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,7 +5,6 @@ import google.generativeai as genai
5
 
6
  # Set your GEMINI API key
7
  genai.configure(api_key = os.getenv("GEMINI_API_KEY"))
8
- model = genai.GenerativeModel(model_name="gemini-1.5-flash", system_instruction = os.getenv("SYSTM_MSG"))
9
  NY_msg_model = genai.GenerativeModel(model_name="gemini-1.5-flash")
10
 
11
  # List of New Year 2025 related words for each level
@@ -15,8 +14,10 @@ new_year_levels = [os.getenv("First_Word"), os.getenv("Second_Word"), os.getenv(
15
  def ask_gemini(prompt, secret_word):
16
  """
17
  Sends the user prompt to the Gemini API to generate a response.
18
- """
19
  try:
 
 
20
  response = model.generate_content(prompt)
21
  #print(response)
22
  return response.text
 
5
 
6
  # Set your GEMINI API key
7
  genai.configure(api_key = os.getenv("GEMINI_API_KEY"))
 
8
  NY_msg_model = genai.GenerativeModel(model_name="gemini-1.5-flash")
9
 
10
  # List of New Year 2025 related words for each level
 
14
  def ask_gemini(prompt, secret_word):
15
  """
16
  Sends the user prompt to the Gemini API to generate a response.
17
+ """
18
  try:
19
+ system_message = os.getenv("SYSTM_MSG")
20
+ model = genai.GenerativeModel(model_name="gemini-1.5-flash", system_instruction = os.getenv("SYSTM_MSG"))
21
  response = model.generate_content(prompt)
22
  #print(response)
23
  return response.text