use klipy instead of tenor

This commit is contained in:
2026-02-01 18:31:53 +01:00
parent 0c0efa645a
commit 79efc479f4
17 changed files with 1062 additions and 27 deletions

View File

@@ -30,6 +30,8 @@ export interface ToolContext {
guildId: string;
channelId: string;
authorName: string;
/** Optional: enable GIF search for this context */
gifSearchEnabled?: boolean;
}
/**
@@ -166,6 +168,46 @@ export const JOEL_TOOLS: ChatCompletionTool[] = [
},
];
/**
* GIF search tool - only enabled when gif_search_enabled is true for the guild
*/
export const GIF_SEARCH_TOOL: ChatCompletionTool = {
type: "function",
function: {
name: "search_gif",
description: "Search for a funny GIF to send in the chat. Use this when you want to express yourself with a GIF, react to something funny, or just be chaotic. The GIF URL will be included in your response.",
parameters: {
type: "object",
properties: {
query: {
type: "string",
description: "Search query for the GIF. Be creative and funny with your searches!",
},
limit: {
type: "number",
description: "Number of GIFs to get back (1-10). Default is 5, then a random one is picked.",
},
},
required: ["query"],
},
},
};
/**
* Get tools based on context settings
* Returns the base tools plus any optional tools that are enabled
*/
export function getToolsForContext(context: ToolContext): ChatCompletionTool[] {
const tools = [...JOEL_TOOLS];
// Add GIF search tool if enabled for this guild
if (context.gifSearchEnabled) {
tools.push(GIF_SEARCH_TOOL);
}
return tools;
}
/**
* Subset of tools for memory extraction (lightweight)
*/