Skip to content

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:

  1. the ANSWER - no structuredOutput, so the agent’s tools are available and the content matches what the streaming endpoint would say;
  2. 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.

CardAgentLike

object[] = ...

{ id: string; } = ...

string = ...

{ id: string; name?: string; } = ...

string = ...

string = ...

string = ...

{ id: string; name?: string; } = ...

string = ...

string = ...

string = ...

string = ...

"message" | "conversationUpdate" | "typing" = ...

CardTurnOptions = {}

Promise<object[]>