alanchen1115 commited on
Commit
11276ed
·
verified ·
1 Parent(s): 9ef3621

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -10
main.py CHANGED
@@ -71,17 +71,19 @@ def handle_message(event):
71
 
72
  elif working_status:
73
  try:
74
- messages = []
 
 
 
 
 
 
 
 
 
75
  message = event.message.text
76
- messages.append({
77
- "role": "user",
78
- "parts": [message],
79
- })
80
- # Check if response is valid
81
- response = model.generate_content(messages)
82
- out = response.parts[0].text
83
- if not response.parts or not response.parts[0].text:
84
- out = response.parts[0].text
85
  except:
86
  out = "Gemini error!"
87
 
 
71
 
72
  elif working_status:
73
  try:
74
+ # messages = []
75
+ # message = event.message.text
76
+ # messages.append({
77
+ # "role": "user",
78
+ # "parts": [message],
79
+ # })
80
+ # # Check if response is valid
81
+ # response = model.generate_content(messages)
82
+ # if not response.parts or not response.parts[0].text:
83
+ # out = response.parts[0].text
84
  message = event.message.text
85
+ out = model.generate_content(message)
86
+
 
 
 
 
 
 
 
87
  except:
88
  out = "Gemini error!"
89