fix: Update import path for SafetySetting in TetoCog

This commit is contained in:
Slipstream 2025-05-28 23:22:45 -06:00
parent 03825d0f62
commit 8e6b9b6270
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -15,7 +15,7 @@ import aiohttp
# Google Generative AI Imports (using Vertex AI backend)
from google import genai
from google.generativeai import types
from google.genai import types
from google.api_core import exceptions as google_exceptions
# Import project configuration for Vertex AI
@ -24,10 +24,10 @@ from gurt.config import PROJECT_ID, LOCATION
# Define standard safety settings using google.generativeai types
# Set all thresholds to OFF as requested
STANDARD_SAFETY_SETTINGS = [
genai.types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold="BLOCK_NONE"),
genai.types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold="BLOCK_NONE"),
genai.types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold="BLOCK_NONE"),
genai.types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_HARASSMENT, threshold="BLOCK_NONE"),
types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold="BLOCK_NONE"),
types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold="BLOCK_NONE"),
types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold="BLOCK_NONE"),
types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_HARASSMENT, threshold="BLOCK_NONE"),
]
def strip_think_blocks(text):