Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.action_runtime.action_input.action_input

Module Contents

ActionInput

class roboto.action_runtime.action_input.action_input.ActionInput#View Source

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 collections.abc.Sequence[tuple[roboto.domain.files.File, pathlib.Path | None]] = [] #

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()

classmethod from_record(record, roboto_client)#View Source

Create an ActionInput instance from its serialized representation.

Parameters

Return type

ActionInput.get_topics_by_name()

get_topics_by_name(topic_name)#View Source

Return any topics in this ActionInput that have the provided name.

Parameters

topic_name str

Topic 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 collections.abc.Sequence[roboto.experimental.sessions.Session] = [] #

Sessions passed as input data to an action invocation.

ActionInput.topics

topics collections.abc.Sequence[roboto.domain.topics.Topic] = [] #

Topics passed as input data to an action invocation.

ActionInputRecord

class roboto.action_runtime.action_input.action_input.ActionInputRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Serializable representation of an ActionInput.

Parameters

data Any

Attributes

ActionInputRecord.files

files collections.abc.Sequence[tuple[roboto.domain.files.FileRecord, pathlib.Path | None]] = None #

ActionInputRecord.sessions

sessions collections.abc.Sequence[roboto.experimental.sessions.SessionRecord] = None #

ActionInputRecord.topics

topics collections.abc.Sequence[roboto.domain.topics.TopicRecord] = None #

DEFAULT_INPUT_FILE

roboto.action_runtime.action_input.action_input.DEFAULT_INPUT_FILE#View Source

Was this page helpful?