Giter VIP home page Giter VIP logo

healthbotcontainersample's Introduction

Health Bot Container

A simple web page that allows users to communicate with the Azure Health Bot through a WebChat.

Note: In order to use this Web Chat with the Health Bot service, you will need to obtain your Web Chat secret by going to Integration/Secrets on the navigation panel.

Secrets

1.Deploy the website:

Deploy to Azure

2.Set the following environment variables:

APP_SECRET

WEBCHAT_SECRET

3.Configure scenario invocation (optional):

The Health Bot service uses language models to interpret end user utterances and trigger the relevant scenario logic in response.

Alternatively, you can programmaticaly invoke a scenario before the end user provides any input.

To implement this behavior, uncomment the following code from the function initBotConversation() in the /public/index.js file:

triggeredScenario: {
    trigger"{scenario_id}",
    args{
        myVar1"{custom_arg_1}",
        myVar2"{custom_arg_2}"
    }
}

Replace {scenario_id} with the scenario ID of the scenario you would like to invoke. You can also pass different values through the "args" object. 

You can read more about programmatic client side scenario invocation here

4.Set the Bot service direct line channel endpoint (optional)

In some cases it is required to set the endpoint URI so that it points to a specific geography. The geographies supported by the bot service each have a unique direct line endpoint URI:

  • directline.botframework.com routes your client to the nearest datacenter. This is the best option if you do not know where your client is located.
  • asia.directline.botframework.com routes only to Direct Line servers in Eastern Asia.
  • europe.directline.botframework.com routes only to Direct Line servers in Europe.
  • northamerica.directline.botframework.com routes only to Direct Line servers in North America.

Pass your preferred geographic endpoint URI by setting the environment variable: DIRECTLINE_ENDPOINT_URI in your deployment. If no variable is found it will default to directline.botframework.com

Note: If you are deploying the code sample using the "Deploy to Azure" option, you should add the above secrets to the application settings for your App Service.

Agent webchat

If the agent webchat sample is also required, switch to the live agent handoff branch

healthbotcontainersample's People

Contributors

adamwalker-112358 avatar adamwalkermicrosoft avatar alonitms avatar amir-microsoft avatar amirt-microsoft avatar arieschwartzman avatar balteravishay avatar barneaoren avatar dependabot[bot] avatar eladiw avatar guy-microsoft avatar guybeckermicrosoft avatar itye-msft avatar kant avatar microsoft-github-policy-service[bot] avatar ms-santi avatar orsharab avatar orsharab-yy avatar pjirsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

healthbotcontainersample's Issues

Deployment Failing

Hi Team,

Standard deployment failing.

I use a new resource group, East US.

Any idea what's going on?

{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
"details": [
{
"code": "Conflict",
"message": "{\r\n "status": "Failed",\r\n "error": {\r\n "code": "ResourceDeploymentFailure",\r\n "message": "The resource operation completed with terminal provisioning state 'Failed'."\r\n }\r\n}"
}
]
}

No users are currently waiting for an agent.

I have followed all the steps for handoff. When i am on the /agent.html, It lists the
Current Conversations

User ce36 is chatting with the bot [Conversation history]

Clicking connect states that - No users are currently waiting for an agent.

image
Any ideas?

triggeredScenario

I am trying to test Covid-19 Assessment Bot. I followed the instructions as provided in this article: https://techcommunity.microsoft.com/t5/healthcare-and-life-sciences/updated-on-4-2-2020-quick-start-setting-up-your-covid-19/ba-p/1230537.
Changed the scenario id to:

`triggeredScenario: {
                                trigger: "{covid19_assessment}",
                                args: {
                                    myVar1: "{custom_arg_1}",
                                    myVar2: "{custom_arg_2}"
                                }
                            }`

Do I need to add any args?
You can check it at https://hnclcovid1.azurewebsites.net/

I would appreciate your assistance.
Thank you

Navigation panel

How to open navigation panel and get APP_SECRET & WEBCHAT_SECRET?

default, non-scenario experience when using container

Hello,

I've updated the App Service with properly named env. variables under Application Settings per the markdown documentation. The webchat renders correctly, but the scenario that I've defined doesn't fire. Is there something I need to do to initiate a scenario (in this case a template from your gallery) in the webchat sample container in this repo?

image

Renders this:

image

Any guidance would be appreciated. Thanks!

Unhandled rejection RangeError

Hi,
I have cloned the repo and set the environment variables for APP_SECRET and WEBCHAT_SECRET.
When I run npm start I see the error

Unhandled rejection RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined at new NodeError (node:internal/errors:371:5) at ServerResponse.writeHead (node:_http_server:275:11) at ServerResponse._implicitHeader (node:_http_server:266:8) at ServerResponse.end (node:_http_outgoing:868:10)

Details -
Windows 10 OS
Node version - 16.6.2
Npm version -7.20.3

Load previous chat messages

Hi,
I am using Azure webchat for chatbot. I am using the code from this repo
https://github.com/microsoft/HealthBotContainerSample. While am able to connect to my bot via Directlink secret. Once the web page is reloaded the conversation is cleared from browser, I followed few steps to get the conversationId to preserve the state, but am unable to load them into the browser window.

Can you please help me in loading the chat history based on the conversationId into the webchat.

Thanks in Advance

Invalid url error

Hi all
Im getting an invalid url error when I click "deploy to azure"

Trigger scenario based on query_string if present

When performing demos of multiple scenario's it might be useful to switch between them easily.
Currently we would need to either change the existing HealthBotContainer/TokenService or add another HealthBotContainer/TokenService with that triggers a different scenarioId.

If it could be changed in the URL, then demo's could just IFRAME in a different link with unique query_string to the same URL.

IE11 not supported

Lots of health customers still need to support IE11. The chat client currently doesn't load due to missing polyfills.

Unable to connect

Hello,

I'm using this example for couple of azure health bots but sometimes i got this issue unable to connect as the screen attached below
all of the URI got this issue usually for 15 min and then they works fine and that's happened couple of times can anyone explain why?

all of my app services are in west Europe

image

How to customize design?

We'd like to match the UI with our company design.
I see styles are loaded over remote service.

What's the best way to customize design?
Thanks

Truncated button text

When viewing chat client on a mobile device or a narrow viewport (aka. inside <div> with constrained width) the button choice text becomes truncated.
Including screenshot of issue for CDC triage template:
image

Failure to deploy using Deploy to Azure button

When selecting the F1 (FREE) or D1 (SHARED) sku, the template deployment fails stating that "Always On" feature is not supported.

{
    "code": "DeploymentFailed",
    "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
    "details": [
        {
            "code": "Conflict",
            "message": "{\r\n \"Code\": \"Conflict\",\r\n \"Message\": \"There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. For more information on pricing and features, please see: https://aka.ms/appservicepricingdetails \",\r\n \"Target\": null,\r\n \"Details\": [\r\n {\r\n \"Message\": \"There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. For more information on pricing and features, please see: https://aka.ms/appservicepricingdetails \"\r\n },\r\n {\r\n \"Code\": \"Conflict\"\r\n },\r\n {\r\n \"ErrorEntity\": {\r\n \"ExtendedCode\": \"01020\",\r\n \"MessageTemplate\": \"There was a conflict. {0}\",\r\n \"Parameters\": [\r\n \"AlwaysOn cannot be set for this site as the plan does not allow it. For more information on pricing and features, please see: https://aka.ms/appservicepricingdetails \"\r\n ],\r\n \"Code\": \"Conflict\",\r\n \"Message\": \"There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. For more information on pricing and features, please see: https://aka.ms/appservicepricingdetails \"\r\n }\r\n }\r\n ],\r\n \"Innererror\": null\r\n}"
        }
    ]
}

Enabling Handoff functionality

The Handoff to live agent documentation says

Handoff functionality is disabled by default. To use this feature activate handoff from your management portal. Navigate to Configuration > Conversation > Human handoff and enable handoff.

I am unable to find out how to open the management portal.

Oops. Something went wrong and we need to start over.

Health Bot Scenarios are using numerous Adaptive Cards (v1.2). If the Adaptive Card is left blank and the user hits continue, the "Oops. Something went wrong and we need to start over." message is returned and the bot scenario ends.

Upon investigation, it appears that line 20 in the index.html file is the culprit.

<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js"></script>

Upon changing this to reference an older js library, the issue goes away.

 <script src="https://cdn.botframework.com/botframework-webchat/4.11.0/webchat-es5.js"></script>

Improve Health Probe to Verify APP_SECRET

The health probe confirms the WEBCHAT_SECRET is valid by obtaining a direct line token however it does not verify the APP_SECRET.

It could send a simple INIT/END conversation as part of the probe when it is in an unhealthy state

Missing support for user location

Master branch (v3 client) has support to grab user location from browser location services and pass to bot service. This functionality is missing in webchat_v4 version.

Handoff scenario error

Hi,

I have deployed the Health Bot and the HeathBotContainerSample in my tenant. I have enabled human handoff in the configuration section and am able to "log in" using the sample agent page and see normal user conversations.
image

I have also enabled the "Triage" template conversation in the bot. However, when I'm supposed to be handed off to a live agent, I get only the response "Handoff scenario error" and a Developer note.
image

Am I missing something? Is there some way to debug this that I'm not seeing?

Deploy to Azure Quick Link

Process appears to be broken as of this moment. I get a "Deployment Error" saying "InvalidTemplateDeployment: The template deployment 'HealthcareBotDemos" is not valid according to the validation procedure... "

when is live_agent_handoff going live?

Current agent webchat is for "testing purposes only".

Any update on when this might be merged to master and officially supported?

Would be nice if we could login with Active Directory / Microsoft credentials.

Previous chat elements are still clickable even after submitting last event/click/selection.

Previous chat elements are still clickable even after submitting last event/click/selection.

Users may inadvertently click previous chat elements and change the flow with/out intention and/or - potentially - without awareness.

It would be great to disable the previous chat elements. I might have found the solution by using:

document.all.webchat.getElementsByClassName("webchat__basic-transcript__activity webchat__basic-transcript__activity--acknowledged webchat__basic-transcript__activity--read").forEach((item) => { item.style.pointerEvents = "none" });_

I'm exploring the DOM to understand which Event Listener would be the most appropriate to attach this code to.

Is there something already in the current feature set that would allow me to achieve the same goal?
If not - is there anything in roadmap or how many chances are there that the style/class will change and break this code?

newbie - how to - Enable language selection widget

The management portal for the Chatbot has a test window. In the test window there is a language selection widget.
image
How does one enable this feature on the HealthBotContainerSample.
If the answer is RTM, I'll take it on the chin.
in advance - thank you

Unable to Handle the request - HTTP ERROR 500

After deployment facing this error(sometimes it works fine and within 1-2days facing error).
Application has thrown an uncaught exception and is terminated:
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:434:25)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (C:\Program Files (x86)\iisnode\interceptor.js:459:1)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)

Please provide solution asap.

Mobile devices: Font sizing problems in chromium-based browsers

On some mobile devices, text is not properly sized and inconsistencies are displayed.
This was uncovered while testing the COVID19_ASSESSMENT scenario on the healthbot.

Solution is to add viewport metadata to <HEAD> in index.html

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.