Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork155
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
require('CopilotChat.config').functions.vectorspace= {description='Semantic search through workspace using vector embeddings. Find relevant code with natural language queries.',schema= {type='object',properties= {query= {type='string',description='The search query to find relevant code snippets.', },max= {type='integer',description='Maximum number of results to return.',default=10, }, },required= {'query'}, },resolve=function(input,source)localutils=require('CopilotChat.utils')localembeddings=utils.curl_post('http://localhost:8000/query', {json_request=true,json_response=true,body= {dir=source.cwd(),text=input.query,max=tonumber(input.maxor10), } }).bodyutils.schedule_main()returnvim.iter(embeddings) :map(function(embedding)embedding.filetype=utils.filetype(embedding.filename)returnembeddingend) :filter(function(embedding)returnembedding.filetypeend) :map(function(embedding)return {uri='file://'..embedding.filename,name=embedding.filename,mimetype=utils.filetype_to_mimetype(utils.filetype(embedding.filename)),data=embedding.text, }end) :totable()end,} This is example on how to run my toy self hosted vector database indexing solution: https://github.com/deathbeam/vectorspace You need to have it installed and running, so It will then listed on It will automatically start indexing and watching chat source buffer working dir when you use the context for first time, so first time there might not be any results. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 7
Replies: 0 comments
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment