Skip to content

Commit

Permalink
fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Jun 18, 2023
1 parent e646d3b commit 2d56ce5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion rasa/core/actions/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,10 +950,12 @@ async def run(
return []
return []
# buttons = []
# button_topic = {topic.name}_{topic.topicTemplate.id}
# payload = f'/alternative_answer{{"topic": "{button_topic}"}}'
# buttons.append(
# {
# "title": button_title,
# "payload": f'/alternative_answer{{"topic": "{topic.name}_{topic.topicTemplate.id}"}}',
# "payload": payload,
# })


Expand Down
5 changes: 3 additions & 2 deletions rasa/core/policies/flow_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def advance_flows(self, tracker: DialogueStateTracker) -> ActionPrediction:
if prediction.action_name:
# if a flow can be started, we'll start it
return prediction
if not (top_flow := self.flow_stack.top()):
if self.flow_stack.is_empty():
# if there are no flows, there is nothing to do
return ActionPrediction(None, 0.0)
else:
Expand Down Expand Up @@ -964,7 +964,8 @@ def _run_step(
and previous_flow_step
and current_frame.frame_type == StackFrameType.CORRECTION
):
# TODO: we need to figure out how to actually "undo" the changed slots
# TODO: we need to figure out how to actually
# "undo" the changed slots
corrected_slots = tracker.get_slot(CORRECTED_SLOTS_SLOT)
if corrected_slots:
self._correct_flow_position(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DOCS_URL_POLICIES,
DOCS_URL_RULES,
)
from rasa.shared.core.domain import Domain, InvalidDomain
from rasa.shared.core.domain import Domain
from rasa.shared.core.constants import (
ACTION_BACK_NAME,
ACTION_RESTART_NAME,
Expand Down
12 changes: 8 additions & 4 deletions rasa/nlu/classifiers/llm_flow_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,24 @@ def parse_action_list(

# case 2
# "I want to send some money to Joe"
# starting a flow with entities mentioned -> intent = flow name, entities only those that are valid for the flow
# starting a flow with entities mentioned -> intent = flow name,
# entities only those that are valid for the flow

# case 3
# "50$"
# giving information for the current slot -> intent = inform, entity only that of the current slot
# giving information for the current slot -> intent = inform,
# entity only that of the current slot

# case 4
# "Sorry I meant, Joe, not John"
# correcting a previous slot from the flow -> intent = correction, entity of the previous slot
# correcting a previous slot from the flow -> intent = correction,
# entity of the previous slot

# everything else is too complex for now:
# case 5
# "50$, how much money do I still have btw?"
# giving information about current flow and starting new flow right away -> intent = complex
# giving information about current flow and starting new flow
# right away -> intent = complex

# TODO: check that we have a valid flow name if any, reprompt if mistake?
# TODO: assign slot sets to current flow, new flow if any, and other
Expand Down
4 changes: 1 addition & 3 deletions rasa/shared/importers/importer.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from functools import reduce
from typing import Text, Optional, List, Dict, Set, Any, Tuple, Type, Union, cast
import logging

import pkg_resources

import rasa.shared.constants
from rasa.shared.core.flows.flow import Flow, FlowsList, QuestionFlowStep
from rasa.shared.core.flows.flow import FlowsList, QuestionFlowStep
import rasa.shared.utils.common
import rasa.shared.core.constants
import rasa.shared.utils.io
from rasa.shared.core.domain import (
KEY_FORMS,
KEY_RESPONSES_TEXT,
Domain,
KEY_E2E_ACTIONS,
KEY_INTENTS,
Expand Down

0 comments on commit 2d56ce5

Please sign in to comment.