Search

3,921 results found for openai (2028ms)

Code
3,818

Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
import { nanoid } from "https://esm.sh/nanoid@5.0.5";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
import { Configuration, OpenAIApi } from "npm:openai";
const TABLE_NAME = `memories`;
async function generateFunFacts(previousFacts) {
try {
const apiKey = Deno.env.get("OPENAI_API_KEY");
if (!apiKey) {
console.error("OpenAI API key is not configured.");
return null;
}
const configuration = new Configuration({ apiKey });
const openai = new OpenAIApi(configuration);
const previousFactsText = previousFacts
`;
const completion = await openai.createChatCompletion({
model: "gpt-4", // 可以选择 "gpt-3.5-turbo"
messages: [
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
* Paste this whole file into a new Val and hit save.
* It renders an endlessly swirling radial vortex with shifting colours.
* – ChatGPT (OpenAI o3) 20250417
*/
console.log("🎤 Sending request to Groq Whisper API");
const start = Date.now();
const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
method: "POST",
headers: {
console.log("🔵 Sending request to Groq API");
const start = Date.now();
const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
method: "POST",
headers: {
console.log("🔊 Sending request to Groq Speech API");
const start = Date.now();
const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
method: "POST",
headers: {
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },