Docs
Cloudflare
Railway
CodeRabbit
AG Grid
WorkOS
SerpAPI
Netlify
OpenRouter
Clerk
Electric
Unkey
Prisma
Sentry
Cloudflare
Railway
CodeRabbit
AG Grid
WorkOS
SerpAPI
Netlify
OpenRouter
Clerk
Electric
Unkey
Prisma
Sentry
Class References
Function References
Interface References
Type Alias References
Variable References

StructuredOutputMiddlewareConfig

Interface: StructuredOutputMiddlewareConfig

Defined in: packages/ai/src/activities/chat/middleware/types.ts:147

Config passed to onStructuredOutputConfig.

Mirrors ChatMiddlewareConfig minus (the final structured-output call is a single typed-response request, not an agentic loop — tools cannot be forwarded to it), plus the being sent to the provider. Middleware may transform the schema (e.g., inject $defs, strip vendor-incompatible keywords) by returning a partial that includes .

Extends

  • <, >

Properties

messages

ts
messages: ModelMessage<
  | string
  | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
  | null>[];
messages: ModelMessage<
  | string
  | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
  | null>[];

Defined in: packages/ai/src/activities/chat/middleware/types.ts:130

Inherited from

.


metadata?

ts
optional metadata: Record<string, unknown>;
optional metadata: Record<string, unknown>;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:133

Inherited from

.


modelOptions?

ts
optional modelOptions: Record<string, unknown>;
optional modelOptions: Record<string, unknown>;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:134

Inherited from

.


outputSchema

ts
outputSchema: JSONSchema;
outputSchema: JSONSchema;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:152

JSON Schema being sent to the provider for structured output.


systemPrompts

ts
systemPrompts: SystemPrompt[];
systemPrompts: SystemPrompt[];

Defined in: packages/ai/src/activities/chat/middleware/types.ts:131

Inherited from

.