Skip to content

Commit

Permalink
update docs handling and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 24, 2024
1 parent caabb33 commit 4f1b6cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
19 changes: 5 additions & 14 deletions scripts/docs.sh
Original file line number Diff line number Diff line change
@@ -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."
12 changes: 6 additions & 6 deletions scripts/processDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f1b6cd

Please sign in to comment.