const result = await synthesize(schema, bus, 'add 2 of item 5', {
adapter: async (tools, text) => {
const res = await anthropic.messages.create({ tools, messages: [{ role: 'user', content: text }] });
const toolUse = res.content.find(b => b.type === 'tool_use');
return { name: toolUse.name, input: toolUse.input };
},
});
synthesize — natural language → bus dispatch via LLM tool use.
Requires an
adapter— a function that takes tool definitions + user text and returns a ToolCallInput. This keeps vapor-chamber vendor-agnostic: bring your own Anthropic SDK, OpenAI SDK, or custom proxy.