Spaces:
Sleeping
Sleeping
GitHub Actions Bot commited on
Commit ·
64806b3
1
Parent(s): 590474d
Deploy backend from GitHub Actions
Browse files
services/gemini_service.py
CHANGED
|
@@ -44,9 +44,9 @@ class GeminiService:
|
|
| 44 |
|
| 45 |
prompt = f"Analyze the following Reddit comment/post for toxic behavior, including harassment, hate speech, abusive language, or threats:\n\n{text}"
|
| 46 |
|
| 47 |
-
# Run model call (using gemini-
|
| 48 |
response = client.models.generate_content(
|
| 49 |
-
model='gemini-
|
| 50 |
contents=prompt,
|
| 51 |
config=types.GenerateContentConfig(
|
| 52 |
response_mime_type="application/json",
|
|
@@ -75,7 +75,7 @@ class GeminiService:
|
|
| 75 |
prompt = f"Analyze the following conversation thread. Determine if it shows signs of a rapidly escalating flame war or hostile back-and-forth personal arguments:\n\n{thread_text}"
|
| 76 |
|
| 77 |
response = client.models.generate_content(
|
| 78 |
-
model='gemini-
|
| 79 |
contents=prompt,
|
| 80 |
config=types.GenerateContentConfig(
|
| 81 |
response_mime_type="application/json",
|
|
@@ -99,7 +99,7 @@ class GeminiService:
|
|
| 99 |
try:
|
| 100 |
# Generate embedding using the standard embedding model
|
| 101 |
response = client.models.embed_content(
|
| 102 |
-
model='
|
| 103 |
contents=text
|
| 104 |
)
|
| 105 |
# Response contains a list of embeddings (usually 768 dimensions)
|
|
|
|
| 44 |
|
| 45 |
prompt = f"Analyze the following Reddit comment/post for toxic behavior, including harassment, hate speech, abusive language, or threats:\n\n{text}"
|
| 46 |
|
| 47 |
+
# Run model call (using gemini-2.0-flash as default)
|
| 48 |
response = client.models.generate_content(
|
| 49 |
+
model='gemini-2.0-flash',
|
| 50 |
contents=prompt,
|
| 51 |
config=types.GenerateContentConfig(
|
| 52 |
response_mime_type="application/json",
|
|
|
|
| 75 |
prompt = f"Analyze the following conversation thread. Determine if it shows signs of a rapidly escalating flame war or hostile back-and-forth personal arguments:\n\n{thread_text}"
|
| 76 |
|
| 77 |
response = client.models.generate_content(
|
| 78 |
+
model='gemini-2.0-flash',
|
| 79 |
contents=prompt,
|
| 80 |
config=types.GenerateContentConfig(
|
| 81 |
response_mime_type="application/json",
|
|
|
|
| 99 |
try:
|
| 100 |
# Generate embedding using the standard embedding model
|
| 101 |
response = client.models.embed_content(
|
| 102 |
+
model='gemini-embedding-2',
|
| 103 |
contents=text
|
| 104 |
)
|
| 105 |
# Response contains a list of embeddings (usually 768 dimensions)
|