diff --git a/src/lib/db.ts b/src/lib/db.ts index f792ffc..77206a5 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -3,6 +3,7 @@ import { PrismaClient } from '@prisma/client' import type { Tool, ToolExample } from '@/lib/types' const prisma = new PrismaClient() +const all = -1 export async function getToolsForUrl(url: string): Promise<{ tools: Tool[], examples: ToolExample[], lastIndexedAt: Date }> { const toolEntry = await prisma.toolEntry.findFirst({ @@ -91,8 +92,8 @@ export async function getToolsForQuery(query: string, page: number, pageSize: nu const skip = (page - 1) * pageSize const toolEntries = await prisma.toolEntry.findMany({ where: { reference: { contains: query } }, - take: pageSize, - skip: skip > 0 ? skip : undefined, + take: page != all ? pageSize : undefined, + skip: skip > 0 && page != all ? skip : undefined, }) const tools: Record = {} diff --git a/tool.gpt b/tool.gpt index e4cfcfb..3b3ad5f 100644 --- a/tool.gpt +++ b/tool.gpt @@ -4,7 +4,7 @@ description: Finds a tool that matches the prompt provided, if one exists. args: prompt: Prompt that describes a tool to be found Do each of the following one after the other. -1. Go to "https://tools.gptscript.ai/api/search". DO NOT CHANGE THIS URL IN ANY WAY. +1. Go to "https://tools.gptscript.ai/api/search?page=-1". DO NOT CHANGE THIS URL IN ANY WAY. 2. From the response, look for a tool that is described by ${prompt}. 3. Return a list of names and URLs for each tool you find. Each URL should be in the form of https://tools.gptscript.ai/{github url without https://}. If more than one