Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxrfv9090 committed May 27, 2023
1 parent 703afb0 commit 3b8dd52
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
62 changes: 62 additions & 0 deletions API TEST/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>

<head>
<title>Chat with GPT</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function () {
var conversation = [];

function logMessage(message) {
var logBox = document.getElementById("log-box");
logBox.innerHTML += "<p>" + message + "</p>";
}

function sendMessage() {
var userInput = document.getElementById("user-input");
var message = userInput.value;
userInput.value = "";

conversation.push("User: " + message);
logMessage("User: " + message);

$.ajax({
type: "POST",
url: "https://api.openai.com/v1/engines/davinci-codex/completions",
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Bearer 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");
},
data: JSON.stringify({
prompt: conversation.join("\n"),
max_tokens: 100,
temperature: 0.6
}),
success: function (data) {
var response = data.choices[0].text.trim();
conversation.push("AI: " + response);
logMessage("AI: " + response);
},
contentType: "application/json"
});
}

var inputForm = document.getElementById("input-form");
inputForm.addEventListener("submit", function (event) {
event.preventDefault();
sendMessage();
});
});
</script>
</head>

<body>
<h1>Chat with GPT</h1>
<div id="log-box"></div>
<form id="input-form">
<input type="text" id="user-input" placeholder="Enter your message..." required>
<button type="submit">Send</button>
</form>
</body>

</html>
2 changes: 1 addition & 1 deletion Git and GitHub trouble shooting/OtherComputerSetup.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ <h3>Merging New Changes To Existing Repository From a New Machine</h3>
<h2 class="T">$ git init</h2>
<h2 class="T">$ remote -v</h2>
<h2 class="T">$ git add .</h2>
<h2 class="T">$ git commit -m</h2>
<h2 class="T">$ git config --global.user.email "[email protected]"</h2>
<h2 class="T">$ git config --global user.name "Davy"</h2>
<h2 class="T">$ git commit -m</h2>
<h2 class="T">$ git remote add origin https://github.com/wsxrfv9090/Test.git</h2>
<h2 class="T">$ git pull origin master</h2>
<h2 class="T">$ git push origin master</h2>
Expand Down
2 changes: 1 addition & 1 deletion Git and GitHub trouble shooting/SetUpNewRepo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ <h1>SET UP NEW REPOSITORY</h1>
<h3>How To Set Up A Repository On A New Machine Step By Step</h3>
<h2 class="T">$ git init</h2>
<h2 class="T">$ git add .</h2>
<h2 class="T">$ git commit -m</h2>
<h2 class="T">$ git config --global.user.email "[email protected]"</h2>
<h2 class="T">$ git config --global user.name "Davy"</h2>
<h2 class="T">$ git commit -m</h2>
<h2 class="T">$ git remote add origin https://github.com/wsxrfv9090/Test.git</h2>
<h2 class="T">$ git push -u origin master</h2>
<h2 class="T"></h2>
Expand Down

0 comments on commit 3b8dd52

Please sign in to comment.