Moonfanz commited on
Commit
43a10de
·
verified ·
1 Parent(s): b589d38

Upload 4 files

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. func.py +3 -3
app.py CHANGED
@@ -118,7 +118,7 @@ GEMINI_MODELS = [
118
 
119
  @app.route('/')
120
  def index():
121
- main_content = "Moonfanz Reminiproxy v2.1.1 2025-01-09"
122
  html_template = """
123
  <!DOCTYPE html>
124
  <html>
 
118
 
119
  @app.route('/')
120
  def index():
121
+ main_content = "Moonfanz Reminiproxy v2.1.2 2025-01-09"
122
  html_template = """
123
  <!DOCTYPE html>
124
  <html>
func.py CHANGED
@@ -43,7 +43,7 @@ def process_messages_for_gemini(messages):
43
 
44
  if isinstance(content, str):
45
  if role == 'system':
46
- gemini_history.append({"role": "model", "parts": [content]})
47
  elif role == 'user':
48
  gemini_history.append({"role": "user", "parts": [content]})
49
  elif role == 'assistant':
@@ -89,9 +89,9 @@ def process_messages_for_gemini(messages):
89
  errors.append(f"Invalid file URL format for item: {item}")
90
 
91
  if parts:
92
- if role in ['user']:
93
  gemini_history.append({"role": "user", "parts": parts})
94
- elif role in ['assistant', 'system']:
95
  gemini_history.append({"role": "model", "parts": parts})
96
  else:
97
  errors.append(f"Invalid role: {role}")
 
43
 
44
  if isinstance(content, str):
45
  if role == 'system':
46
+ gemini_history.append({"role": "user", "parts": [content]})
47
  elif role == 'user':
48
  gemini_history.append({"role": "user", "parts": [content]})
49
  elif role == 'assistant':
 
89
  errors.append(f"Invalid file URL format for item: {item}")
90
 
91
  if parts:
92
+ if role in ['user', 'system']:
93
  gemini_history.append({"role": "user", "parts": parts})
94
+ elif role in ['assistant']:
95
  gemini_history.append({"role": "model", "parts": parts})
96
  else:
97
  errors.append(f"Invalid role: {role}")