Search

3,285 results found for β€œopenai” (3368ms)

Code
3,190

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" },
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" },
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" },
{
"emoji": "Single emoji summarizing the text",
"fullResponse": "JSON string containing the full OpenAI API response",
"fromCache": "Boolean indicating whether the response was retrieved from cache"
}
{
"emoji": "πŸ•",
"fullResponse": "{ ... full OpenAI API response ... }",
"fromCache": false
}
Note: The fullResponse field contains the complete OpenAI API response as a JSON string.
You may want to parse this JSON string to access specific details of the API response.
Caching:
The API now uses SQLite to cache responses. If a request for the same text is made again,
the cached emoji will be returned without calling the OpenAI API. This reduces API calls
and improves response times for repeated queries.`}
</pre>
export default async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const openai = new OpenAI();
const url = new URL(request.url);
}
// If not in cache, call OpenAI API
const completion = await openai.chat.completions.create({
messages: [
{ role: "system", content: "You are an emoji summarizer. Given a text, respond with ex
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" },
- subscription
- chatgpt
- openai
- billing
---
### Quick Links
- [ChatGPT Website](https://chat.openai.com)
- [Account Settings](https://chat.openai.com/settings)
### Subscription Details
### Support
- [ChatGPT Help Center](https://help.openai.com)
- [OpenAI Documentation](https://platform.openai.com/docs)
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" },