Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance OpenAI API Specification with Interactive Documentation and Examples #305

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0ecabce
updated readme.md file and added requirements.txt file
davidtkeane Aug 6, 2024
4616a05
updated readme.md file with correct url this git
davidtkeane Aug 6, 2024
74a025a
updated readme.md file with images as i followed the install steps an…
davidtkeane Aug 7, 2024
83c1533
add images and updated the readme
davidtkeane Aug 7, 2024
3e0093f
added example folder and openai_test.py file to test api key
davidtkeane Aug 7, 2024
2b79914
updated the readme moved the Stars badge to next line
davidtkeane Aug 7, 2024
d1dd348
Merge branch 'openai:master' into master
davidtkeane Aug 7, 2024
b61cf26
added index.html and removed requirements.txt
davidtkeane Aug 7, 2024
e956185
corrected the broken links for the images, I need to upload them on a…
davidtkeane Aug 7, 2024
47b4e1e
removed requirments.txt file as i am not sure if it is needed, but mo…
davidtkeane Aug 7, 2024
dd33f6e
Updated the readme and moved images around in usage
davidtkeane Aug 7, 2024
0da9a19
Updated the readme and correct link for congrats image
davidtkeane Aug 7, 2024
db74b46
Added images created from ChatGPT DALL-E GPTS to make the images. Add…
davidtkeane Aug 7, 2024
bad78df
changed the table of contents to add other sections, YAML, CURL and C…
davidtkeane Aug 7, 2024
2fc4566
Modified the table of contents, YAML and the others are not working. …
davidtkeane Aug 7, 2024
2eb58ef
Changed the table of contents now and checking if the new changes mad…
davidtkeane Aug 7, 2024
1b47050
Added Python to table of contents and added instructions above the py…
davidtkeane Aug 7, 2024
a9a202a
Changed the position of repository to below the into image
davidtkeane Aug 7, 2024
61ae63e
Moved CURL instructions that were below to the top of the CURL code.
davidtkeane Aug 7, 2024
883fe24
Some ** were missing and were showing in the readme, altered and look…
davidtkeane Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 374 additions & 1 deletion README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions example/openai_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import openai
import requests

# Set your OpenAI API key
OPENAI_API_KEY = "sk-proj-youownapikey"

# Make a request to the OpenAI API
url = "https://api.openai.com/v1/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {OPENAI_API_KEY}"
}
data = {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello, how are you?"}]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
Binary file added image/README/Inspiring-warm-intro.webp
Binary file not shown.
Binary file added image/README/examples.webp
Binary file not shown.
Binary file added image/README/http-server-connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/README/http-server-working.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/README/https-server-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/README/install.webp
Binary file not shown.
Binary file added image/README/introduction.webp
Binary file not shown.
Binary file added image/README/learning.webp
Binary file not shown.
Binary file added image/README/npm_warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/README/prerequisites.webp
Binary file not shown.
Binary file added image/README/working.webp
Binary file not shown.
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OpenAI API Specification</title>
<link rel="stylesheet" href="node_modules/swagger-ui-dist/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="node_modules/swagger-ui-dist/swagger-ui-bundle.js"></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: "openapi.yaml",
dom_id: "#swagger-ui",
});
};
</script>
</body>
</html>