Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
core_ai\aiactions\generate_image Class Reference
Inheritance diagram for core_ai\aiactions\generate_image:
core_ai\aiactions\base

Public Member Functions

 __construct (int $contextid, protected int int $userid, protected string string $prompttext, protected string string $quality, protected string string $aspectratio, protected int int $numimages, protected string string $style,)
 Create a new instance of the generate_image action.
 
 get_configuration (string $name)
 Get a configuration option.
 
 store (response_base $response)
 Responsible for storing any action specific data in the database.
 

Static Public Member Functions

static get_basename ()
 Get the basename of the class.
 
static get_description ()
 Get the action description.
 
static get_name ()
 Get the action name.
 
static get_response_classname ()
 Get the class name of the response object.
 
static get_system_instruction ()
 Get the system instruction for the action.
 

Protected Member Functions

 get_tablename ()
 Return the correct table name for the action.
 

Protected Attributes

int readonly int $timecreated
 Timestamp the action object was created.
 

Constructor & Destructor Documentation

◆ __construct()

core_ai\aiactions\generate_image::__construct ( int $contextid,
protected int int $userid,
protected string string $prompttext,
protected string string $quality,
protected string string $aspectratio,
protected int int $numimages,
protected string string $style )

Create a new instance of the generate_image action.

It’s responsible for performing any setup tasks, such as getting additional data from the database etc.

Parameters
int$contextidThe context id the action was created in.
int$useridThe user id making the request.
string$prompttextThe prompt text used to generate the image.
string$qualityThe quality of the generated image.
string$aspectratioThe aspect ratio of the generated image.
int$numimagesThe number of images to generate.
string$styleThe visual style of the generated image.
Parameters
$useridThe user id requesting the action.
$prompttextThe prompt text used to generate the image
$qualityThe quality of the generated image
$aspectratioThe aspect ratio of the generated image
$numimagesThe number of images to generate
$styleThe visual style of the generated image

Member Function Documentation

◆ get_basename()

static core_ai\aiactions\base::get_basename ( )
staticinherited

Get the basename of the class.

This is used to generate the action name and description.

Return values
stringThe basename of the class.

◆ get_configuration()

core_ai\aiactions\base::get_configuration ( string $name)
inherited

Get a configuration option.

Parameters
string$nameThe name of the configuration option to get.
Return values
mixedThe value of the configuration option.

◆ get_description()

static core_ai\aiactions\base::get_description ( )
staticinherited

Get the action description.

Defaults to the action description string.

Return values
string

◆ get_name()

static core_ai\aiactions\base::get_name ( )
staticinherited

Get the action name.

Defaults to the action name string.

Return values
string

◆ get_response_classname()

static core_ai\aiactions\base::get_response_classname ( )
staticinherited

Get the class name of the response object.

Return values
stringThe class name of the response object.

◆ get_system_instruction()

static core_ai\aiactions\base::get_system_instruction ( )
staticinherited

Get the system instruction for the action.

Return values
stringThe system instruction for the action.

◆ get_tablename()

core_ai\aiactions\base::get_tablename ( )
protectedinherited

Return the correct table name for the action.

Return values
stringThe correct table name for the action.

◆ store()

core_ai\aiactions\generate_image::store ( response_base $response)

Responsible for storing any action specific data in the database.

Parameters
response_base$responseThe response object to store.
Return values
intThe id of the stored action.

Reimplemented from core_ai\aiactions\base.


The documentation for this class was generated from the following file: