.agent/skills/openai-api-integration/SKILL.md
Integrate OpenAI's API including GPT-4o tool calling, streaming responses, function schemas, and error handling. Use when building or debugging Julia's orchestrator or any component that calls OpenAI.
npx skillsauth add abzhaw/juliaz_agents openai-api-integrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const tools: OpenAI.Chat.Completions.ChatCompletionTool[] = [{
type: 'function',
function: {
name: 'get_task_list',
description: 'Fetch pending tasks from the backend',
parameters: {
type: 'object',
properties: { status: { type: 'string', enum: ['pending', 'done'] } },
required: []
}
}
}];
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages,
tools,
tool_choice: 'auto',
});
const msg = response.choices[0].message;
if (msg.tool_calls) {
for (const call of msg.tool_calls) {
const result = await executeTool(call.function.name, JSON.parse(call.function.arguments));
messages.push({ role: 'tool', tool_call_id: call.id, content: JSON.stringify(result) });
}
// Continue the loop with updated messages
}
const stream = await client.chat.completions.create({
model: 'gpt-4o', messages, stream: true
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}
try {
// API call
} catch (e) {
if (e instanceof OpenAI.APIError) {
if (e.status === 429) // rate limit — backoff
if (e.status === 503) // overloaded — retry
if (e.status === 401) // bad key — alert
}
}
gpt-4omax_tokens: 4096 as a safe capdevelopment
Fortschrittsverfolgung der Masterarbeit. Wortanzahl pro Kapitel, Fertigstellungsgrad, fehlende Elemente, Deadlines. Haelt den Ueberblick.
development
Kapitelarchitektur und Gliederung der Masterarbeit. Verwaltet die Struktur, schlaegt vor wo Inhalte hingehoeren, validiert den logischen Fluss zwischen Kapiteln.
tools
Konvertiert Protokolleinträge und Session-Logs in thesis-fähiges deutsches Narrativ. Transformiert Entwicklungsdokumentation in akademische Prosa.
research
Sucht und analysiert akademische Literatur. Findet relevante Papers, erstellt strukturierte Zusammenfassungen. Zitiert NIEMALS — schlaegt nur vor.