Search
Code3,166
apiKeyInput: '', // Model selection selectedModel: 'openai/gpt-oss-120b', // Browser search tool toggle useBrowserSearch: true, model: this.selectedModel, reasoning_effort: this.reasoningEffort, tools: (() => { const list = []; const isOss = !!(this.selectedModel && this.selectedModel.startsWith('openai/gpt-oss')); if (isOss) { if (this.useBrowserSearch) list.push({ type: 'browser_search' }); if (this.useCodeInterpreter) list.push({ type: 'code_interpreter' }); } return list; })(), temperature: this.temperature, ...(this.maxTokens ? { max_tokens: this.maxTokens } : {}), model: this.selectedModel, reasoning_effort: this.reasoningEffort, tools: (() => { const list = []; const isOss = !!(this.selectedModel && this.selectedModel.startsWith('openai/gpt-oss')); if (isOss) { if (this.useBrowserSearch) list.push({ type: 'browser_search' }); if (this.useCodeInterpreter) list.push({ type: 'code_interpreter' }); } return list; })(), temperature: this.temperature, ...(this.maxTokens ? { max_tokens: this.maxTokens } : {}),
state.selectedModel = storedModel; } else { state.selectedModel = 'openai/gpt-oss-120b'; } const storedBase = localStorage.getItem('chat_base_url'); state.selectedModel = storedModel; } else { state.selectedModel = 'openai/gpt-oss-120b'; } const storedBase = localStorage.getItem('chat_base_url');
<div class="relative"> <select x-model="selectedModel" @change="onModelChange()" class="px-2 py-1 pr-8 border border-gray-200 bg-white rounded-md focus:ring-2 focus:ring-blue-500 appearance-none text-xs w-full"> <option value="openai/gpt-oss-120b">openai/gpt-oss-120b</option> <option value="openai/gpt-oss-20b">openai/gpt-oss-20b</option> <option value="llama-3.1-8b-instant">llama-3.1-8b-instant</option> <option value="llama-3.3-70b-versatile">llama-3.3-70b-versatile</option> <span>JSON mode</span> </label> <label class="inline-flex items-center gap-2 text-xs" x-show="selectedModel && selectedModel.startsWith('openai/gpt-oss')"> <input type="checkbox" x-model="useBrowserSearch" @change="onUseBrowserSearchChange()" class="rounded border-gray-300"> <span>browser search</span> </label> <label class="inline-flex items-center gap-2 text-xs" x-show="selectedModel && selectedModel.startsWith('openai/gpt-oss')"> <input type="checkbox" x-model="useCodeInterpreter" @change="onUseCodeInterpreterChange()" class="rounded border-gray-300"> <span>code interpreter</span>
<div class="form-group"> <label for="model">Model:</label> <input type="text" id="model" name="model" value="openai/gpt-oss-20b"> </div>
- **API Key**: Your NVIDIA API key (stored in cookies)- **Model**: AI model to use (default: `openai/gpt-oss-20b`)- **Messages**: JSON array of conversation messages- **Temperature**: Controls randomness (0-2, default: 1)
<div class="form-group"> <label for="model">Model:</label> <input type="text" id="model" name="model" value="openai/gpt-oss-20b"> </div>
// Learn more: https://docs.val.town/vals/http/const BASE_URL = "https://api.longcat.chat/openai";export default async function (req: Request): Promise<Response> {
provider: "groq", model: "meta-llama/llama-4-maverick-17b-128e-instruct", endpoint: "https://api.groq.com/openai/v1/chat/completions", headers: { "Authorization": `Bearer ${process.env.GROQ_API_KEY}`, provider: "groq", model: "meta-llama/llama-4-scout-17b-16e-instruct", endpoint: "https://api.groq.com/openai/v1/chat/completions", headers: { "Authorization": `Bearer ${process.env.GROQ_API_KEY}`,
do { const url: string = page ? `https://api.openai.com/v1/organization/costs?start_time=${startTime}&limit=${days}&page=${page}` : `https://api.openai.com/v1/organization/costs?start_time=${startTime}&limit=${days}`; const { data, error } = await betterFetch<Page<CostsObject>>(url, { headers: { Authorization: `Bearer ${Bun.env.OPENAI_ADMIN_KEY}` }, }); if (error.status === 401 || error.status === 403) { throw new Error( "Missing or invalid OPENAI_ADMIN_KEY. Please check your environment variables.", ); }
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";import { Hono } from "npm:hono@4.4.12";import { evaluate } from "npm:mathjs";// --- REFACTORED: CORE LOGIC WITH FULL AUDIT LOGGING ---async function callAgentWithTools<T>( openai: OpenAI, systemPrompt: string, userContent: string, }; console.log( "--- OpenAI API Request [1/2] ---", JSON.stringify(requestPayload, null, 2), ); const response = await openai.chat.completions.create(requestPayload); // --- AUDIT LOG: Initial Response --- console.log( "--- OpenAI API Response [1/2] ---", JSON.stringify(response, null, 2), ); }; console.log( "--- OpenAI API Request [2/2] ---", JSON.stringify(finalRequestPayload, null, 2), ); const finalResponse = await openai.chat.completions.create( finalRequestPayload, ); // --- AUDIT LOG: Final Response --- console.log( "--- OpenAI API Response [2/2] ---", JSON.stringify(finalResponse, null, 2), ); JSON.stringify(currentState, null, 2) }`; const openai = new OpenAI(); const result = await callAgentWithTools( openai, agentConfig.systemPrompt, agentInput,
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
/**
* Practical Implementation of Collective Content Intelligence
* Bridging advanced AI with collaborative content creation
*/
exp
kwhinnery_openai
lost1991
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
No docs found