diff --git a/scripts/docs.sh b/scripts/docs.sh index 5f39116..14dcc9a 100644 --- a/scripts/docs.sh +++ b/scripts/docs.sh @@ -1,21 +1,12 @@ #!/bin/bash # Step 1: Clone the aframe repository -git clone https://github.com/aframevr/aframe --depth 1 +git clone https://github.com/jointhealliance/bgent --depth 1 -# Step 2: Delete the scripts/docs directory if it exists -rm -rf scripts/docs +# Step 2: Run the processDocs.mjs script on scripts/docs/ +node scripts/processDocs.js bgent/docs/ -# Step 3: Copy the aframe/docs directory to scripts/docs -cp -r aframe/docs scripts/docs - -# Step 4: Run the processDocs.mjs script on scripts/docs/ -node scripts/processDocs.js scripts/docs/ - -# Step 5: Delete the cloned aframe directory -rm -rf aframe - -# Step 6: Delete the scripts/docs directory -rm -rf scripts/docs +# Step 3: Delete the cloned aframe directory +rm -rf bgent echo "Process completed." diff --git a/scripts/processDocs.js b/scripts/processDocs.js index 34e1ac8..ed7f939 100644 --- a/scripts/processDocs.js +++ b/scripts/processDocs.js @@ -77,14 +77,14 @@ const processDocument = async (filePath) => { // TODO: check if the check exists in the database if (chunk) { - const { data, error } = await supabase + const { data } = await supabase .from('lore') .select('*') - .eq('content', chunk); - if (error) { - console.error('Error fetching lore:', error); - // return; - } + .eq('content', { content: chunk }); + // if (error) { + // console.error('Error fetching lore:', error); + // // return; + // } if (data?.length === 0) { console.log('adding lore'); diff --git a/src/index.ts b/src/index.ts index 33d1241..9a11bbb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -341,7 +341,11 @@ router.post('/', async (request, env, event) => { (async () => { let responseContent = 'How can I assist you?'; // Default response if (interaction.data.name === HELP_COMMAND.name) { + console.log('handling help command'); + console.log('OPENAI_API_KEY', env.OPENAI_API_KEY); + console.log('message', message); const data = (await runtime.handleRequest(message)) as Content; + console.log('data', data); responseContent = `You asked: \`\`\`${ (message.content as Content).content