Function: runCardTurn()
runCardTurn(
agent,inbound,options?):Promise<object[]>
Run one conversation turn: drive agent with the inbound activity’s text and
return the activities to append to the transcript.
Returns an EMPTY array for an activity that carries no prompt (a typing
indicator, a join event), which is exactly what a bot does with one - the
route answers { activities: [] } and the transcript is unchanged.
Two agent calls, in this order:
- the ANSWER - no
structuredOutput, so the agent’s tools are available and the content matches what the streaming endpoint would say; - the FORMAT - formatAsCard compiling that answer into a card.
Every failure mode still yields the answer: a card the agent composed with
create_teams_card during pass 1 short-circuits pass 2, and a failed pass 2
falls back to toCardSpec over the answer text.
Parameters
Section titled “Parameters”inbound
Section titled “inbound”attachments?
Section titled “attachments?”object[] = ...
conversation?
Section titled “conversation?”{ id: string; } = ...
conversation.id
Section titled “conversation.id”string = ...
{ id: string; name?: string; } = ...
from.id
Section titled “from.id”string = ...
from.name?
Section titled “from.name?”string = ...
string = ...
recipient?
Section titled “recipient?”{ id: string; name?: string; } = ...
recipient.id
Section titled “recipient.id”string = ...
recipient.name?
Section titled “recipient.name?”string = ...
string = ...
timestamp?
Section titled “timestamp?”string = ...
"message" | "conversationUpdate" | "typing" = ...
options?
Section titled “options?”CardTurnOptions = {}
Returns
Section titled “Returns”Promise<object[]>