Skip to content

Commit 32d9722

Browse files
myelinated-wackerowclaudewackerow
committed
fix: upgrade model + add safety settings
Per Relay review: - Model: gemini-2.5-flash -> gemini-2.5-pro (better accuracy for non-Latin scripts) - Safety: BLOCK_NONE on all 4 harm categories to prevent silent blocking on terms like "51% attack", "slashing", "front-running" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
1 parent 877c5cb commit 32d9722

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

scripts/generate-translations-sdk.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from "fs"
2020
import { join } from "path"
2121

22-
import { GoogleGenAI } from "@google/genai"
22+
import { GoogleGenAI, HarmBlockThreshold, HarmCategory } from "@google/genai"
2323

2424
const SCRIPTS_DIR = join(process.cwd(), "scripts")
2525
const TERMS_PATH = join(SCRIPTS_DIR, "glossary-terms-enhanced.json")
@@ -491,8 +491,28 @@ async function processBatch(
491491
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
492492
try {
493493
const response = await ai.models.generateContent({
494-
model: "gemini-2.5-flash",
494+
model: "gemini-2.5-pro",
495495
contents: prompt,
496+
config: {
497+
safetySettings: [
498+
{
499+
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
500+
threshold: HarmBlockThreshold.BLOCK_NONE,
501+
},
502+
{
503+
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
504+
threshold: HarmBlockThreshold.BLOCK_NONE,
505+
},
506+
{
507+
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
508+
threshold: HarmBlockThreshold.BLOCK_NONE,
509+
},
510+
{
511+
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
512+
threshold: HarmBlockThreshold.BLOCK_NONE,
513+
},
514+
],
515+
},
496516
})
497517

498518
const text = response.text ?? ""

0 commit comments

Comments
 (0)