NeuroLink API Reference v8.32.0
NeuroLink API Reference / GenerateOptions
GenerateOptions =
object
Defined in: types/generateTypes.ts:24
Generate function options type - Primary method for content generation Supports multimodal content while maintaining backward compatibility
input:
object
Defined in: types/generateTypes.ts:25
text:
string
optionalimages: (Buffer|string|ImageWithAltText)[]
Images to include in the request. Supports simple image data (Buffer, string) or objects with alt text for accessibility.
images: [imageBuffer, "https://example.com/image.jpg"];images: [
{ data: imageBuffer, altText: "Product screenshot showing main dashboard" },
{ data: "https://example.com/chart.png", altText: "Sales chart for Q3 2024" },
];
optionalcsvFiles: (Buffer|string)[]
optionalpdfFiles: (Buffer|string)[]
optionalvideoFiles: (Buffer|string)[]
optionalfiles: (Buffer|string)[]
optionalcontent:Content[]
optionaloutput:object
Defined in: types/generateTypes.ts:72
Output configuration options
optionalformat:"text"|"structured"|"json"
Output format for text generation
optionalmode:"text"|"video"
Output mode - determines the type of content generated
- "text": Standard text generation (default)
- "video": Video generation using models like Veo 3.1
optionalvideo:VideoOutputOptions
Video generation configuration (used when mode is "video") Requires an input image and text prompt
output: {
format: "text";
}output: {
mode: "video",
video: {
resolution: "1080p",
length: 8,
aspectRatio: "16:9",
audio: true
}
}
optionalcsvOptions:object
Defined in: types/generateTypes.ts:89
optionalmaxRows:number
optionalformatStyle:"raw"|"markdown"|"json"
optionalincludeHeaders:boolean
optionalvideoOptions:object
Defined in: types/generateTypes.ts:96
optionalframes:number
optionalquality:number
optionalformat:"jpeg"|"png"
optionaltranscribeAudio:boolean
optionaltts:TTSOptions
Defined in: types/generateTypes.ts:135
Text-to-Speech (TTS) configuration
Enable audio generation from the text response. The generated audio will be
returned in the result's audio field as a TTSResult object.
const result = await neurolink.generate({
input: { text: "Tell me a story" },
provider: "google-ai",
tts: { enabled: true, voice: "en-US-Neural2-C" },
});
console.log(result.audio?.buffer); // Audio Bufferconst result = await neurolink.generate({
input: { text: "Speak slowly and clearly" },
provider: "google-ai",
tts: {
enabled: true,
voice: "en-US-Neural2-D",
speed: 0.8,
pitch: 2.0,
format: "mp3",
quality: "standard",
},
});
optionalthinkingConfig:object
Defined in: types/generateTypes.ts:177
Thinking/reasoning configuration for extended thinking models
Enables extended thinking capabilities for supported models.
Gemini 3 Models (gemini-3-pro-preview, gemini-3-flash-preview):
Use thinkingLevel to control reasoning depth:
minimal- Near-zero thinking (Flash only)low- Fast reasoning for simple tasksmedium- Balanced reasoning/latencyhigh- Maximum reasoning depth (default for Pro)
Anthropic Claude (claude-3-7-sonnet, etc.):
Use budgetTokens to set token budget for thinking.
optionalenabled:boolean
optionaltype:"enabled"|"disabled"
optionalbudgetTokens:number
Token budget for thinking (Anthropic models)
optionalthinkingLevel:"minimal"|"low"|"medium"|"high"
Thinking level for Gemini 3 models: minimal, low, medium, high
const result = await neurolink.generate({
input: { text: "Solve this complex problem..." },
provider: "google-ai",
model: "gemini-3-pro-preview",
thinkingConfig: {
thinkingLevel: "high",
},
});const result = await neurolink.generate({
input: { text: "Solve this complex math problem..." },
provider: "anthropic",
model: "claude-3-7-sonnet-20250219",
thinkingConfig: {
enabled: true,
budgetTokens: 10000,
},
});
optionalprovider:AIProviderName|string
Defined in: types/generateTypes.ts:187
optionalmodel:string
Defined in: types/generateTypes.ts:188
optionalregion:string
Defined in: types/generateTypes.ts:189
optionaltemperature:number
Defined in: types/generateTypes.ts:190
optionalmaxTokens:number
Defined in: types/generateTypes.ts:191
optionalsystemPrompt:string
Defined in: types/generateTypes.ts:192
optionalschema:ValidationSchema
Defined in: types/generateTypes.ts:225
Zod schema for structured output validation
Google Gemini Limitation
Google Vertex AI and Google AI Studio cannot combine function calling with
structured output. You MUST use disableTools: true when using schemas with
Google providers.
Error without disableTools: "Function calling with a response mime type: 'application/json' is unsupported"
This is a documented Google API limitation, not a NeuroLink bug. All frameworks (LangChain, Vercel AI SDK, Agno, Instructor) use this approach.
// ✅ Correct for Google providers
const result = await neurolink.generate({
schema: MySchema,
provider: "vertex",
disableTools: true, // Required for Google
});
// ✅ No restriction for other providers
const result = await neurolink.generate({
schema: MySchema,
provider: "openai", // Works without disableTools
});https://ai.google.dev/gemini-api/docs/function-calling
optionaltools:Record<string,Tool>
Defined in: types/generateTypes.ts:226
optionaltimeout:number|string
Defined in: types/generateTypes.ts:227
optionaldisableTools:boolean
Defined in: types/generateTypes.ts:245
Disable tool execution (including built-in tools)
For Google Gemini providers when using schemas Google Vertex AI and Google AI Studio require this flag when using structured output (schemas) due to Google API limitations.
// Required for Google providers with schemas
await neurolink.generate({
schema: MySchema,
provider: "vertex",
disableTools: true,
});
optionalmaxSteps:number
Defined in: types/generateTypes.ts:247
Maximum number of tool execution steps (default: 5).
optionaltoolChoice:"auto"|"none"|"required"| {type:"tool";toolName:string}
Defined in: types/generateTypes.ts:263
Tool choice configuration for the generation. Controls whether and which tools the model must call.
"auto"(default): the model can choose whether and which tools to call"none": no tool calls allowed"required": the model must call at least one tool and calls indefinitely until maxSteps is reached and outputs empty string.{ type: "tool", toolName: string }: the model must and only call the specified tool and calls indefinitely until maxSteps is reached and outputs empty string.
Note: When used without
prepareStep, this applies to every step in themaxStepsloop. Using"required"or{ type: "tool" }withoutprepareStepwill cause infinite tool calls untilmaxStepsis exhausted.
optionalprepareStep: (options: {steps:StepResult[];stepNumber:number;maxSteps:number;model:LanguageModel}) =>PromiseLike<{model?:LanguageModel;toolChoice?:ToolChoice;experimental_activeTools?:string[] } |undefined>
Defined in: types/generateTypes.ts:288
Optional callback that runs before each step in a multi-step generation.
Allows dynamically changing toolChoice and available tools per step.
This is the recommended way to enforce specific tool calls on certain steps while allowing the model freedom on others.
Maps to Vercel AI SDK's experimental_prepareStep.
prepareStep: async ({ stepNumber }) => {
if (stepNumber === 0) {
return {
toolChoice: { type: "tool", toolName: "sequentialThinking" },
};
}
return { toolChoice: "auto" };
};SDK Custom Tools Guide — Controlling Tool Execution
optionalenableEvaluation:boolean
Defined in: types/generateTypes.ts:248
optionalenableAnalytics:boolean
Defined in: types/generateTypes.ts:249
optionalcontext:StandardRecord
Defined in: types/generateTypes.ts:250
optionalevaluationDomain:string
Defined in: types/generateTypes.ts:253
optionaltoolUsageContext:string
Defined in: types/generateTypes.ts:254
optionalconversationHistory:object[]
Defined in: types/generateTypes.ts:255
role:
string
content:
string
optionalfactoryConfig:object
Defined in: types/generateTypes.ts:258
optionaldomainType:string
optionaldomainConfig:StandardRecord
optionalenhancementType:"domain-configuration"|"streaming-optimization"|"mcp-integration"|"legacy-migration"|"context-conversion"
optionalpreserveLegacyFields:boolean
optionalvalidateDomainData:boolean
optionalstreaming:object
Defined in: types/generateTypes.ts:272
optionalenabled:boolean
optionalchunkSize:number
optionalbufferSize:number
optionalenableProgress:boolean
optionalfallbackToGenerate:boolean