Skip to content

Commit

Permalink
updated index file
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisekjha committed Jun 10, 2024
1 parent c1cf9b4 commit 23cfce9
Show file tree
Hide file tree
Showing 2,697 changed files with 417,896 additions and 28 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#ignore env
.venv
credentials/
config.py
config.py/
14 changes: 14 additions & 0 deletions git_commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Add all changes
git add .

# Prompt for a custom commit message
read -p "Enter your commit message: " custom_message

# Commit with the custom message
git commit -m "$custom_message"

# Push to the main branch
git push origin main

# Check status
git status
138 changes: 111 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<title>Audio Bot</title>
<title>GenAI-Bot</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
* {
box-sizing: border-box
}
/* Set height of body and the document to 100% */
body, html {
height: 100%;
margin: 0;
font-family: Arial;
}
#chatbox {
margin-left: auto;
margin-right: auto;
width: 40%;
margin-top: 60px;
}
#userInput {
margin-left: auto;
margin-right: auto;
width: 40%;
margin-top: 60px;
}
#textInput {
width: 90%;
border: none;
border-bottom: 3px solid black;
font-family: monospace;
font-size: 17px;
}
.userText {
color: white;
font-family: monospace;
font-size: 17px;
text-align: right;
line-height: 30px;
}
.userText span {
background-color: #808080;
padding: 10px;
border-radius: 2px;
}
.botText {
color: white;
font-family: monospace;
font-size: 17px;
text-align: left;
line-height: 30px;
}
.botText span {
background-color: #4169e1;
padding: 10px;
border-radius: 2px;
}
#tidbit {
position: absolute;
bottom: 0;
right: 0;
width: 300px;
}
.boxed {
margin-left: auto;
margin-right: auto;
width: 78%;
margin-top: 60px;
border: 1px solid green;
}
</style>
</head>
<body>
<h1>Audio Bot</h1>
<input type="file" id="audioFile" accept="audio/*">
<button onclick="uploadAudio()">Upload</button>
<audio id="audioResponse" controls></audio>
<script>
function uploadAudio() {
var fileInput = document.getElementById('audioFile');
var file = fileInput.files[0];
var formData = new FormData();
formData.append('file', file);

fetch('https:/lila-beta-425214.uc.r.appspot.com/process_audio', {
method: 'POST',
body: formData
})
.then(response => response.blob())
.then(blob => {
var audioElement = document.getElementById('audioResponse');
var url = URL.createObjectURL(blob);
audioElement.src = url;
audioElement.play();
})
.catch(error => console.error('Error:', error));
}
</script>
<div>
<h1 align="center"><b>AI-Gen ChatBot</b></h1>
<h4 align="center"><b>Please start your personalized interaction with the chatbot</b></h4>
<p align="center"><img src="static\\chatbot1.png" alt="Python-BOT" height="210" width="220"></p>
<div class="boxed">
<div>
<div id="chatbox">
<p class="botText">
<span>Hi! I'm your AI-Generative Chatbot</span>
</p>
</div>
<div id="userInput">
<input id="textInput" type="text" name="msg" placeholder="Message" />
</div>
</div>
<script>
function getBotResponse() {
var rawText = $("#textInput").val();
var userHtml = '<p class="userText"><span>' + rawText + "</span></p>";
$("#textInput").val("");
$("#chatbox").append(userHtml);
document
.getElementById("userInput")
.scrollIntoView({ block: "start", behavior: "smooth" });
$.get("/get", { msg: rawText }).done(function (data) {
var botHtml = '<p class="botText"><span>' + data + "</span></p>";
$("#chatbox").append(botHtml);
document
.getElementById("userInput")
.scrollIntoView({ block: "start", behavior: "smooth" });
});
}
$("#textInput").keypress(function (e) {
if (e.which == 13) {
getBotResponse();
}
});
</script>
</div>
</div>
</body>
</html>
</html>
Loading

0 comments on commit 23cfce9

Please sign in to comment.