The author-facing parameter shape of agent: every AgentDef
field, with the defaulted ones optional.
Derived from AgentDef rather than re-declared, so a field added there is
automatically declarable here — the inline re-declaration this replaces let
fields (send, state) ship as runtime-working but excess-property errors
for authors, because neither bundler typechecks user code. Field docs live
on AgentDef and carry through the mapped types.
Three author-facing conveniences widen the derived shape (all normalized
away by agent(), so AgentDef stays canonical):
system — alias of systemPrompt, matching the Vercel AI SDK's field
name. Setting both is an error.
llm also accepts a model-id string: "creator/model" routes through
the Vercel AI Gateway (AI_GATEWAY_API_KEY), a bare id through the
AssemblyAI LLM Gateway (ASSEMBLYAI_API_KEY).
voice — the TTS voice for the default AssemblyAI pipeline, desugared
to tts: assemblyAITts({ voice }). Only valid when no explicit tts
descriptor is set (the voice rides on the descriptor there) and never
in S2S mode (the S2S descriptor owns its voice).
Pipeline stages are individually optional: declare any subset of
stt/llm/tts and the unset stages run on the default all-AssemblyAI
pipeline. The shape is still a pipeline-mode/S2S-mode union, so s2s
combined with a pipeline field fails the build with a message naming the
rule (PipelineOnlyMisuse) rather than failing at the first
aai dev/aai deploy. Configs that never went through agent() are
still caught when toAgentConfig runs in the bundle entry.
The author-facing parameter shape of agent: every AgentDef field, with the defaulted ones optional.
Derived from
AgentDefrather than re-declared, so a field added there is automatically declarable here — the inline re-declaration this replaces let fields (send,state) ship as runtime-working but excess-property errors for authors, because neither bundler typechecks user code. Field docs live on AgentDef and carry through the mapped types.Three author-facing conveniences widen the derived shape (all normalized away by
agent(), soAgentDefstays canonical):system— alias ofsystemPrompt, matching the Vercel AI SDK's field name. Setting both is an error.llmalso accepts a model-id string:"creator/model"routes through the Vercel AI Gateway (AI_GATEWAY_API_KEY), a bare id through the AssemblyAI LLM Gateway (ASSEMBLYAI_API_KEY).voice— the TTS voice for the default AssemblyAI pipeline, desugared totts: assemblyAITts({ voice }). Only valid when no explicitttsdescriptor is set (the voice rides on the descriptor there) and never in S2S mode (the S2S descriptor owns its voice).Pipeline stages are individually optional: declare any subset of
stt/llm/ttsand the unset stages run on the default all-AssemblyAI pipeline. The shape is still a pipeline-mode/S2S-mode union, sos2scombined with a pipeline field fails the build with a message naming the rule (PipelineOnlyMisuse) rather than failing at the firstaai dev/aai deploy. Configs that never went throughagent()are still caught whentoAgentConfigruns in the bundle entry.