You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/Abilities/Title_Generation/Title_Generation.php
+26-47Lines changed: 26 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,6 @@
23
23
*/
24
24
class Title_Generation extends Abstract_Ability {
25
25
26
-
/**
27
-
* The default number of candidates to generate.
28
-
*
29
-
* @since 0.1.0
30
-
*
31
-
* @var int
32
-
*/
33
-
protectedconstCANDIDATES_DEFAULT = 3;
34
-
35
26
/**
36
27
* {@inheritDoc}
37
28
*
@@ -41,21 +32,14 @@ protected function input_schema(): array {
41
32
returnarray(
42
33
'type' => 'object',
43
34
'properties' => array(
44
-
'content'=> array(
35
+
'content' => array(
45
36
'type' => 'string',
46
37
'description' => esc_html__( 'Content to generate title suggestions for.', 'ai' ),
47
38
),
48
-
'context'=> array(
39
+
'context' => array(
49
40
'type' => 'string',
50
41
'description' => esc_html__( 'Additional context to use when generating title suggestions. This can either be a string of additional context or can be a post ID that will then be used to get context from that post (if it exists). If no content is provided but a valid post ID is used here, the content from that post will be used.', 'ai' ),
51
42
),
52
-
'candidates' => array(
53
-
'type' => 'integer',
54
-
'minimum' => 1,
55
-
'maximum' => 10,
56
-
'default' => self::CANDIDATES_DEFAULT,
57
-
'description' => esc_html__( 'Number of titles to generate', 'ai' ),
58
-
),
59
43
),
60
44
);
61
45
}
@@ -69,12 +53,9 @@ protected function output_schema(): array {
69
53
returnarray(
70
54
'type' => 'object',
71
55
'properties' => array(
72
-
'titles' => array(
73
-
'type' => 'array',
74
-
'description' => esc_html__( 'Generated title suggestions.', 'ai' ),
75
-
'items' => array(
76
-
'type' => 'string',
77
-
),
56
+
'title' => array(
57
+
'type' => 'string',
58
+
'description' => esc_html__( 'Generated title suggestion.', 'ai' ),
78
59
),
79
60
),
80
61
);
@@ -90,9 +71,8 @@ protected function execute_callback( $input ) {
90
71
$args = wp_parse_args(
91
72
$input,
92
73
array(
93
-
'content' => null,
94
-
'context' => null,
95
-
'candidates' => self::CANDIDATES_DEFAULT,
74
+
'content' => null,
75
+
'context' => null,
96
76
),
97
77
);
98
78
@@ -130,30 +110,25 @@ protected function execute_callback( $input ) {
0 commit comments