@rickrosten/agent-deterministic-tools-openai
v1.0.0
Published
OpenAI adapter for Deterministic Tools: function/tool definitions for Chat Completions, Responses API and the Agents SDK, plus a tool-call executor.
Maintainers
Readme
@rickrosten/agent-deterministic-tools-openai
Use Deterministic Tools as OpenAI function tools (Chat Completions, Responses API, Agents SDK)
without MCP. No dependency on the openai package.
import { createRegistry } from '@rickrosten/agent-deterministic-tools-core';
import { financeModule } from '@rickrosten/agent-deterministic-tools-finance';
import { toResponsesTools, runResponsesFunctionCalls } from '@rickrosten/agent-deterministic-tools-openai';
const registry = createRegistry([financeModule]);
const response = await openai.responses.create({ model, input, tools: toResponsesTools(registry) });
const outputs = await runResponsesFunctionCalls(registry, response.output); // function_call_output items- Names:
finance.loan_paymentis exposed asfinance__loan_payment(OpenAI names cannot contain dots) and mapped back automatically. strict: trueproduces structured-output compatible schemas (optional fields become nullable); passstrict: trueto the executor too so nulls are removed before validation.- Tool errors are returned to the model as
{"error": {"code", "message", "field"}}. - Agents SDK:
toAgentsTools(registry, tool)withtoolimported from@openai/agents.
See docs/openai.md and examples/openai-agents.
