From 805719557e1df6b6180cbea195c5d45f67fcd73d Mon Sep 17 00:00:00 2001 From: berkingurcan Date: Fri, 15 Nov 2024 18:23:40 +0700 Subject: [PATCH] update for proto --- app/api/chat/prompts.ts | 1 + lib/tools/utils/pinecone.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/api/chat/prompts.ts b/app/api/chat/prompts.ts index 964b010..50efa19 100644 --- a/app/api/chat/prompts.ts +++ b/app/api/chat/prompts.ts @@ -25,6 +25,7 @@ Always use multiple tools at the same time - codeTool: It retrieves context about code examples from o1js tutorials. You must use this tool at least once before writing any code. - projectTool: It retrieves context from codebase which has various zkApps projects. Do not forget, some codes in here may be deprecated. - issueTool: It retrieves context about errors, problems, discussions, issues about o1js and zkApps. +- protoTool: It retrieves context from Protokit documentation, if user asks about protokit, runtime modules etc. use this tool. ## Must Do's * Rename Party class to AccountUpdate. diff --git a/lib/tools/utils/pinecone.ts b/lib/tools/utils/pinecone.ts index 6bb0182..52f18b2 100644 --- a/lib/tools/utils/pinecone.ts +++ b/lib/tools/utils/pinecone.ts @@ -10,7 +10,7 @@ export type Metadata = { hash: string } -type VectorType = 'docs' | 'code' | 'project' | 'issue' | 'search' | 'demoSearch' +type VectorType = 'docs' | 'code' | 'project' | 'issue' | 'search' | 'demoSearch' | 'proto' function getVectorType(vector_type: string): string | undefined { if (!isVectorType(vector_type)) { @@ -22,14 +22,15 @@ function getVectorType(vector_type: string): string | undefined { project: process.env.PROJECT_VECTOR_TYPE, issue: process.env.ISSUE_VECTOR_TYPE, search: process.env.SEARCH_VECTOR_TYPE, - demoSearch: process.env.DEMO_SEARCH_VECTOR_TYPE + demoSearch: process.env.DEMO_SEARCH_VECTOR_TYPE, + proto: 'proto' } return vectorTypeMap[vector_type] } function isVectorType(type: string): type is VectorType { - return ['docs', 'code', 'project', 'issue', 'search', 'demoSearch'].includes(type) + return ['docs', 'code', 'project', 'issue', 'search', 'demoSearch', 'proto'].includes(type) } const getMatchesFromEmbeddings = async (