Search

3,343 results found for openai (1849ms)

Code
3,248

import { email } from "https://esm.town/v/std/email";
import { OpenAI } from "https://esm.town/v/std/OpenAI";
// ------------------------------ Email Address ------------------------------
console.log(e);
// Use OpenAI provided by Val Town to reply to the email
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
role: "user",
// ---------------- Val Town Standard Library ----------------
// Val Town provides limited free hosted services, including
// functions for sending emails and using OpenAI
import { email } from "https://esm.town/v/std/email";
import { OpenAI } from "https://esm.town/v/std/OpenAI";
// --------------------- Get weather data --------------------
export default async function() {
// Use OpenAI provided by Val Town to get weather reccomendation
// Experiment with changing the prompt
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
role: "user",
import { email } from "https://esm.town/v/std/email";
import { OpenAI } from "https://esm.town/v/std/OpenAI";
// ------------------------------ Email Address ------------------------------
console.log(e);
// Use OpenAI provided by Val Town to reply to the email
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
role: "user",
// ---------------- Val Town Standard Library ----------------
// Val Town provides limited free hosted services, including
// functions for sending emails and using OpenAI
import { email } from "https://esm.town/v/std/email";
import { OpenAI } from "https://esm.town/v/std/OpenAI";
// --------------------- Get weather data --------------------
export default async function() {
// Use OpenAI provided by Val Town to get weather reccomendation
// Experiment with changing the prompt
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
role: "user",
Configure the following variables in your environment:
- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
- `OPENAI_API_KEY` (An OpenAI API Key)
- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
import { anthropic } from "npm:@ai-sdk/anthropic";
import { openai } from "npm:@ai-sdk/openai";
import { generateText, streamText } from "npm:ai";
import { getSystemPrompt } from "./prompt.tsx";
const maxSteps = 10;
ROPIC_API_KEY") ? anthropic("claude-3-7-sonnet-latest") : openai("gpt-4.1");
const options = {
Configure the following variables in your environment:
- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
- `OPENAI_API_KEY` (An OpenAI API Key)
- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
import { anthropic } from "npm:@ai-sdk/anthropic";
import { openai } from "npm:@ai-sdk/openai";
import { generateText, streamText } from "npm:ai";
import { getSystemPrompt } from "./prompt.tsx";
const maxSteps = 10;
ROPIC_API_KEY") ? anthropic("claude-3-7-sonnet-latest") : openai("gpt-4.1");
const options = {
id: string;
step: string;
type: 'yahoo_api' | 'openai' | 'processing';
status: 'pending' | 'loading' | 'success' | 'error';
startTime?: Date;
{ id: 'player_performance', name: 'Player Performance Analysis', type: 'processing' as const
{ id: 'waiver_research', name: 'Waiver Wire Research', type: 'yahoo_api' as const },
{ id: 'ai_team_analysis', name: 'AI Team Analysis', type: 'openai' as const },
commendations', name: 'AI Waiver Recommendations', type: 'openai' as const },
{ id: 'final_processing', name: 'Final Processing', type: 'processing' as const }
];
case 'ai_team_analysis':
return simulateOpenAiCall('team_analysis', {
model: 'gpt-4o-mini',
promptType: 'team_performance'
case 'ai_waiver_recommendations':
return simulateOpenAiCall('waiver_recommendations', {
model: 'gpt-4o-mini',
promptType: 'waiver_analysis'
};
const simulateOpenAiCall = async (type: string, config: any): Promise<any> => {
// Simulate OpenAI API delay
await new Promise(resolve => setTimeout(resolve, Math.random() * 5000 + 2000));
import { email } from "https://esm.town/v/std/email";
import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
import { OpenAI } from "npm:openai";
function stripHtmlBackticks(html: string): string {
export default async function(e: Email) {
const openai = new OpenAI();
console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`);
}
const summary = await openai.chat.completions.create({
messages: [
{