gpt-4o-mini / index.html
Quardo's picture
Updated space
df8d0a4
raw
history blame
7.96 kB
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quardo's OpenAI proxy</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Quardo's OpenAI proxy documentation">
<meta name="keywords" content="OpenAI, proxy, API, documentation, GPT-4O-mini">
<meta name="author" content="Quardo">
<meta property="og:title" content="Quardo's OpenAI proxy">
<meta property="og:description" content="Documentation for Quardo's OpenAI proxy">
<meta property="og:type" content="website">
<meta property="og:url" content="https://chat.cwrd.one/api/v1/docs">
<meta property="og:image" content="https://tenor.com/view/cat-cat-e-cat-meme-cat-face-gif-23642589">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Quardo's OpenAI proxy">
<meta name="twitter:description" content="Documentation for Quardo's OpenAI proxy">
<meta name="twitter:image" content="https://tenor.com/view/cat-cat-e-cat-meme-cat-face-gif-23642589">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/monokai.min.css">
<style>
body {font-family: Arial, sans-serif; background-color: #f4f4f9; color: #333; margin: 0; padding: 0;}
h1, h2 {color: #444; text-align: center;}
.main {max-width: 800px; margin: 20px auto; padding: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px;}
.CodeMirror {border: 1px solid #ddd; border-radius: 8px; margin: 20px 0;}
hr {border: 0; height: 1px; background: #ddd; margin: 40px 0;}
p {line-height: 1.6;}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/python/python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/shell/shell.min.js"></script>
</head>
<body>
<div class="main">
<hr/>
<h1>Documentation of the API/updates</h1>
<hr/>
<h2>Updates</h2>
<div>
<div>
<div>
<strong> - 8. Update.</strong>
<p> * Got new hosting for this space; <a href="https://chat.cow.rip/">chat.cow.rip</a></p>
<label>- The new hosting is provided by: repl.it.</label>
<label>- The updates to the space will first be released there,</label>
<label>- then later, they will come to the Hugging Face space, mostly due to the fact that repl.it is capable of faster build speeds.</label>
<label>- So in simple terms, <a href="https://chat.cow.rip/">chat.cow.rip</a> will be like a beta release for this space, and that's it.</label>
</div><hr/>
<strong> - 7. Update.</strong>
<p> * Added a second faketool: math. Now the model can perform calculations.</p>
</div><hr/>
<div>
<strong> - 6. Update.</strong>
<p> * Added image generation via DALL-E-3.</p>
</div><hr/>
<div>
<strong> - 5. Update Rollback (part 2).</strong>
<p> * Switched back to old model, as it at least did some enough check</p>
</div><hr/>
<div>
<strong> - 5. Update Rollback.</strong>
<p> * After just a day, the new moderation turns out to be <strong>*extreamly*</strong> strict, so moderation has been paused until i found a better way.</p>
<label>- By to *strict* i meant as blocking pretty much everything, unless it is something like 'Hello.'</label>
</div><hr/>
<div>
<strong> - 5. Update.</strong>
<p> * Added extreamly strict moderation.</p>
</div><hr/>
<div>
<strong> - 4. Update.</strong>
<p> * Added a user consent feature for the application's terms of use.</p>
</div><hr/>
<div>
<strong> - 3. Update.</strong>
<p> * Managed to fix the file being non-visible to the AI model after one round.</p>
<p> * And fix the div error on this page.</p>
</div><hr/>
<div>
<strong> - 2. Update.</strong>
<p> * Added light moderation. [Might add more strict detection later]</p>
</div><hr/>
<div>
<strong> - 1. Update.</strong>
<p> * Fixed a bug where file encoding could trash the entire chat.</p>
<p> * Made models allowed set by the maintainer. [OPENAI_API_MODELS variable]</p>
</div><hr/>
<div>
<p><strong id="w" alt="yes i love fear"> * </strong>yippeeee</p>
<script>let q=25;setInterval(_=>{q+=.001;w.style.fontSize=`${q}px`},100);</script>
<label style="font-size: 2px;">The message above is edited by a script every 100ms. you can check it via view-source.</label>
</div>
</div>
<hr/>
<h2>API Endpoints</h2>
<p>Here are some example codes to interact with the API:</p>
<p><strong>Note:</strong> By using our API, you acknowledge and agree to the following terms regarding the data you provide:</p>
<ul>
<li>Data Collection: This application may collect data shared through the Gradio endpoint or the API endpoint.</li>
<li>Privacy: Please avoid sharing any personal information.</li>
<li>Data Retention and Removal: Data files are deleted every 30 days, and the API is restarted to ensure data clearance.</li>
<li>Scope of Data Collected: The data collected includes model settings, chat history, and responses from the model. This applies only to 'chat' endpoints (Gradio and API) and excludes moderation checks.</li>
<li>Data Usage: The collected data is periodically reviewed, and if any concerning activity is detected, the code is updated accordingly.</li>
</ul>
<p>By continuing to use our API, you explicitly consent to the collection, use, and potential sharing of your data as described above. If you disagree with our data collection, usage, and sharing practices, we advise you not to use our API.</p>
<textarea id="example1" name="example1"># Example 1: Using OpenAI Python client
from openai import OpenAI
client = OpenAI(
# Or use the `OPENAI_BASE_URL` env var
base_url="https://chat.cwrd.one/api/v1",
# No key is needed cause this is a proxy
api_key="none"
)
completion = client.chat.completions.create( # or openai.ChatCompletion.create (idk)
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Say this is a test",
}
],
)
print(completion.choices[0].message.content)</textarea>
<hr/>
<textarea id="example2" name="example2"># Example 2: Using OpenAI Python client with different syntax
import openai
openai.api_key = 'none'
openai.base_url = "https://chat.cwrd.one/api/v1"
completion = openai.chat.completions.create( # or openai.ChatCompletion.create (idk)
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Say this is a test",
},
],
)
print(completion.choices[0].message.content)</textarea>
<hr/>
<textarea id="example3" name="example3"># For Node.js:
# I am too lazy to look into openai's docs
# so please kindly take a look at github there is probably examples there.</textarea>
<hr/>
<div>
<h3>Actual endpoints:</h3>
<p><strong>1. [GET]</strong> <a href="https://chat.cwrd.one/api/v1/models">/api/v1/models</a></p>
<label>Simply shows you the available models</label>
<p><strong>3. [POST]</strong> <a href="https://chat.cwrd.one/api/v1/chat/completions">/api/v1/chat/completions</a></p>
<label>Generates a chat completion based on the provided messages and model</label>
</div>
</div>
<script>
CodeMirror.fromTextArea(document.getElementById("example1"), { lineNumbers: true, mode: "python", theme: "monokai", readOnly: true });
CodeMirror.fromTextArea(document.getElementById("example2"), { lineNumbers: true, mode: "python", theme: "monokai", readOnly: true });
CodeMirror.fromTextArea(document.getElementById("example3"), { lineNumbers: true, mode: "shell", theme: "monokai", readOnly: true });
</script>
</body>
</html>