import {
createGatewayAgentClient,
} from "@ai-stats/agent-sdk";
const client = createGatewayAgentClient({
clientOptions: {
apiKey: process.env.AI_STATS_API_KEY!,
},
responseFormat: {
type: "json_schema",
name: "research_brief",
schema: {
type: "object",
properties: {
topic: { type: "string" },
summary: { type: "string" },
sources: {
type: "array",
items: {
type: "object",
properties: {
title: { type: "string" },
url: { type: "string" },
},
required: ["title", "url"],
additionalProperties: false,
},
minItems: 1,
},
},
required: ["topic", "summary", "sources"],
additionalProperties: false,
},
},
plugins: [{ id: "response-healing" }],
gatewayTools: [
{ type: "gateway:web_search", parameters: { max_results: 5 } },
],
toolChoice: "gateway:web_search",
webSearchOptions: { search_context_size: "high" },
});