GPTs
Virtual Assistants made in ChatGPT.
All GPTs can be used in all languages.
Fashion design
Holistic Health
Psychotherapie
Financiën
Lesgeven aan anderstaligen (Nederlands)
- Conspiracies are true - fun research into conspiracy theories
Astrology
Human Design
AI
Massage
Relationships
Art Design
Computer support
Cutting edge science
Spiritualiteit en levenskunst
Journalistiek en schrijven
Muziekcompositie en teksten
Praat met een GPT!
Antwoord:
// app.js
async function sendMessage() {
const input = document.getElementById("userInput").value;
const responseDiv = document.getElementById("response");
const apiKey = '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'; // Voeg hier je OpenAI API-sleutel in
const data = {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": input}]
};
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`
},
body: JSON.stringify(data)
};
try {
const response = await fetch("https://api.openai.com/v1/chat/completions", options);
const json = await response.json();
const gptReply = json.choices[0].message.content;
responseDiv.innerText = gptReply;
} catch (error) {
responseDiv.innerText = "Er ging iets mis!";
console.error(error);
}
}
import OpenAI from "openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{"role": "user", "content": "write a haiku about ai"}
]
});