Search

3,261 results found for openai (1270ms)

Code
3,166

language,
offset = 0,
model = "openai/gpt-oss-120b",
reasoning_effort = "medium",
tools = [],
}
const isGptOss = typeof model === "string" && model.startsWith("openai/gpt-oss");
const supportsReasoning = isGptOss;
const supportsTools = isGptOss;
const baseUrl = (typeof base_url === "string" && base_url.trim()) ? base_url.trim().replace(/\
let endpoint = "https://api.groq.com/openai/v1/chat/completions";
if (baseUrl) {
if (/(\/v\d+)?\/(chat\/)?completions$/i.test(baseUrl)) {
export async function groqChatCompletion(apiKey, payload) {
console.log('>>> [groqChatCompletion] Payload:', payload);
const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
method: 'POST',
headers: {
try {
const res = await groqChatCompletion(apiKey, {
model: 'openai/gpt-oss-120b',
messages: [
{ role: 'system', content: 'Classify the user request as either links or text. Respond w
language,
offset = 0,
model = 'openai/gpt-oss-120b',
reasoning_effort = 'medium',
tools = [],
}
const isGptOss = typeof model === 'string' && model.startsWith('openai/gpt-oss');
const supportsReasoning = isGptOss;
const supportsTools = isGptOss;
const encoder = new TextEncoder();
const baseUrl = (typeof base_url === 'string' && base_url.trim()) ? base_url.trim().replac
let endpoint = 'https://api.groq.com/openai/v1/chat/completions';
if (baseUrl) {
if (/(\/v\d+)?\/(chat\/)?completions$/i.test(baseUrl)) {
import { Hono } from "https://esm.sh/hono@3.11.7";
import { OpenAI } from "https://esm.town/v/std/openai";
import { email } from "https://esm.town/v/std/email";
import type { ChatRequest, ChatResponse, InviteRequest, InviteDetails } from "../../shared/types
const api = new Hono();
const openai = new OpenAI();
// Middleware to ensure user is authenticated
const messages = await getConversationMessages(currentConversationId);
// Prepare messages for OpenAI (exclude the current user message since we'll add it)
const chatMessages = messages
.filter(m => m.id !== userMessage.id) // Exclude the message we just added
try {
// Get response from ChatGPT
const completion = await openai.chat.completions.create({
messages: chatMessages,
model: "gpt-4o-mini",
- **Automatic user creation** on first login
- **Conversation history storage** with full message history
- **ChatGPT integration** via OpenAI API
- **Group chat functionality** with role-based permissions
- **Email invitations** with secure tokens
## Tech Stack
- **Backend**: Hono, LastLogin auth, SQLite, OpenAI, Server-Sent Events
- **Frontend**: React, TailwindCSS, Real-time SSE connections
- **Database**: SQLite with participant and invitation tables
<div class="relative">
<select x-model="selectedModel" @change="onModelChange()" class="px-2 py-1 pr-8
<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>
y-300" x-show="selectedModel && selectedModel.startsWith('openai/gpt-oss')">
<input type="checkbox" x-model="useBrowserSearch" @change="onUseBrowserSearchCha
<span>browser search</span>
</label>
y-300" x-show="selectedModel && selectedModel.startsWith('openai/gpt-oss')">
<input type="checkbox" x-model="useCodeInterpreter" @change="onUseCodeInterprete
<span>code interpreter</span>
- ✅ Chat message display with user/assistant styling
- ✅ Message input with textarea and send button
-OpenAI API integration (GPT-4o-mini)
- ✅ Real-time message updates
- ✅ Loading states and typing indicators
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite/main.tsx";
import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
import { OpenAI } from "https://esm.town/v/std/openai";
const app = new Hono();
const openai = new OpenAI();
// Unwrap Hono errors to see original error details
});
// Send a message and get OpenAI response
app.post("/api/threads/:threadId/messages", async (c) => {
const email = c.req.header('X-LastLogin-Email');
);
// Prepare messages for OpenAI (limit to last 20 messages to avoid token limits)
const messages = messageHistory.slice(-20).map(msg => ({
role: msg.role as 'user' | 'assistant',
}));
// Get OpenAI response
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: messages,
if (!assistantResponse) {
throw new Error("No response from OpenAI");
}
import { PresidentDocs } from "./nonprofitDocs";
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
export default async function (req: Request): Promise<Response> {
// { role: "user", content: "Say hello in a creative way" },
const completion = await openai.chat.completions.create({
messages: [
{ role: "system", content: systemPrompt },