const response = await gateway.generateResponse({
preset: "research-brief",
input: "Find the latest public changes to our webhook delivery behavior and summarize them.",
tools: [
{
type: "gateway:web_search",
parameters: {
query: "site:phaseo.app webhook delivery retries",
max_results: 5,
include_highlights: true,
},
},
],
tool_choice: "gateway:web_search",
response_format: {
type: "json_schema",
name: "research_brief",
schema: {
type: "object",
required: ["summary", "sources"],
properties: {
summary: { type: "string" },
sources: {
type: "array",
minItems: 1,
items: {
type: "object",
required: ["title", "url"],
properties: {
title: { type: "string" },
url: { type: "string", format: "uri" },
},
additionalProperties: false,
},
},
},
additionalProperties: false,
},
},
plugins: [{ id: "response-healing" }],
meta: true,
});