groqAudioChattts.ts1 match
26console.log("🔊 Sending request to Groq Speech API");
27const start = Date.now();
28const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
29method: "POST",
30headers: {
groqAudioChatchat.ts1 match
20console.log("🔵 Sending request to Groq API");
21const start = Date.now();
22const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
23method: "POST",
24headers: {
groqAudioChataudio.ts1 match
63console.log("🎤 Sending request to Groq Whisper API");
64const start = Date.now();
65const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
66method: "POST",
67headers: {
groqAudioChat_migratedmain.tsx3 matches
68console.log("🎤 Sending request to Groq Whisper API");
69const start = Date.now();
70const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
71method: "POST",
72headers: {
158console.log("🔵 Sending request to Groq API");
159const start = Date.now();
160const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
161method: "POST",
162headers: {
214console.log("🔊 Sending request to Groq Speech API");
215const start = Date.now();
216const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
217method: "POST",
218headers: {
equitableMaroonCrabmain.tsx3 matches
1export default async function (e: Email) {
2const { OpenAI } = await import("https://esm.town/v/std/openai");
3const openai = new OpenAI();
45const skinkDescription = await openai.chat.completions.create({
6messages: [
7{
OpenTowniesystem_prompt.txt4 matches
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144messages: [
145{ role: "user", content: "Say hello in a creative way" },
confidentWhiteOxmain.tsx3 matches
1import { OpenAI } from "https://esm.town/v/std/openai";
23const openai = new OpenAI();
45const completion = await openai.chat.completions.create({
6messages: [
7{
rousingBronzeMandrillmain.tsx4 matches
112113try {
114const { OpenAI } = await import("https://esm.town/v/std/openai");
115const openai = new OpenAI();
116117const parseResponse = await openai.chat.completions.create({
118messages: [{
119role: "system",
128129const parsedQuery = parseResponse.choices[0].message.content || '';
130Logger.log('OpenAI parsed query', { parsedQuery });
131132const [rootNode, context] = parsedQuery.split('|').map(s => s.trim());
EchoPromptermain.tsx9 matches
936if (typeof document !== "undefined") { client(); }
937export default async function server(request: Request): Promise<Response> {
938const { OpenAI } = await import("https://esm.town/v/std/openai");
939const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
940const openai = new OpenAI();
941942// Use the val's URL as a unique key for database tables
1039const echoPrompt = getEchoPrompt();
10401041const completion = await openai.chat.completions.create({
1042messages: [
1043{
10951096// First, generate the agent prompt
1097const completion2 = await openai.chat.completions.create({
1098messages: [
1099{
11211122// Then, generate commands for the agent based on its purpose and description
1123const commandsCompletion = await openai.chat.completions.create({
1124messages: [
1125{
1227}
12281229// Format the history into OpenAI message format
1230const messages = [
1231{
1237// Add conversation history if it exists
1238if (history && history.length > 0) {
1239// Filter out system messages and map to OpenAI format
1240history.forEach(msg => {
1241if (msg.role !== "system") {
12551256// Chat with the agent using the stored prompt and history
1257const completion = await openai.chat.completions.create({
1258messages: messages,
1259model: "gpt-4o-mini",
13741375// Execute the command with the AI
1376const completion = await openai.chat.completions.create({
1377messages: messages,
1378model: "gpt-4o-mini",
groqAudioChattts.ts1 match
26console.log("🔊 Sending request to Groq Speech API");
27const start = Date.now();
28const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
29method: "POST",
30headers: {