Skip to content

Commit

Permalink
Fixed debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
craigloewen-msft committed Apr 9, 2024
1 parent 6811e88 commit d4c44bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 266 deletions.
10 changes: 10 additions & 0 deletions backendsrc/embeddingsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class embeddingsHandler {
this.maxConcurrentRequests = 3;
this.pineconeSemaphore = new Semaphore(this.maxConcurrentRequests);
this.azureSemaphore = new Semaphore(this.maxConcurrentRequests);

this.debugDisableEmbeddings = inConfigObject.debugDisableEmbeddings;
}

async addEmbedding(inputIssue) {
Expand All @@ -29,6 +31,10 @@ class embeddingsHandler {

let embeddingObject = null;

if (this.debugDisableEmbeddings) {
return;
}

await this.azureSemaphore.runExclusive(async () => {
embeddingObject = await this.azureClient.getEmbeddings("issue-body-embeddings-model", description);
});
Expand Down Expand Up @@ -65,6 +71,10 @@ class embeddingsHandler {
// Create title + body description
const description = [issueDescription];

if (this.debugDisableEmbeddings) {
return [];
}

// Query azure for embeddings
const inputVector = await this.azureClient.getEmbeddings("issue-body-embeddings-model", description);

Expand Down
2 changes: 2 additions & 0 deletions defaultconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ module.exports = {
'ghToken': null,
'azureOpenAIAPIKey': "key",
'azureEndpointURL' : "url",
'pineconeAPIKey' : 'key',
'debugDisableEmbeddings': true,
};
Loading

0 comments on commit d4c44bc

Please sign in to comment.