Documentation - v1.5.0-beta.6
    Preparing search index...

    Client for interacting with Microsoft Copilot Studio services. Provides functionality to start conversations and send messages to Copilot Studio bots.

    Index

    Constructors

    Properties

    scopeFromSettings: (settings: ConnectionSettings) => string = ScopeHelper.getScopeFromSettings

    Returns the scope URL needed to connect to Copilot Studio from the connection settings. This is used for authentication token audience configuration.

    Type Declaration

    Use ScopeHelper.getScopeFromSettings instead.

    Methods

    • Sends a question to the Copilot Studio service and retrieves the response activities.

      Parameters

      • question: string

        The question to ask.

      • OptionalconversationId: string

        The ID of the conversation. Defaults to the current conversation ID.

      Returns Promise<Activity[]>

      A promise yielding an array of activities.

      Use sendActivityStreaming instead.

    • Executes a turn in an existing conversation by sending an activity.

      Parameters

      • activity: Activity

        The activity to send.

      • conversationId: string

        The ID of the conversation. Required.

      Returns Promise<Activity[]>

      A promise yielding an array of activities.

      Error if conversationId is not provided.

      Use executeStreaming instead.

    • Executes a turn in an existing conversation by sending an activity. This method provides explicit control over the conversation ID.

      Parameters

      • activity: Activity

        The activity to send.

      • conversationId: string

        The ID of the conversation. Required.

      Returns AsyncGenerator<Activity>

      An async generator yielding the Agent's Activities.

      Error if conversationId is not provided.

    • Sends an activity to the Copilot Studio service and retrieves the response activities.

      Parameters

      • activity: Activity

        The activity to send.

      • conversationId: string = ...

        The ID of the conversation. Defaults to the current conversation ID.

      Returns Promise<Activity[]>

      A promise yielding an array of activities.

      Use sendActivityStreaming instead.

    • Sends an activity to the Copilot Studio service and retrieves the response activities.

      Parameters

      • activity: Activity

        The activity to send.

      • conversationId: string = ...

        The ID of the conversation. Defaults to the current conversation ID.

      Returns AsyncGenerator<Activity>

      An async generator yielding the Agent's Activities.

    • Starts a new conversation with the Copilot Studio service using a StartRequest.

      Parameters

      • request: StartRequest

        The request parameters for starting the conversation.

      Returns Promise<Activity[]>

      A promise yielding an array of activities.

      Use startConversationStreaming instead.

    • Starts a new conversation with the Copilot Studio service.

      Parameters

      • OptionalemitStartConversationEvent: boolean

        Whether to emit a start conversation event. Defaults to true.

      Returns Promise<Activity[]>

      A promise yielding an array of activities.

      Use startConversationStreaming instead.

    • Starts a new conversation with the Copilot Studio service using a StartRequest.

      Parameters

      • request: StartRequest

        The request parameters for starting the conversation.

      Returns AsyncGenerator<Activity>

      An async generator yielding the Agent's Activities.

    • Starts a new conversation with the Copilot Studio service.

      Parameters

      • OptionalemitStartConversationEvent: boolean

        Whether to emit a start conversation event. Defaults to true.

      Returns AsyncGenerator<Activity>

      An async generator yielding the Agent's Activities.

    • Starts a new conversation and returns a typed response.

      Parameters

      • Optionalrequest: boolean | StartRequest

        The request parameters for starting the conversation.

      Returns Promise<StartResponse>

      A promise yielding a StartResponse with activities and conversation metadata.

    • Subscribes to a conversation to receive events via Server-Sent Events (SSE). This method allows resumption from a specific event ID.

      Parameters

      • conversationId: string

        The ID of the conversation to subscribe to.

      • OptionallastReceivedEventId: string

        Optional. The last received event ID for resumption.

      Returns AsyncGenerator<SubscribeEvent>

      An async generator yielding SubscribeEvent objects containing activities and event IDs.