AI Docs
API
Class References
Function References
- text
- textOptions
- combineStrategies
- convertMessagesToModelMessages
- convertZodToJsonSchema
- createReplayStream
- embedding
- generateMessageId
- maxIterations
- messages
- modelMessageToUIMessage
- modelMessagesToUIMessages
- normalizeToUIMessage
- parsePartialJSON
- summarize
- toServerSentEventsStream
- toServerSentEventsResponse
- toolDefinition
- uiMessageToModelMessages
- realtimeToken
- untilFinishReason
Interface References
- AIAdapter
- AIAdapterConfig
- AgentLoopState
- AudioPart
- AudioVisualization
- BaseStreamChunk
- TextCompletionChunk
- TextOptions
- ChunkRecording
- ChunkStrategy
- ClientTool
- ContentPartSource
- ContentStreamChunk
- DefaultMessageMetadataByModality
- DocumentPart
- DoneStreamChunk
- EmbeddingOptions
- EmbeddingResult
- ErrorStreamChunk
- ImagePart
- InternalToolCallState
- JSONParser
- ModelMessage
- ProcessorResult
- ProcessorState
- RealtimeAdapter
- RealtimeClientOptions
- RealtimeConnection
- RealtimeMessage
- RealtimeSessionConfig
- RealtimeToken
- RealtimeTokenAdapter
- RealtimeTokenOptions
- ResponseFormat
- ServerTool
- StreamProcessorEvents
- StreamProcessorHandlers
- StreamProcessorOptions
- SummarizationOptions
- SummarizationResult
- TextPart
- ThinkingPart
- ThinkingStreamChunk
- Tool
- ToolCall
- ToolCallPart
- ToolCallStreamChunk
- ToolConfig
- ToolDefinition
- ToolDefinitionConfig
- ToolDefinitionInstance
- ToolInputAvailableStreamChunk
- ToolResultPart
- ToolResultStreamChunk
- UIMessage
- VideoPart
Type Alias References
- AgentLoopStrategy
- AnyClientTool
- TextStreamOptionsForModel
- TextStreamOptionsUnion
- ConstrainedContent
- ConstrainedModelMessage
- ContentPart
- ContentPartForModalities
- ExtractModalitiesForModel
- ExtractModelsFromAdapter
- InferToolInput
- InferToolName
- InferToolOutput
- MessagePart
- RealtimeEvent
- RealtimeMessagePart
- RealtimeMode
- RealtimeStatus
- ModalitiesArrayToUnion
- Modality
- StreamChunk
- ToolCallState
- ToolResultState
Variable References
AI/LLM: This documentation page is available in plain markdown format at/ai/latest/docs/reference/functions/generateMotion.md
generateMotion
ts
function generateMotion<TAdapter, TStream>(options): MotionActivityResult<TStream>;Defined in: packages/ai/src/activities/generateMotion/index.ts:226
Experimental
Generate a skeletal motion from a text prompt.
Type Parameters#
TAdapter#
TAdapter extends MotionAdapter<string, MotionProviderOptions<TAdapter>>
TStream#
TStream extends boolean = false
Parameters#
options#
MotionActivityOptions<TAdapter, TStream>
Returns#
MotionActivityResult<TStream>
Examples#
Submit, then poll from a later request
ts
import { generateMotion, getMotionJobStatus } from '@tanstack/ai'
import { falMotion } from '@tanstack/ai-fal'
const adapter = falMotion('fal-ai/hunyuan-motion')
const { jobId } = await generateMotion({
adapter,
threadId: 'orc-attacks',
prompt: 'A heavy two-handed overhead axe swing with a slow wind-up',
duration: 3,
})
const status = await getMotionJobStatus({ adapter, jobId })
if (status.motion) console.log(status.motion.assets[0]?.url)Stream the whole lifecycle to a browser
ts
const stream = generateMotion({
adapter: falMotion('fal-ai/hunyuan-motion'),
threadId: 'orc-attacks',
prompt: 'A heavy two-handed overhead axe swing',
stream: true,
})
return toServerSentEventsResponse(stream)Motion generation is an experimental feature and may change.