Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
deftio committed Jul 30, 2024
1 parent f0c4b99 commit 7e34770
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/dual-chatrooms.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<!-- Include Bootstrap CSS file -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<!-- Include Yackbox Chat CSS file -->
<!-- Include Quik Chat CSS file -->
<link rel="stylesheet" href="../dist/quikchat.css">

<!-- Include Yackbox Chat JavaScript file -->
<!-- Include Quik Chat JavaScript file -->
<script src="../dist/quikchat.umd.min.js"></script>

<style>
Expand Down
8 changes: 5 additions & 3 deletions examples/openai.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ <h3>Settings</h3>
<br><br>
<button class="btn btn-primary" type="submit">Save Settings</button><br>
Saving settings, stores the prompt, api key, and base url in a cookie on your local machine. No information is sent to any server.
<div id="response"></div>
</form>
</div>
<div class="col-7" id="chatContainer">
Expand All @@ -98,11 +99,12 @@ <h3>Chat</h3>
const baseUrl = document.getElementById('baseUrl').value || 'https://api.openai.com/v1/chat/completions';
const prompt = document.getElementById('prompt').value || 'Tell me a story';
const responseDiv = document.getElementById('response');

responseDiv.innerHTML = '';
chatInstance.messageAddNew(userInput, "user", "right");

console.log (baseUrl)
console.log (apiKey)
const data = {
model: 'gpt-4o',
model: 'gpt-4o-mini',
messages: [
{ role: 'system', content: prompt }, // this is the base prompt
...chatInstance.historyGet() // get the chat history and add it to the prompt
Expand Down

0 comments on commit 7e34770

Please sign in to comment.