Spaces:
Paused
Paused
Update bot_main.py
Browse files- bot_main.py +3 -3
bot_main.py
CHANGED
|
@@ -135,7 +135,7 @@ model = genai.GenerativeModel("gemini-pro", safety_settings=safety_settings)
|
|
| 135 |
import random
|
| 136 |
import asyncio
|
| 137 |
|
| 138 |
-
|
| 139 |
base = [
|
| 140 |
"我從不覺得在___快樂過",
|
| 141 |
"一但加入了___就再也回不去了",
|
|
@@ -159,7 +159,7 @@ async def generate_content1(topic):
|
|
| 159 |
|
| 160 |
# Simulating an asynchronous API call to the model
|
| 161 |
model = genai.GenerativeModel("gemini-1.5-flash")
|
| 162 |
-
response =
|
| 163 |
|
| 164 |
# Assuming response.candidates is iterable and contains a 'content' attribute
|
| 165 |
for candidate in response.candidates:
|
|
@@ -171,7 +171,7 @@ async def generate_content1(topic):
|
|
| 171 |
async def create_bad_message(topic, n=10):
|
| 172 |
result = []
|
| 173 |
for i in range(n):
|
| 174 |
-
result =
|
| 175 |
if result is not None:
|
| 176 |
return result
|
| 177 |
return "為什麼要演奏春日影?"
|
|
|
|
| 135 |
import random
|
| 136 |
import asyncio
|
| 137 |
|
| 138 |
+
def generate_content1(topic):
|
| 139 |
base = [
|
| 140 |
"我從不覺得在___快樂過",
|
| 141 |
"一但加入了___就再也回不去了",
|
|
|
|
| 159 |
|
| 160 |
# Simulating an asynchronous API call to the model
|
| 161 |
model = genai.GenerativeModel("gemini-1.5-flash")
|
| 162 |
+
response = model.generate_content(prompt)
|
| 163 |
|
| 164 |
# Assuming response.candidates is iterable and contains a 'content' attribute
|
| 165 |
for candidate in response.candidates:
|
|
|
|
| 171 |
async def create_bad_message(topic, n=10):
|
| 172 |
result = []
|
| 173 |
for i in range(n):
|
| 174 |
+
result = generate_content1(topic)
|
| 175 |
if result is not None:
|
| 176 |
return result
|
| 177 |
return "為什麼要演奏春日影?"
|