Share via

Adding a new attribute to InputHints

Adnan Tayba 0 Reputation points
2023-06-23T13:24:34.1233333+00:00

i want to add an attribute to InputHints called "done_input" that has the value "done" to send it with QnA as an InputHints. I tried to add this to the InputHints but when i did import the InputHints the new value didn't appear.

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

1 answer

Sort by: Most helpful
  1. YutongTie-9091 54,026 Reputation points Moderator
    2023-06-24T21:15:25.4366667+00:00

    Hello @Adnan Tayba

    Thanks for reaching out to us, but you haven't specified which SDK you are mentioning, based on the key word you mentioned, I guess you are working on Bot Framework SDK. Please let me know if I am not correct.

    The InputHints class in the Bot Framework SDK is used to provide hints to the bot about how to handle user input. If you want to add a new attribute to the InputHints class, you will need to modify the source code of the SDK and rebuild it.

    Here are the steps you can follow to add a new attribute to the InputHints class:

    Clone the Bot Framework SDK repository from GitHub: https://github.com/microsoft/botbuilder-dotnet

    Open the BotBuilder.sln solution file in Visual Studio.

    Locate the InputHints.cs file in the BotBuilder project.

    Add a new public static readonly string field to the InputHints class, like this:

    public static readonly string DoneInput = "done";
    

    Rebuild the BotBuilder project.

    Import the InputHints class into your code and use the new DoneInput attribute as needed.

    using Microsoft.Bot.Builder;
    ...
    var inputHints = InputHints.ExpectingInput | InputHints.IgnoringInput;
    inputHints = inputHints | InputHints.DoneInput;
    

    Note that modifying the SDK source code is not recommended, as it can make it difficult to upgrade to newer versions of the SDK. Instead, you may want to consider using a custom attribute or a separate data structure to store the additional information you need.

    I hope this helps. Let me know if you need further help.

    Regards,

    Yutong

    -Please kindly accept the answer and vote 'Yes' if you feel helpful to support the community, thanks a lot.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.