microsoft / botframework-solutions

Welcome to the Bot Framework Solutions repository which is the home for a set of templates and solutions to help build advanced conversational experiences using Azure Bot Service and Bot Framework. Microsoft Bot Framework is a comprehensive framework for building enterprise-grade conversational AI experiences.
https://aka.ms/bfsolutionsdocs
MIT License
1.06k stars 527 forks source link

Botskill connect is not working properly whether local dev or public hosted #2927

Closed CurlyBytes closed 4 years ago

CurlyBytes commented 4 years ago

What project is affected?

Virtual assistant importing skills in calendar (CLI commands of botskills connect) remoteManifest

What language is this in?

C#

What happens?

Botskills connect didn't work as expected

What are the steps to reproduce this issue?

What were you expecting to happen?

It should add the skills to my VA, update the dispatch in VA, update skills.json, etc

Can you share any logs, error output, etc.?

Any screenshots or additional context?

This is the error occur in the bot connect image

My local running skills image

The manifest.json of the skills image

so as you can see the id is the same in the .lu in calendar skills. here is the attached screenshot( i just replace the appid and tokens in this screenshot to xxx for security purpose :D ) image

this is my VA directory image

i even tried to add folder name Skills in the VA but still not working

i checked blog and VLog, this is what i found in your msignite 2019 https://www.youtube.com/watch?v=u7Gql-ClcVA i see there is a script using (she is not using botconnnect)

any advice will do

thanks a lot

Batta32 commented 4 years ago

Hi @cocoytech, thanks for reporting the issue!

Error: Path to the Email.lu file leads to a nonexistent file.

Can you check if you have any utteranceSources with the Email source in your manifest.json?

The tool is trying to access to the Email.lu of the LU folder (where you have the Calendar.lu and General.lu) and it's failing because it doesn't exist.

The tool reads each utteranceSource which contains the <LU_FILENAME>#<INTENT> structure as source property from the manifest.

I recommend to always execute the tool with the --verbose argument so you can check the steps that is executing the tool.

Hope this helps to you 😊!

CurlyBytes commented 4 years ago

Yes i have UtteranceSources on my manifest.json

here is the entire

{
  "id": "calendar",
  "name": "Calendar Skill",
  "description": "The Calendar skill provides calendaring related capabilities and supports Office and Google calendars.",
  "iconUrl": "calendarSkill.png",
  "authenticationConnections": [
    {
      "id": "Outlook",
      "serviceProviderId": "Azure Active Directory v2",
      "scopes": "Calendars.ReadWrite, People.Read, Contacts.Read, User.Read.All"
    },
    {
      "id": "Google",
      "serviceProviderId": "Google",
      "scopes": "https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/contacts"
    }
  ],
  "actions": [
    {
      "id": "calendarskill_createEvent",
      "definition": {
        "description": "Create a new event",
        "slots": [
          {
            "name": "title",
            "types": [ "string" ]
          },
          {
            "name": "content",
            "types": [ "string" ]
          },
          {
            "name": "attendees",
            "types": [ "string" ]
          },
          {
            "name": "startdate",
            "types": [ "string" ]
          },
          {
            "name": "starttime",
            "types": [ "string" ]
          },
          {
            "name": "duration",
            "types": [ "string" ]
          },
                    {
                        "name": "location",
                        "types": [ "string" ]
                    },
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
        ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#CreateCalendarEntry",
                "Calendar#FindMeetingRoom"
              ]
            }
          ]
        }
      }
    },
    {
      "id": "calendar_changeEventStatus",
      "definition": {
        "description": "Change the status of an event (accept/decline).",
                "slots": [
                    {
                        "name": "startdate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "starttime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#AcceptEventEntry",
                "Calendar#DeleteCalendarEntry"
              ]
            }
          ]
        }
      }
    },
    {
      "id": "calendar_joinEvent",
      "definition": {
        "description": "Join the upcoming meeting",
                "slots": [
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#ConnectToMeeting"
              ]
            }
          ]
        }
      }
    },
    {
      "id": "calendar_summary",
      "definition": {
        "description": "Retrieve a summary of meetings through an event invocation.",
                "slots": [
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "events": [
            {
              "Name": "summaryEvent"
            }
          ]
        }
      }
    },
    {
      "id": "calendar_timeRemaining",
      "definition": {
        "description": "Find out how long until the next event",
                "slots": [
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#TimeRemaining"
              ]
            }
          ]
        }
      }
    },
    {
      "id": "calendar_summary",
      "definition": {
        "description": "Find an upcoming event",
                "slots": [
                    {
                        "name": "startdate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "starttime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "enddate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "endtime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#FindCalendarDetail",
                "Calendar#FindCalendarEntry",
                "Calendar#FindCalendarWhen",
                "Calendar#FindCalendarWhere",
                "Calendar#FindCalendarWho",
                "Calendar#FindDuration"
              ]
            }
          ]
        }
      }
    },
    {
      "id": "calendar_updateEvent",
      "definition": {
        "description": "Update an existing event.",
                "slots": [
                    {
                        "name": "startdate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "starttime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "enddate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "endtime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "newstartdate",
                        "types": [ "string" ]
                    },
                    {
                        "name": "newstarttime",
                        "types": [ "string" ]
                    },
                    {
                        "name": "timezone",
                        "types": [ "string" ]
                    }
                ],
        "triggers": {
          "utteranceSources": [
            {
              "locale": "en-us",
              "source": [
                "Calendar#ChangeCalendarEntry"
              ]
            }
          ]
        }
      }
    }
  ]
}

i added the --verbose in the script, still the same

image

Batta32 commented 4 years ago

Thanks @cocoytech. Comparing the screenshots you sent, we noticed that you have the Email Skill running but with the manifest of the Calendar Skill. Can you check if the manifest corresponds to the right skill?

I successfully replicated your scenario connecting a [C#] Virtual Assistant to a [C#] Calendar Skill.

Context

Connection Steps

  1. Open and run the Calendar Skills' solution (getting http://localhost:3980 endpoint)
  2. Connect the Calendar Skill to the Virtual Assistant being in the Virtual Assistant's root folder

    botskills connect --remoteManifest "http://localhost:3980/api/skill/manifest" --luisFolder "" --cs --verbose --languages "en-us"

  3. Check that the connection finished successfully

For further information, please read the following documents:

Please, feel free to compare both contexts and follow the connection steps mentioned above 😊.

Additional Context

Folder's structure of Calendar Skill and Virtual Assistant Sample image

Calendar Skill running image

Manifest of the Calendar Skill which contains the Calendar LUIS file (with CreateCalendarEntry and FindMeetingRoom intents) in the utteranceSources property image

Connection of the Calendar Skill and the Virtual Assistant Sample image

CurlyBytes commented 4 years ago

As you can see, luis gen is already install image

But this error display image

when i try to install luisgen this error happen image

it seems that i already install luisgen, but when i try luisgen -v it state an error image

i try both localManifest and remoteManifest still no luck

Batta32 commented 4 years ago

@cocoytech, this appears to be an issue related to the luisgen installation as it's a dotnet tool following the README.

Can you confirm if you have the following Enviroments Variables? If don't, can you add them and try again to execute luisgen -v?

Also, you can check if you have the luisgen correctly installed in C:\Users\<YOUR_USER>\.dotnet\tools.

image

image

CurlyBytes commented 4 years ago

This is what happen on luisgen -v , it gives me error image

upon checking the directory, i have already install image

This is the environment variables, it is already installed too image

CurlyBytes commented 4 years ago

i even retried to re install this npm npm i bot-cli -g and npm i -g chatdown msbot ludown luis-apis qnamaker botdispatch luisgen image

CurlyBytes commented 4 years ago

I even tried npm install luisgen -global

image

it says that i have already install, i try luisgen -v in powershell but having an error image

But i notice something, when im inside in the folder of luisgen.exe, the luisgen -v works perfectly based on the suggestion upon running inside the luisgen folder image As you can see when i attempt to do luisgen -v it still gives me an error, but when i follow the suggestion by .\luisgen -v it can clearly give the result version of the luisgen

so i made a stupid hack in the cli stuffs and dll. i copy all the folder name tools (the folder name store and luisgen.exe) and its corresponding files and documents insdie the root folder of VA and it works perfectly to any skills

image

i believe this issue is related to CLI or powershell, same story from this ticket https://github.com/microsoft/botframework-solutions/issues/2075 image but on this case instead mac os, the issue is on windows 10 pro build 18362

darrenj commented 4 years ago

@cocoytech With the move of luisgen into the bf-cli (and thus not a .net tool) this should get resolved. As per the known issue (albeit this time on Windows) can you try adding the path users/YOUR_USER_NAME/.dotnet/tools to your path (e.g. PATH=%PATH%;) and see if that helps? Best do that within a powershell instance.

CurlyBytes commented 4 years ago

Okay i repro on my end and follow the updates but still there are new errors arise

image

i already have manifest on the upload image

CurlyBytes commented 4 years ago

just an update

still the error is still persistent, i need to do the hacking stuff even i already npm install npm install -g @microsoft/botframework-cli

image

please advise

dfavretto commented 4 years ago

Hi @cocoytech, what version of Botskills are you using? I think the error you are facing may be due to an update for using the new Skill Manifests, which requires the latest version of Botskills (v1.0.12)

CurlyBytes commented 4 years ago

Yes i am using the latest version of the bot skills, still the error occurs

image

darrenj commented 4 years ago

Ahh - make sure you have a more recent clone of the repo. Then the manifest should be manifest-1.1.json not manifest.json which was removed to reduce confusion. Then as per the docs need to update manifest-1.1.json with endpoint and appid of your deployment.

CurlyBytes commented 4 years ago

As per advise, i tried using the manifest-1.1 but still no luck

without the hacky stuff in luisgen inside the root folder of Virtual Assistant, Botskills connect will not work as expected

darrenj commented 4 years ago

This seems to be all back to the issue around dotnet tools on some machines, previously just macs. Ahead of running botskills does the following help at all? Assuming that this added path has luisgen in it of course (installing via npm install -g is needed)

PATH=%PATH%;c:\users\YOUR_USER\.dotnet\tools

CurlyBytes commented 4 years ago

i already did npm install on global in , if you check the previous reply https://github.com/microsoft/botframework-solutions/issues/2927#issuecomment-580198453

its already install globally and the path is also correct https://github.com/microsoft/botframework-solutions/issues/2927#issuecomment-580063421

For alternate workaround, i just simply copy the luisgen.exe and .store file inside to my VA image just to let botskills work

darrenj commented 4 years ago

@Batta32 - can we review how luisgen is invoked by botskills and see if there are any additional options, feels like the system path is being ignored in this situation?

darrenj commented 4 years ago

We are tracking an update to botskills which will move to the BF CLI which incorporates luisgen functionality but through a javascript module not a .net tool which should remove this issue moving forward.

CurlyBytes commented 4 years ago

So also the documentation(website github docs) steps in installation of VA should be updated too? thanks

Batta32 commented 4 years ago

Yes @cocoytech! We will move to the BF CLI (as Darren mentioned) updating the documentation of Botskills 😊.

darrenj commented 4 years ago

We'll work on the bf cli changes which should address this .net tool path problem on osx (sometimes) and now Windows it seems