Documentation - v1.2.0-alpha.3
    Preparing search index...

    Function configureResponseController

    • To enable Agent to Agent communication, configures the agent response controller endpoint for handling incoming activities from external services.

      Parameters

      • app: Application

        The Express application instance to configure the route on

      • adapter: CloudAdapter

        The CloudAdapter instance used for processing bot framework activities and managing conversations

      • agent: ActivityHandler

        The ActivityHandler instance that contains the bot's logic for processing different types of activities

      • conversationState: ConversationState

        The ConversationState instance used for managing conversation-specific state and conversation references

      Returns void

      This function sets up a POST endpoint that receives activities (messages, events, etc.) from external services and processes them through the bot framework's activity handling pipeline. It's typically used when the agent needs to receive and respond to activities from channels or services that send activities to a specific webhook endpoint.

      The endpoint expects activities to be sent to: POST /api/agentresponse/v3/conversations/{conversationId}/activities/{activityId}

      The function handles:

      • Normalizing incoming activity data from the request body
      • Retrieving conversation references from conversation state
      • Continuing conversations using the stored conversation reference
      • Processing EndOfConversation activities by cleaning up conversation state
      • Sending activities through the turn context and returning responses
      const app = express();
      const adapter = new CloudAdapter();
      const agent = new MyActivityHandler();
      const conversationState = new ConversationState(memoryStorage);

      configureResponseController(app, adapter, agent, conversationState);