Skip to content

Commit

Permalink
Use env for verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Sep 27, 2023
1 parent 00de018 commit da65a39
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,9 @@ async function onCommand(worker, message) {

// run these in main process to avoid polluting RAM with the memory hungry tokenization library
case 'generateSummary': {
let requestOpts = {};
let requestOpts = {
verbose: getBoolean(process.env.EE_OPENAPI_VERBOSE)
};

let openAiAPIKey = message.data.openAiAPIKey || (await settings.get('openAiAPIKey'));

Expand Down Expand Up @@ -1423,7 +1425,9 @@ async function onCommand(worker, message) {

// run these in main process to avoid polluting RAM with the memory hungry tokenization library
case 'generateEmbeddings': {
let requestOpts = {};
let requestOpts = {
verbose: getBoolean(process.env.EE_OPENAPI_VERBOSE)
};

let openAiAPIKey = message.data.openAiAPIKey || (await settings.get('openAiAPIKey'));

Expand All @@ -1449,7 +1453,7 @@ async function onCommand(worker, message) {

case 'embeddingsQuery': {
let requestOpts = {
verbose: true
verbose: getBoolean(process.env.EE_OPENAPI_VERBOSE)
};

let openAiAPIKey = message.data.openAiAPIKey || (await settings.get('openAiAPIKey'));
Expand Down Expand Up @@ -1506,7 +1510,9 @@ async function onCommand(worker, message) {

// run these in main process to avoid polluting RAM with the memory hungry tokenization library
case 'generateChunkEmbeddings': {
let requestOpts = {};
let requestOpts = {
verbose: getBoolean(process.env.EE_OPENAPI_VERBOSE)
};

let openAiAPIKey = message.data.openAiAPIKey || (await settings.get('openAiAPIKey'));

Expand Down

0 comments on commit da65a39

Please sign in to comment.