Skip to content

Commit

Permalink
initialize domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rgstephens committed Sep 26, 2023
1 parent 72700c2 commit cda5069
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rasa_sdk/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ async def webhook(request: Request) -> HTTPResponse:
action_call = json.loads(decompressed_data)
else:
action_call = request.json
if "domain" in action_call:
action_call["domain"]["tracer"] = tracer
action_call["domain"]["context"] = context
if not "domain" in action_call:
action_call["domain"] = {} # initialize a domain if it doesn't come from rasa pod
action_call["domain"]["tracer"] = tracer
action_call["domain"]["context"] = context
if action_call is None:
body = {"error": "Invalid body request"}
return response.json(body, status=400)
Expand Down

0 comments on commit cda5069

Please sign in to comment.