Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.
Discussion options

You must be logged in to vote

It's what the Copilot Chat extension does in VSCode. It takes the file you're on and uses tree-sitter to get all functions & classes. It then submits your code to the embedding API

def _get_embeddings(self, inputs: list[typings.FileExtract]):
embeddings = []
url = "https://api.githubcopilot.com/embeddings"
# If we have more than 18 files, we need to split them into multiple requests
for i in range(0, len(inputs), 18):
if i + 18 > len(inputs):
data = utilities.generate_embedding_request(inputs[i:])
else:
data = utilities.generate_embedding_request(inputs[i : i + 18])

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by jellydn
Comment options

You must be logged in to vote
1 reply
@gptlang
Comment options

gptlang Jan 27, 2024
Collaborator

Comment options

You must be logged in to vote
1 reply
@gptlang
Comment options

gptlang Jan 27, 2024
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants