Skip to content

Commit 0b7ec6c

Browse files
Black formatting
1 parent a75288c commit 0b7ec6c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docassemble/GithubFeedbackForm/github_issue.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ def is_likely_spam_from_genai(
192192
"""
193193
if not body:
194194
return False
195-
196-
model = model or get_config("github issues", {}).get("spam model", "gemini-2.0-flash-exp")
195+
196+
model = model or get_config("github issues", {}).get(
197+
"spam model", "gemini-2.0-flash-exp"
198+
)
197199
gemini_api_key = gemini_api_key or get_config("google gemini api key")
198200

199-
if not gemini_api_key: # not passed as a parameter OR in the global config
201+
if not gemini_api_key: # not passed as a parameter OR in the global config
200202
log("Not using Google Gemini Flash to check for spam: no API key provided")
201203
return False
202204

203-
if context is None: # empty string is a valid input
205+
if context is None: # empty string is a valid input
204206
context = "a guided interview in the legal context"
205207

206208
try:
@@ -221,7 +223,9 @@ def is_likely_spam_from_genai(
221223
if response.text.strip() == "spam":
222224
return True
223225
except NameError:
224-
log(f"Error using Google Gemini Flash: the `google.generativeai` module is not available")
226+
log(
227+
f"Error using Google Gemini Flash: the `google.generativeai` module is not available"
228+
)
225229
except Exception as e:
226230
log(f"Error using Google Gemini Flash: {e}")
227231
return False

0 commit comments

Comments
 (0)