MicrosoftLearning / AI-102-AIEngineer

Lab files for AI-102 - AI Engineer
https://microsoftlearning.github.io/AI-102-AIEngineer/
MIT License
742 stars 853 forks source link

Lab 13 initial code set up does not work #159

Closed CalebWelch closed 2 years ago

CalebWelch commented 2 years ago

Lab/Demo: 13

Task: Test the bot in the Bot Framework Emulator

Description of issue Starter template code does not work. Repro steps:

  1. Clone repo
  2. follow the instructions given in the lab (cookiecutter https://github.com/microsoft/botbuilder-python/releases/download/Templates/echo.zip) 3.Start app
  3. go to the localhost and port defined and go to api/messages (localhost:3978/api/messages)
  4. No chat pane pops up like the lab mentions, cannot send messages to the bot with requests using something like postman either

    image

    
    ======== Running on http://localhost:3978 ========
    (Press CTRL+C to quit)
    Traceback (most recent call last):
    File "F:\anaconda2\envs\tf_gpu_env\lib\site-packages\botbuilder\core\integration\aiohttp_channel_service_exception_middleware.py", line 20, in aiohttp_error_middleware
    response = await handler(request)
    File "F:\anaconda2\envs\tf_gpu_env\lib\site-packages\aiohttp\web_urldispatcher.py", line 931, in _handle
    raise self._http_exception
    aiohttp.web_exceptions.HTTPMethodNotAllowed: Method Not Allowed
    Traceback (most recent call last):
    File "F:\anaconda2\envs\tf_gpu_env\lib\site-packages\botbuilder\core\integration\aiohttp_channel_service_exception_middleware.py", line 20, in aiohttp_error_middleware
    response = await handler(request)
    File "F:\anaconda2\envs\tf_gpu_env\lib\site-packages\aiohttp\web_urldispatcher.py", line 931, in _handle
    raise self._http_exception
    aiohttp.web_exceptions.HTTPNotFound: Not Found

botbuilder-core 4.14.2 botbuilder-schema 4.14.2 botframework-connector 4.14.2 botframework-streaming 4.14.2 aiohttp 3.8.3 asyncio 3.4.3 cookiecutter 1.7.0

GraemeMalcolm commented 2 years ago

@CalebWelch , are you using the hosted VM on Microsoft Learn or the lab profile provided in an instructor-led course?

CalebWelch commented 2 years ago

@GraemeMalcolm I tried both locally and the VM provided via the course https://learn.microsoft.com/en-us/training/modules/design-bot-conversation-flow/6-exercise-create-a-bot and got the same issue on both

GraemeMalcolm commented 2 years ago

OK, thanks - we'll investigate and report back...

GraemeMalcolm commented 2 years ago

Hmm - non-repro for me. Are you sure when you open the bot in the emulator you're specifying the URL where your bot is running (in my case it's http://localhost:3978/api/messages, but the port number might vary - it's displayed when you run the python app.py command.

CalebWelch commented 2 years ago

Code_MjVEPBPZSv Yes, I made sure its the correct address and port

GraemeMalcolm commented 2 years ago

The file paths in your screenshot don't match the hosted VM. Can you record what happens when you use the hosted VM environment?

CalebWelch commented 2 years ago

image Same issue in the VM

GraemeMalcolm commented 2 years ago

So, here's what I get in the hosted VM from Learn. I have no idea why you're getting a different result. image

GraemeMalcolm commented 2 years ago

Ah - yes I do. It looks like you're trying to test the bot using a web browser instead of Bot Framework Emulator.

CalebWelch commented 2 years ago

Ah I see I missed a step, although I'm still having an issue. there's no start up message, and the message fails to send. No errors are popping up in the console either image

GraemeMalcolm commented 2 years ago

In Bot Framework Emulator, you've connected to http://localhost:3980/api/messages, but your bot is running on http://localhost:3978/api/messages.

CalebWelch commented 2 years ago

Ah cheers, thanks for helping me. I should try to read a bit better next time.