feat: dashboard
This commit is contained in:
@@ -304,12 +304,16 @@ const toolHandlers: Record<string, ToolHandler> = {
|
||||
const nsfwKeywords = /\b(naked|nude|nsfw|porn|xxx|hentai|sex|fuck|cock|pussy|tits)\b/i;
|
||||
const isNsfwRequest = nsfwKeywords.test(prompt) || style === "hentai";
|
||||
|
||||
if (isNsfwRequest && !context.nsfwImageEnabled) {
|
||||
return "NSFW image generation is disabled for this server. Ask an admin to enable it first.";
|
||||
}
|
||||
|
||||
const result = await imageGen.generate({
|
||||
prompt,
|
||||
model: modelChoice,
|
||||
aspectRatio,
|
||||
numImages: 1,
|
||||
nsfw: isNsfwRequest,
|
||||
nsfw: isNsfwRequest && Boolean(context.nsfwImageEnabled),
|
||||
style,
|
||||
});
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ export interface ToolContext {
|
||||
gifSearchEnabled?: boolean;
|
||||
/** Optional: enable image generation for this context */
|
||||
imageGenEnabled?: boolean;
|
||||
/** Optional: allow NSFW image generation in this context */
|
||||
nsfwImageEnabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user