Standard actions
conatus.actions.preloaded.standard_actions
¶
Built-in Actions that are always available.
Print
¶
Bases: Action
Print a message.
limited_print
conatus-action
¶
This function is an Action
You can call limited_print just like a regular function, but note that it is
actually a Action object.
This means that:
limited_printhas additional properties and methods that you can use (see theActiondocumentation for more information);- but it also means that operations like
issubclassandisinstancewill not work as expected.
Print a message.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object to print.
TYPE:
|
offset
|
The offset to start printing from.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The printed message.
TYPE:
|
Source code in conatus/actions/preloaded/standard_actions.py
Terminate
¶
Bases: TypedAction[[tuple[ParamType]], None]
Terminate the program.
terminate
conatus-action
¶
This function is an Action
You can call terminate just like a regular function, but note that it is
actually a Action object.
This means that:
terminatehas additional properties and methods that you can use (see theActiondocumentation for more information);- but it also means that operations like
issubclassandisinstancewill not work as expected.
Terminate the program.
| PARAMETER | DESCRIPTION |
|---|---|
args
|
The variables to terminate the program with.
TYPE:
|
kwargs
|
The keyword arguments to terminate the program with.
TYPE:
|
Source code in conatus/actions/preloaded/standard_actions.py
terminate_
conatus-action
¶
This function is an Action
You can call terminate_ just like a regular function, but note that it is
actually a Action object.
This means that:
terminate_has additional properties and methods that you can use (see theActiondocumentation for more information);- but it also means that operations like
issubclassandisinstancewill not work as expected.
Terminate the program.
| PARAMETER | DESCRIPTION |
|---|---|
args
|
The variables to terminate the program with.
TYPE:
|
kwargs
|
The keyword arguments to terminate the program with.
TYPE:
|
Source code in conatus/actions/preloaded/standard_actions.py
terminate
¶
terminate(
expected_outputs: OrderedDict[
str, tuple[TypeOfType, str]
],
) -> Action
Get an 'terminate' action that expects specific outputs.
This function enables an Agent to
have a function that can terminate a run. That function (a
wrapped version of terminate_
) expects its
inputs to be the outputs of the run. Think of this as a return
statement.
| PARAMETER | DESCRIPTION |
|---|---|
expected_outputs
|
The expected outputs of the program. The keys are the names of the outputs, and the values are a tuple containing the type of the output and its description.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Action
|
the Action |
Source code in conatus/actions/preloaded/standard_actions.py
print_to_console
conatus-action
¶
print_to_console(message: str) -> None
This function is an Action
You can call print_to_console just like a regular function, but note that it is
actually a Action object.
This means that:
print_to_consolehas additional properties and methods that you can use (see theActiondocumentation for more information);- but it also means that operations like
issubclassandisinstancewill not work as expected.
Print a message to the console.
Warning: Your console is limited in terms of space, so be careful with the length of the message.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message to print.
TYPE:
|