microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
403 stars 176 forks source link

[Bug]: feedback_loop error #2061

Open jamiesun opened 3 days ago

jamiesun commented 3 days ago

Language

Python

Version

latest

Description

@bot_app.feedback_loop
async def on_feedback_loop(
    context: TurnContext, state: AppTurnState, feedback_data: FeedbackLoopData
):
    print(feedback_data)

Exception:

DEBUG:httpx:load_verify_locations cafile='/Volumes/ExtDISK/github/TeamsBot/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.11/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
    cli.main()
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
    run()
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/wangjuntao/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "/Volumes/ExtDISK/github/TeamsBot/src/app.py", line 3, in <module>
    from api import api as app
  File "/Volumes/ExtDISK/github/TeamsBot/src/api.py", line 6, in <module>
    from teamsbot import bot_app
  File "/Volumes/ExtDISK/github/TeamsBot/src/teamsbot.py", line 257, in <module>
    @bot_app.feedback_loop
     ^^^^^^^^^^^^^^^^^^^^^
TypeError: Application.feedback_loop() takes 1 positional argument but 2 were given

Reproduction Steps

1.Define the event code
2.Start debugging
SubbaReddi commented 1 day ago

@jamiesun: Can you try updating @bot_app.feedback_loop to @bot_app.feedback_loop()