Skip to content

Commit b515dcf

Browse files
committed
no api key
1 parent 9743f77 commit b515dcf

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

app.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ const POINT_CLOUDS = {
99

1010
// Function to generate point cloud based on instruction
1111
async function processInstruction() {
12-
const apiKey = document.getElementById('apiKey').value;
1312
const instruction = document.getElementById('instruction').value;
1413

15-
if (!apiKey) {
16-
alert('Please enter your OpenAI API Key');
17-
return;
18-
}
1914
if (!instruction) {
2015
alert('Please enter an instruction');
2116
return;
@@ -26,14 +21,14 @@ async function processInstruction() {
2621

2722
try {
2823
// Call OpenAI API
29-
const response = await fetch('https://api.openai.com/v1/chat/completions', {
24+
const response = await fetch('https://openai-cf.codediffuser.workers.dev/v1/chat/completions', {
3025
method: 'POST',
3126
headers: {
3227
'Content-Type': 'application/json',
33-
'Authorization': `Bearer ${apiKey}`
28+
'Authorization': `Bearer robopil_codediffuser`
3429
},
3530
body: JSON.stringify({
36-
model: "gpt-3.5-turbo",
31+
model: "@cf/meta/llama-2-7b-chat-int8",
3732
messages: [{
3833
role: "user",
3934
content: `Based on this instruction: "${instruction}", select the most appropriate 3D shape from these options:

index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
<div class="container">
3737
<h1 class="mb-4">3D Point Cloud Generator</h1>
3838

39-
<div class="input-group mb-3">
40-
<input type="password" id="apiKey" class="form-control" placeholder="Enter your OpenAI API Key">
41-
</div>
42-
4339
<div class="input-group">
4440
<input type="text" id="instruction" class="form-control" placeholder="Enter your instruction (e.g., 'Generate a sphere with 1000 points')">
4541
<button class="btn btn-primary" onclick="processInstruction()">Generate</button>

0 commit comments

Comments
 (0)