paulpierre / RasaGPT

💬 RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngrok, telegram
https://rasagpt.dev
MIT License
2.35k stars 227 forks source link

the telegram application sends a text but no reply comes back -please help #33

Open pepep788 opened 1 year ago

pepep788 commented 1 year ago

telegram app send mesage -ok

 data: {'intent': {'name': 'greet', 'confidence': 0.9993299245834351}, 'entities': [], 'text': 'test message -ok', 'message_id': '3f94b27b500544cd9561873a2dc36885', 'metadata': {'response': None, 'tags': None, 'is_escalate': False, 'session_id': 'cb686254-f3cf-4150-a83f-2d7d525acd50'}, 'text_tokens': [[0, 4], [5, 12], [14, 16]], 'intent_ranking': [{'name': 'greet', 'confidence': 0.9993299245834351}, {'name': 'out_of_scope', 'confidence': 0.0006701531819999218}], 'response_selector': {'all_retrieval_intents': [], 'default': {'response': {'responses': None, 'confidence': 0.0, 'intent_response_key': None, 'utter_action': 'utter_None'}, 'ranking': []}}}
    1. 2023 16:16:57 metadata: {'response': None, 'tags': None, 'is_escalate': False, 'session_id': 'cb686254-f3cf-4150-a83f-2d7d525acd50'}
    1. 2023 16:16:57 response: None
    1. 2023 16:16:57 tags: None
    1. 2023 16:16:57 is_escalate: False

      the telegram application sends a text but no reply comes back

2023-06-30 14:16:57 DEBUG aiogram - Make request: "getMe" with data: "{}" and files "None"

    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG aiogram - Response for getMe: [200] "'{"ok":true,"result":{"id":6263777998,"is_bot":true,"first_name":"Pepe_788bot","username":"Pepe788_bot","can_join_groups":true,"can_read_all_group_messages":false,"supports_inline_queries":false}}'"
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.shared.utils.common - [🤖 ActionGPTFallback]
    1. 2023 16:16:57 metadata: {'response': None, 'tags': None, 'is_escalate': False, 'session_id': 'cb686254-f3cf-4150-a83f-2d7d525acd50'}
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.core.lock_store - Issuing ticket for conversation '6141325834'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.core.lock_store - Acquiring lock for conversation '6141325834'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.core.lock_store - Acquired lock for conversation '6141325834'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.core.tracker_store - Recreating tracker for id '6141325834'
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.runner.dask - Running graph with inputs: {'message': [<rasa.core.channels.channel.UserMessage object at 0x7f8d3b8dc460>], 'tracker': <rasa.shared.core.trackers.DialogueStateTracker object at 0x7f8d14528df0>}, targets: ['run_RegexMessageHandler'] and ExecutionContext(model_id='c9a3bdb3a8354228bf1ece7c8de5f86a', should_add_diagnostic_data=False, is_finetuning=False, node_name=None).
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'nlu_message_converter' running 'NLUMessageConverter.convert_user_message'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_WhitespaceTokenizer0' running 'WhitespaceTokenizer.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_RegexFeaturizer1' running 'RegexFeaturizer.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_LexicalSyntacticFeaturizer2' running 'LexicalSyntacticFeaturizer.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_CountVectorsFeaturizer3' running 'CountVectorsFeaturizer.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_CountVectorsFeaturizer4' running 'CountVectorsFeaturizer.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_DIETClassifier5' running 'DIETClassifier.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_EntitySynonymMapper6' running 'EntitySynonymMapper.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_ResponseSelector7' running 'ResponseSelector.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.nlu.classifiers.diet_classifier - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.nlu.selectors.response_selector - Adding following selector key to message property: default
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_FallbackClassifier8' running 'FallbackClassifier.process'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'domain_provider' running 'DomainProvider.provide_inference'.
    1. 2023 16:16:57 2023-06-30 14:16:57 DEBUG rasa.engine.graph - Node 'run_RegexMessageHandler' running 'RegexMessageHandler.process'.
    1. 2023 16:16:57
lingwei098 commented 1 year ago

check http://localhost:9999/ for info about chat_rasa_actions container, see if there is any response for your request. I have the same problem where there is no reply in telegram but the containers logs shows the response.

pepep788 commented 1 year ago

rasa aktion logs: opt/venv/lib/python3.10/site-packages/rasa/core/tracker_store.py:1042: MovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

    1. 2023 10:31:18 Base: DeclarativeMeta = declarative_base()
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:121: DeprecationWarning: pkg_resources is deprecated as an API
    1. 2023 10:31:18 warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
    1. 2023 10:31:18 Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    1. 2023 10:31:18 declare_namespace(pkg)
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
    1. 2023 10:31:18 Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    1. 2023 10:31:18 declare_namespace(pkg)
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('ruamel').
    1. 2023 10:31:18 Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    1. 2023 10:31:18 declare_namespace(pkg)
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('ruamel.yaml').
    1. 2023 10:31:18 Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    1. 2023 10:31:18 declare_namespace(pkg)
    1. 2023 10:31:18 :283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead
    1. 2023 10:31:18 /opt/venv/lib/python3.10/site-packages/sanic_cors/extension.py:39: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    1. 2023 10:31:18 SANIC_VERSION = LooseVersion(sanic_version)
    1. 2023 10:31:18 2023-07-06 08:31:18 INFO rasa_sdk.endpoint - Starting action endpoint server...
    1. 2023 10:31:18 2023-07-06 08:31:18 INFO rasa_sdk.executor - Registered function for 'action_gpt_fallback'.
    1. 2023 10:31:18 2023-07-06 08:31:18 INFO rasa_sdk.endpoint - Starting plugins...
    1. 2023 10:31:18 2023-07-06 08:31:18 INFO rasa_sdk.plugin - No plugins found
    1. 2023 10:31:18 Traceback (most recent call last):
    1. 2023 10:31:18 File "/opt/venv/lib/python3.10/site-packages/rasa_sdk/plugin.py", line 26, in _discover_plugins
    1. 2023 10:31:18 import rasa_sdk_plugins
    1. 2023 10:31:18 ModuleNotFoundError: No module named 'rasa_sdk_plugins'
    1. 2023 10:31:18 2023-07-06 08:31:18 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055
    1. 2023 10:31:18 2023-07-06 08:31:18 DEBUG rasa_sdk.utils - Using the default number of Sanic workers (1).
lingwei098 commented 1 year ago

Those warnings are fine. You need to check Dozzle for logs for your chat_rasa_actions container, there might be some rasa actions responeses which may not appear in telegram chat window.

pepep788 commented 1 year ago

this is not okey : chat_api

DEBUG:config:💬 Query received: /start

    1. 2023 11:54:35 💬 Query received: /start
    1. 2023 11:54:35 DEBUG:config:[Document(page_content='/start', metadata={})]
    1. 2023 11:54:35 [Document(page_content='/start', metadata={})]
    1. 2023 11:54:35 DEBUG:openai:message='Request to OpenAI API' method=post path=https://api.openai.com/v1/engines/text-embedding-ada-002/embeddings
    1. 2023 11:54:35 message='Request to OpenAI API' method=post path=https://api.openai.com/v1/engines/text-embedding-ada-002/embeddings
    1. 2023 11:54:35 DEBUG:openai:api_version=None data='{"input": [[71076]], "encoding_format": "base64"}' message='Post details'
    1. 2023 11:54:35 api_version=None data='{"input": [[71076]], "encoding_format": "base64"}' message='Post details'
    1. 2023 11:54:35 DEBUG:urllib3.connectionpool:https://api.openai.com:443 "POST /v1/engines/text-embedding-ada-002/embeddings HTTP/1.1" 200 None
    1. 2023 11:54:35 https://api.openai.com:443 "POST /v1/engines/text-embedding-ada-002/embeddings HTTP/1.1" 200 None
    1. 2023 11:54:35 DEBUG:openai:message='OpenAI API response' path=https://api.openai.com/v1/engines/text-embedding-ada-002/embeddings processing_ms=29 request_id=66bd0bb3be226ea477205fd7fbf305ec response_code=200
    1. 2023 11:54:35 message='OpenAI API response' path=https://api.openai.com/v1/engines/text-embedding-ada-002/embeddings processing_ms=29 request_id=66bd0bb3be226ea477205fd7fbf305ec response_code=200
    1. 2023 11:54:35 INFO: 192.168.32.3:39736 - "POST /webhooks/telegram/webhook HTTP/1.1" 500 Internal Server Error
    1. 2023 11:54:35 ERROR: Exception in ASGI application
    1. 2023 11:54:35 Traceback (most recent call last):
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    1. 2023 11:54:35 self.dialect.do_execute(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    1. 2023 11:54:35 cursor.execute(statement, parameters)
    1. 2023 11:54:35 psycopg2.errors.UndefinedObject: type "vector" does not exist
    1. 2023 11:54:35 LINE 2: ..., -0.009949797562368176, -0.005853437234058733]'::vector(153...
    1. 2023 11:54:35 ^
    1. 2023 11:54:35
    1. 2023 11:54:35
    1. 2023 11:54:35 The above exception was the direct cause of the following exception:
    1. 2023 11:54:35
    1. 2023 11:54:35 Traceback (most recent call last):
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    1. 2023 11:54:35 result = await app( # type: ignore[func-returns-value]
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
    1. 2023 11:54:35 return await self.app(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 284, in call
    1. 2023 11:54:35 await super().call(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
    1. 2023 11:54:35 await self.middleware_stack(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
    1. 2023 11:54:35 raise exc
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
    1. 2023 11:54:35 await self.app(scope, receive, _send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
    1. 2023 11:54:35 raise exc
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
    1. 2023 11:54:35 await self.app(scope, receive, sender)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
    1. 2023 11:54:35 raise e
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
    1. 2023 11:54:35 await self.app(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
    1. 2023 11:54:35 await route.handle(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
    1. 2023 11:54:35 await self.app(scope, receive, send)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
    1. 2023 11:54:35 response = await func(request)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 241, in app
    1. 2023 11:54:35 raw_response = await run_endpoint_function(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 169, in run_endpoint_function
    1. 2023 11:54:35 return await run_in_threadpool(dependant.call, **values)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    1. 2023 11:54:35 return await anyio.to_thread.run_sync(func, *args)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/anyio/to_thread.py", line 33, in run_sync
    1. 2023 11:54:35 return await get_asynclib().run_sync_in_worker_thread(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    1. 2023 11:54:35 return await future
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    1. 2023 11:54:35 result = context.run(func, *args)
    1. 2023 11:54:35 File "/app/api/main.py", line 522, in get_webhook
    1. 2023 11:54:35 chat_session = chat_query(
    1. 2023 11:54:35 File "/app/api/llm.py", line 151, in chat_query
    1. 2023 11:54:35 nodes = get_nodes_by_embedding(
    1. 2023 11:54:35 File "/app/api/llm.py", line 390, in get_nodes_by_embedding
    1. 2023 11:54:35 nodes = session.exec(text(sql)).all()
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlmodel/orm/session.py", line 60, in exec
    1. 2023 11:54:35 results = super().execute(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    1. 2023 11:54:35 result = conn._execute_20(statement, params or {}, execution_options)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    1. 2023 11:54:35 return meth(self, args_10style, kwargs_10style, execution_options)
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    1. 2023 11:54:35 return connection._execute_clauseelement(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    1. 2023 11:54:35 ret = self._execute_context(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    1. 2023 11:54:35 self._handle_dbapi_exception(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    1. 2023 11:54:35 util.raise_(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    1. 2023 11:54:35 raise exception
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    1. 2023 11:54:35 self.dialect.do_execute(
    1. 2023 11:54:35 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    1. 2023 11:54:35 cursor.execute(statement, parameters)
    1. 2023 11:54:35 sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) type "vector" does not exist
    1. 2023 11:54:35 LINE 2: ..., -0.009949797562368176, -0.005853437234058733]'::vector(153...
    1. 2023 11:54:35 ^
    1. 2023 11:54:35
    1. 2023 11:54:35 [SQL: SELECT * FROM match_node_euclidean(
    1. 2023 11:54:35 '[-0.01694324391946027, -0.02811323421727888, 0.0005517012793294491, -0.008959698308852264, -0.03433272917884049, 0.018030957884007073,
ajiepamungkasep commented 1 year ago

i have the same issue with you. have you resolved it?

lingwei098 commented 1 year ago

INFO: 192.168.32.3:39736 - "POST /webhooks/telegram/webhook HTTP/1.1" 500 Internal Server Errorcheck your webhook connection, it says clearly in the log.