Skip to content

Commit

Permalink
Logged payload in Action Server Logs. (#1113)
Browse files Browse the repository at this point in the history
* Logged payload in Action Server Logs.

* Logged payload in Action Server Logs.

---------

Co-authored-by: Nupur Khare <[email protected]>
Co-authored-by: udit-pandey <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2024
1 parent 0fbecb7 commit 91d2048
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kairon/actions/definitions/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kairon.actions.definitions.base import ActionsBase
from kairon.shared.actions.data_objects import ActionServerLogs, DatabaseAction
from kairon.shared.actions.exception import ActionFailure
from kairon.shared.actions.models import ActionType, DbQueryValueType
from kairon.shared.actions.models import ActionType
from kairon.shared.actions.utils import ActionUtility
from kairon.shared.constants import KaironSystemSlots
from kairon.shared.vector_embeddings.db.factory import VectorEmbeddingsDbFactory
Expand Down Expand Up @@ -64,6 +64,7 @@ async def execute(self, dispatcher: CollectingDispatcher, tracker: Tracker, doma
failure_response = 'I have failed to process your request.'
filled_slots = {}
msg_logger = []
request_body = None

try:
vector_action_config = self.retrieve_config()
Expand Down Expand Up @@ -101,6 +102,7 @@ async def execute(self, dispatcher: CollectingDispatcher, tracker: Tracker, doma
action=self.name,
config=vector_action_config,
sender=tracker.sender_id,
payload=str(request_body) if request_body else None,
response=str(response) if response else None,
bot_response=str(bot_response) if bot_response else None,
messages=msg_logger,
Expand Down

0 comments on commit 91d2048

Please sign in to comment.