Skip to content

Commit

Permalink
made tracker optional in the component interface
Browse files Browse the repository at this point in the history
  • Loading branch information
twerkmeister committed Jun 16, 2023
1 parent d52a6ab commit 31543a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rasa/nlu/classifiers/llm_flow_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@ def train(self, training_data: TrainingData) -> Resource:
def process(
self,
messages: List[Message],
tracker: DialogueStateTracker,
tracker: Optional[DialogueStateTracker] = None,
flows: Optional[FlowsList] = None,
) -> List[Message]:
"""Return the most likely intent and its probability for a message."""
"""Return intent and entities for a message."""
return [self.process_single(msg, tracker, flows) for msg in messages]

def process_single(
self,
message: Message,
tracker: DialogueStateTracker,
tracker: Optional[DialogueStateTracker] = None,
flows: Optional[FlowsList] = None,
) -> Message:
if flows is None:
# cannot do anything if there are no flows
if flows is None or tracker is None:
# cannot do anything if there are no flows or no tracker
return message
flow_prompt = self.render_template(message, tracker, flows)
logger.info(flow_prompt)
Expand Down

0 comments on commit 31543a5

Please sign in to comment.