Spaces:
Running
Running
Upload 4 files
Browse files
app.py
CHANGED
@@ -118,7 +118,7 @@ GEMINI_MODELS = [
|
|
118 |
|
119 |
@app.route('/')
|
120 |
def index():
|
121 |
-
main_content = "Moonfanz Reminiproxy v2.1.
|
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": "
|
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'
|
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}")
|