-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
703afb0
commit 3b8dd52
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|