Skip to content

MotionActivityOptions

Defined in: packages/ai/src/activities/generateMotion/index.ts:88

Experimental

Options for generateMotion.

Motion generation is an experimental feature and may change.

Type Parameters

TAdapter

TAdapter extends MotionAdapter<string, MotionProviderOptions<TAdapter>>

TStream

TStream extends boolean = false

Properties

abortSignal?

ts
optional abortSignal?: AbortSignal;

Defined in: packages/ai/src/activities/generateMotion/index.ts:143

Experimental

Caller cancellation signal. It stops local observation only. The provider job keeps running. Use cancelMotionJob to stop it.


adapter

ts
adapter: TAdapter & object;

Defined in: packages/ai/src/activities/generateMotion/index.ts:93

Experimental

The motion adapter to use (must be created with a model)

Type Declaration

kind
ts
kind: "motion";

debug?

ts
optional debug?: DebugOption;

Defined in: packages/ai/src/activities/generateMotion/index.ts:124

Experimental

Enable debug logging. See DebugOption.


duration?

ts
optional duration?: number;

Defined in: packages/ai/src/activities/generateMotion/index.ts:100

Experimental

Requested clip length in seconds. The provider decides the accepted range and rejects values outside it.


maxDuration?

ts
optional maxDuration?: number;

Defined in: packages/ai/src/activities/generateMotion/index.ts:114

Experimental

Stop polling after this many milliseconds (stream mode only).

Default

ts
600000

middleware?

ts
optional middleware?: GenerationMiddleware<unknown>[];

Defined in: packages/ai/src/activities/generateMotion/index.ts:133

Experimental

Observe-only middleware (otelMiddleware(), persistence, custom).

Stream mode: one run from submit to result. Submit mode: the submit opens the run, and the getMotionJobStatus poll that sees a terminal state closes it. Pass the same middleware and threadId to both.


modelOptions?

ts
optional modelOptions?: MotionProviderOptions<TAdapter>;

Defined in: packages/ai/src/activities/generateMotion/index.ts:102

Experimental

Provider-specific options for motion generation


pollingInterval?

ts
optional pollingInterval?: number;

Defined in: packages/ai/src/activities/generateMotion/index.ts:112

Experimental

Polling interval in milliseconds (stream mode only).

Default

ts
2000

prompt

ts
prompt: string;

Defined in: packages/ai/src/activities/generateMotion/index.ts:95

Experimental

Natural-language description of the motion


runId?

ts
optional runId?: string;

Defined in: packages/ai/src/activities/generateMotion/index.ts:122

Experimental

Run id for the stream chunks (stream mode only). A non-streaming submit ignores it: that run id is derived from the provider job, so getMotionJobStatus can find the same run from the job id alone.


stream?

ts
optional stream?: TStream;

Defined in: packages/ai/src/activities/generateMotion/index.ts:110

Experimental

false (default): submit the job and return { jobId, model }. Poll it later with getMotionJobStatus.

true: return an AsyncIterable<StreamChunk> that submits the job, polls it, and ends with generation:result and RUN_FINISHED.


threadId

ts
threadId: string;

Defined in: packages/ai/src/activities/generateMotion/index.ts:116

Experimental

Stable conversation/thread id. Also the AG-UI thread id on the stream.


timeout?

ts
optional timeout?: number;

Defined in: packages/ai/src/activities/generateMotion/index.ts:138

Experimental

Maximum time for this call in milliseconds. In stream mode it bounds the whole observation. Reaching it stops observation, not the provider job.