nextcloud / talk_bot_ai

Nextcloud Assistant Talk Bot
https://apps.nextcloud.com/apps/talk_bot_ai
MIT License
5 stars 0 forks source link

Assistant Talk Bot 3.0.0 not work #8

Open GreyMamoN opened 2 weeks ago

GreyMamoN commented 2 weeks ago

Привіт розробникам!

Message in talk: @assistant What sounds do cats make?

docker logs -f nc_app_talk_bot_ai

TRACE:    127.0.0.1:39434 - HTTP connection made
TRACE:    127.0.0.1:39434 - ASGI [7] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('127.0.0.1', 23000), 'client': ('127.0.0.1', 39434), 'scheme': 'http', 'root_path': '', 'headers': '<...>', 'state': {}, 'method': 'POST', 'path': '/message', 'raw_path': b'/message', 'query_string': b'reply_to=244&token=ciwh7khq'}
TRACE:    127.0.0.1:39434 - ASGI [7] Receive {'type': 'http.request', 'body': '<1462 bytes>', 'more_body': False}
TRACE:    127.0.0.1:39434 - ASGI [7] Send {'type': 'http.response.start', 'status': 500, 'headers': '<...>'}
INFO:     127.0.0.1:39434 - "POST /message?reply_to=244&token=ciwh7khq HTTP/1.1" 500 Internal Server Error
TRACE:    127.0.0.1:39434 - ASGI [7] Send {'type': 'http.response.body', 'body': '<21 bytes>'}
TRACE:    127.0.0.1:39434 - ASGI [7] Raised exception
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/message_logger.py", line 84, in __call__
    raise exc from None
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/message_logger.py", line 80, in __call__
    await self.app(scope, inner_receive, inner_send)
  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.12/site-packages/nc_py_api/ex_app/integration_fastapi.py", line 258, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/main.py", line 71, in message_handler
    AI_BOT.send_message(task["output"], reply_to, token=token)
  File "/usr/local/lib/python3.12/site-packages/nc_py_api/talk_bot.py", line 139, in send_message
    return self._sign_send_request("POST", f"/{token}/message", params, message), reference_id
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/nc_py_api/talk_bot.py", line 185, in _sign_send_request
    hmac_sign.update(data_to_sign.encode("UTF-8"))
                     ^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'encode'
TRACE:    127.0.0.1:39434 - HTTP connection lost

Привіт розробникам!

Assistant commented 2 weeks ago

Cats make all sorts of different sounds depending on the situation or the message they are trying to convey. Some examples are:

I hope this information is useful, and make sure to let me know if you have any more cat related inquiries!