Ai-Search (Auto RAG) with folder-based filtering using the gt, gte, and eq filter types. Filtering works as expected when targeting a top-level folder, but fails when specifying a sub-folder.customer-a as well as its sub-folders:@cf/meta/llama-3.1-8b-instruct-fast but can't find it on the dashboard wrangler login via my package manager (e.g. npx wrangler login or bun wrangler login in my case) to get it to work again. it’s always error code: 1031 that tells me i need to do that.bge-reranker-v2-m3 ? would be useful to plenty of folks
createWorkersAI({ binding: env.AI, gateway: { id: GATEWAY_ID }});
server.tool callback?toMarkdown method (rest api). The request looks like it was successful: I get document metadata, Contents, and numbered pages in response, but the pages themselves contain no data. However, there is data on the pdf's pages (text and images). Do you have any explanations/solutions for this?Ai-Search (Auto RAG)gtgteeqcustomer-a@cf/meta/llama-3.1-8b-instruct-fast ai.toMarkdown()wrangler loginnpx wrangler loginbun wrangler loginbge-reranker-v2-m3const aiGateway = createAiGateway({
accountId: env.CF_ACCOUNT_ID,
gateway: GATEWAY_ID,
apiKey: env.CF_API_KEY,
options: {
cacheTtl: 3600,
},
});
const workersai = createWorkersAI({ binding: env.AI });
const model = workersai("@cf/meta/llama-3.1-8b-instruct", {
safePrompt: true,
});
const { text } = await generateText({
model: aiGateway(model),
prompt: "Write a multi-part greeting.",
});createWorkersAI({ binding: env.AI, gateway: { id: GATEWAY_ID }});server.tooltoMarkdown{
"query": "Cat",
"filters": {
"type": "gt",
"key": "folder",
"value": "customer-a//"
}
}{
"filters": {
"type": "gt",
"key": "folder",
"value": "customer-a/sub-folder"
}
}{
"filters": {
"type": "gte",
"key": "folder",
"value": "customer-a/sub-folder"
}
}{
"filters": {
"type": "eq",
"key": "folder",
"value": "customer-a/sub-folder"
}
}{
"filters": {
"type": "gte",
"key": "folder",
"value": "customer-a/sub-folder//"
}
}{
"filters": {
"type": "gte",
"key": "folder",
"value": "customer-a//sub-folder"
}
}import { createMcpHandler } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
const server = new McpServer({
name: "Hello MCP Server",
version: "1.0.0",
});
server.tool(
"hello",
"Returns a greeting message",
{ name: z.string().optional() },
async ({ name }) => {
return {
content: [
{
text: `Hello, ${name ?? "World"}!`,
type: "text",
},
],
};
},
);
export default {
fetch: async (request: Request, env: Env, ctx: ExecutionContext) => {
const handler = createMcpHandler(server);
return handler(request, env, ctx);
},
};# 2.pdf
## Metadata
- PDFFormatVersion=1.4
- IsLinearized=false
- IsAcroFormPresent=false
...
## Contents
### Page 1
### Page 2
### Page 3
...