Agent

These docs are for version 1.x of Rasa Open Source.

User Guide

NLU

Core

Conversation Design

API Reference

Migrate from (beta)

Reference

Versions

viewing: 1.7.3

Tags

1.10.26 1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.14 1.10.13 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.9.1 1.9.0 1.8.3 1.8.2 1.8.1 1.8.0 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.2 1.5.3 1.4.6 1.3.10 1.2.9

Agent

classrasa.core.agent. Agent( domain=None, policies=None, interpreter=None, generator=None, tracker_store=None, lock_store=None, action_endpoint=None, fingerprint=None, model_directory=None, model_server=None, remote_storage=None, path_to_model_archive=None)

The Agent class provides a convenient interface for the most important Rasa functionality.

This includes training, handling messages, loading a dialogue model, getting the next action, and handling a channel.

create_processor( preprocessor=None)

Instantiates a processor based on the set state of the agent.

Return type: MessageProcessor

asyncexecute_action( sender_id, action, output_channel, policy, confidence)

Handle a single message.

Return type: DialogueStateTracker

handle_channels( channels, http_port=5005, route='/webhooks/', cors=None)

Start a webserver attaching the input channels and handling msgs.

Return type: Sanic

asynchandle_message( message, message_preprocessor=None, **kwargs)

Handle a single message.

Return type: Optional[List[Dict[str, Any]]`

asynchandle_text( text_message, message_preprocessor=None, output_channel=None, sender_id='default)

Handle a single message.

If a message preprocessor is passed, the message will be passed to that function first and the return value is then used as the input for the dialogue engine.

Return type: Optional[List[Dict[str, Any]]`

is_core_ready()

Check if all necessary components and policies are ready to use the agent.

Return type: bool

is_ready()

Check if all necessary components are instantiated to use agent.

Return type: bool

classmethodload( model_path, interpreter=None, generator=None, tracker_store=None, lock_store=None, action_endpoint=None, model_server=None, remote_storage=None, path_to_model_archive=None)

Load a persisted model from the passed path.

Return type: Agent

asyncload_data( training_resource, remove_duplicates=True, unique_last_num_states=None, augmentation_factor=50, tracker_limit=None, use_story_concatenation=True, debug_plots=False, exclusion_percentage=None)

Load training data from a resource.

Return type: ListDialogueStateTracker

asynclog_message( message, message_preprocessor=None, **kwargs)

Append a message to a dialogue - does not predict actions.

Return type: DialogueStateTracker

asyncparse_message_using_nlu_interpreter( message_data, tracker=None)

Handles message text and intent payload input messages.

Return type: Dict[str, Any]

persist( model_path)

Persists this agent into a directory for later loading and usage.

Return type: None

asyncpredict_next( sender_id, **kwargs)

Handle a single message.

Return type: Optional[Dict[str, Any]]

toggle_memoization( activate)

Toggles the memoization on and off.

Return type: None

train( training_trackers, **kwargs)

Train the policies / policy ensemble using dialogue data from file.

Return type: None

asynctrigger_intent( intent_name, entities, output_channel, tracker)

Trigger a user intent, e.g. triggered by an external event.

Return type: None