render (Removed)

"render" has been removed in AI SDK 4.0.

AI SDK RSC is currently experimental. We recommend using AI SDK UI for production. For guidance on migrating from RSC to UI, see our migration guide.

A helper function to create a streamable UI from LLM providers. This function is similar to AI SDK Core APIs and supports the same model interfaces.

Note: render has been deprecated in favor of streamUI. During migration, please ensure that the messages parameter follows the updated specification.

Import

import { render } from "@ai-sdk/rsc"

API Signature

Parameters

model:

string

provider:

provider client

initial?:

ReactNode

messages:

Array<SystemMessage | UserMessage | AssistantMessage | ToolMessage>
SystemMessage

role:

'system'

content:

string
UserMessage

role:

'user'

content:

string
AssistantMessage

role:

'assistant'

content:

string

tool_calls:

ToolCall[]
ToolCall

id:

string

type:

'function'

function:

Function
Function

name:

string

arguments:

string
ToolMessage

role:

'tool'

content:

string

toolCallId:

string

functions?:

ToolSet
Tool

description?:

string

parameters:

zod schema

render?:

async (parameters) => any

tools?:

ToolSet
Tool

description?:

string

parameters:

zod schema

render?:

async (parameters) => any

text?:

(Text) => ReactNode
Text

content:

string

delta:

string

done:

boolean

temperature?:

number

Returns

It can return any valid ReactNode.