zelk12 commited on
Commit
4138569
·
verified ·
1 Parent(s): 571005e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -25,7 +25,6 @@ print("\nEnd import library\n=========")
25
  print("=========\nBegin definition Backend Logic\n")
26
 
27
  print("Create default API settings")
28
-
29
  google_API_key=os.getenv("GEMINI_API_KEY")
30
 
31
  client = genai.Client(
@@ -57,12 +56,12 @@ def model_response(message, history):
57
  if message_to_check.get("role") == "user" :
58
  gemini_history.append({
59
  "role": "user",
60
- "parts": [{"text": message_to_check.get("content", "")}]
61
  })
62
  elif message_to_check.get("role") == "assistant" :
63
  gemini_history.append({
64
  "role": "model",
65
- "parts": [{"text": message_to_check.get("content", "")}]
66
  })
67
 
68
  print(f"his: {gemini_history}")
 
25
  print("=========\nBegin definition Backend Logic\n")
26
 
27
  print("Create default API settings")
 
28
  google_API_key=os.getenv("GEMINI_API_KEY")
29
 
30
  client = genai.Client(
 
56
  if message_to_check.get("role") == "user" :
57
  gemini_history.append({
58
  "role": "user",
59
+ "parts": [message_to_check.get("content", "")]
60
  })
61
  elif message_to_check.get("role") == "assistant" :
62
  gemini_history.append({
63
  "role": "model",
64
+ "parts": [message_to_check.get("content", "")]
65
  })
66
 
67
  print(f"his: {gemini_history}")