roboto.action_runtime.action_input.action_input
Module Contents
ActionInput
Resolved references to input data an Action was given to operate on.
To use, access via get_input().
Usage
From within an Action, list files passed as input and check their size:
context = InvocationContext.from_env()
action_input = context.get_input()
for file, local_path in action_input.files:
print(f"{file.file_id} is {local_path.stat().st_size} bytes")Attributes
ActionInput.files
Files passed as input data to an action invocation.
A file is represented as a tuple of (File, Optional[Path]) where: - File exposes metadata about the file and useful file operations - Optional[Path] is the local file path if the file has been downloaded
ActionInput.from_record()
Create an ActionInput instance from its serialized representation.
Parameters
record ActionInputRecordroboto_client roboto.Return type
ActionInput.get_topics_by_name()
Return any topics in this ActionInput that have the provided name.
Parameters
topic_name strTopic name to look for.
Returns
A list of matching Topic instances from self.topics. If no topics have the provided name, the list will be empty. Otherwise, there will be one or more topics in the list, depending on the topic selectors provided to the action invocation.
Attributes
ActionInput.sessions
Sessions passed as input data to an action invocation.
ActionInput.topics
Topics passed as input data to an action invocation.
ActionInputRecord
Bases: pydantic.BaseModel
Serializable representation of an ActionInput.
Parameters
data AnyAttributes