Skip to main content
Cedar-OS provides TypeScript types and Zod schemas for agent responses, enabling type-safe handling of LLM outputs, structured responses, streaming events, and frontend tool execution.

Basic LLM Responses

The core response type contains the agent’s text response along with usage and metadata information: TypeScript Type:
Corresponding Zod Schema:

Structured Responses

For agents that return structured data, Cedar provides flexible typing for custom response objects: TypeScript Types:
Corresponding Zod Schemas:

Built-in Response Types

Cedar provides several built-in response types with corresponding TypeScript types and Zod schemas:

FrontendToolResponse

For executing registered frontend tools: TypeScript Type:
Corresponding Zod Schema:

SetStateResponse

For executing state setter functions: TypeScript Type:
Corresponding Zod Schema:

MessageResponse

For adding custom messages to chat: TypeScript Type:
Corresponding Zod Schema:

Streaming Responses

For real-time streaming, Cedar provides event-based typing: TypeScript Type:
Corresponding Zod Schema:

Voice Responses

For voice-enabled agents, Cedar extends the base response with audio-specific fields: TypeScript Type:
Corresponding Zod Schema:

Next Steps

Now that you understand response typing, learn about: