use klipy instead of tenor
This commit is contained in:
@@ -7,7 +7,7 @@ import type { ChatCompletionMessageParam, ChatCompletionTool } from "openai/reso
|
||||
import { config } from "../../core/config";
|
||||
import { createLogger } from "../../core/logger";
|
||||
import type { AiProvider, AiResponse, AskOptions, AskWithToolsOptions, MessageStyle } from "./types";
|
||||
import { JOEL_TOOLS, MEMORY_EXTRACTION_TOOLS, type ToolCall, type ToolContext } from "./tools";
|
||||
import { JOEL_TOOLS, MEMORY_EXTRACTION_TOOLS, getToolsForContext, type ToolCall, type ToolContext } from "./tools";
|
||||
import { executeTools } from "./tool-handlers";
|
||||
|
||||
const logger = createLogger("AI:OpenRouter");
|
||||
@@ -79,6 +79,9 @@ export class OpenRouterProvider implements AiProvider {
|
||||
{ role: "user", content: prompt },
|
||||
];
|
||||
|
||||
// Get the appropriate tools for this context (includes optional tools like GIF search)
|
||||
const tools = getToolsForContext(context);
|
||||
|
||||
let iterations = 0;
|
||||
|
||||
while (iterations < MAX_TOOL_ITERATIONS) {
|
||||
@@ -88,7 +91,7 @@ export class OpenRouterProvider implements AiProvider {
|
||||
const completion = await this.client.chat.completions.create({
|
||||
model: config.ai.model,
|
||||
messages,
|
||||
tools: JOEL_TOOLS,
|
||||
tools,
|
||||
tool_choice: "auto",
|
||||
max_tokens: maxTokens ?? config.ai.maxTokens,
|
||||
temperature: temperature ?? config.ai.temperature,
|
||||
@@ -177,7 +180,7 @@ The user's Discord ID is: ${context.userId}`;
|
||||
|
||||
try {
|
||||
const completion = await this.client.chat.completions.create({
|
||||
model: config.ai.classificationModel,
|
||||
model: config.ai.model, // Use main model - needs tool support
|
||||
messages: [
|
||||
{ role: "system", content: systemPrompt },
|
||||
{ role: "user", content: `Analyze this message for memorable content:\n\n"${message}"` },
|
||||
|
||||
Reference in New Issue
Block a user