Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jsalsman authored May 18, 2024
1 parent 07bdea1 commit 11ba412
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1>Voice instructional role-playing game generator</h1>

<script>
// from https://docs.vapi.ai/examples/voice-widget
// kind of want to use a <iframe> for https://vapi.ai?demo=true&shareKey=4922b20f-1964-400c-ac08-21b6889bf23d&assistantId=b9323c5b-7c81-4371-8666-4cd2a04338a5

var vapiInstance = null;
const assistant = "b9323c5b-7c81-4371-8666-4cd2a04338a5"; // assistant ID
Expand Down Expand Up @@ -81,20 +82,23 @@ <h1>Voice instructional role-playing game generator</h1>
};
})(document, "script");

function log(message) {
function log(message) {
// Create a timestamp
var timestamp = new Date().toLocaleTimeString();

// Create a <pre> element
var pre = document.createElement('pre');

// Set the message as the text content of the <pre> element
pre.textContent = message;
// Set the message with the timestamp as the text content of the <pre> element
pre.textContent = `[${timestamp}] ${message}`;

// Apply the desired font size and family
pre.style.fontSize = '13pt';
pre.style.fontSize = '11pt';
pre.style.fontFamily = 'sans-serif';

// Append the <pre> element to the body
document.body.appendChild(pre);
}
}

// Function calls and transcripts will be sent via messages
vapiInstance.on('message', (message) => {
Expand Down

0 comments on commit 11ba412

Please sign in to comment.