Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b9917b5
Add the base Summarization Experiment code
dkotter Dec 4, 2025
82bdbcf
Add the base Summarization Ability code
dkotter Dec 4, 2025
eb8e4e6
Add the system instructions for the Summarization Ability
dkotter Dec 4, 2025
7544a40
Modify a bit our post context Ability and helper function to return '…
dkotter Dec 4, 2025
47df6e4
Add tests
dkotter Dec 4, 2025
72a97e0
Revert changes to the get-post-details ability and instead remove emp…
dkotter Dec 4, 2025
da233f9
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Dec 10, 2025
8bd5d6a
Allow passing in extra data when our system instructions are loaded
dkotter Dec 10, 2025
6824c04
Allow choosing the summary length, from short, medium or long and pas…
dkotter Dec 10, 2025
009f2c0
Dynamically set the expected return length depending on the passed in…
dkotter Dec 10, 2025
b56d200
Update tests
dkotter Dec 10, 2025
d186657
Pull the content out of the context so we can separate those a bit mo…
dkotter Dec 10, 2025
97ef7f9
Change from a post_id field to a context field. Only add context to o…
dkotter Dec 10, 2025
fd1a81c
Update tests
dkotter Dec 10, 2025
42834c7
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Dec 12, 2025
a7a64e7
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Dec 18, 2025
f720320
Merge branch 'develop' into feature/content-summarization-experiment
jeffpaul Dec 20, 2025
04c543a
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Dec 23, 2025
5a49eae
Merge branch 'feature/content-summarization-experiment' of github.com…
dkotter Dec 23, 2025
2b7b217
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Dec 23, 2025
00fdd9b
Turn off sniff
dkotter Dec 23, 2025
c97bd2e
Use xml to deliminate content and context instead of markdown and tri…
dkotter Jan 2, 2026
0ebf538
Fix Plugin Check warnings
dkotter Jan 2, 2026
e5f4411
Remove direct access prevention code from helpers.php as it seems to …
dkotter Jan 2, 2026
bacc79f
Merge branch 'develop' into feature/content-summarization-experiment
jeffpaul Jan 7, 2026
6e11966
Merge branch 'develop' into feature/content-summarization-experiment
jeffpaul Jan 12, 2026
70f9280
Merge branch 'develop' into feature/content-summarization-experiment
dkotter Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Plugin Check warnings
  • Loading branch information
dkotter committed Jan 2, 2026
commit 0ebf5389a465b981f83dd2fe0fed137d90c3e0ff
7 changes: 6 additions & 1 deletion includes/Abilities/Summarization/system-instruction.php
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should clarify the data structure for the model to expect, and make it clear that the content is being summarized, while the context should be considered.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I've pulled the content out of the context now so those are more obviously separated: d186657

We'll also likely want to make this same change for the Title Generation Experiment but I can do that in a separate PR

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* @package WordPress\AI\Abilities\Summarization
*/

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

// Determine the length from the passed in global.
Expand All @@ -17,7 +22,7 @@
}
}

// phpcs:ignore Squiz.PHP.Heredoc.NotAllowed
// phpcs:ignore Squiz.PHP.Heredoc.NotAllowed, PluginCheck.CodeAnalysis.Heredoc.NotAllowed
return <<<INSTRUCTION
You are an editorial assistant that generates concise, factual, and neutral summaries of long-form content. Your summaries support both inline readability (e.g., top-of-post overview) and structured metadata use cases (search previews, featured cards, accessibility tools).

Expand Down
5 changes: 5 additions & 0 deletions includes/Abilities/Utilities/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

use WP_Error;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Post utility WordPress Abilities.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

use WordPress\AI\Abstracts\Abstract_Experiment;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Reference experiment demonstrating hooks and REST endpoints.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
use WordPress\AI\Abilities\Excerpt_Generation\Excerpt_Generation as Excerpt_Generation_Ability;
use WordPress\AI\Abstracts\Abstract_Experiment;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Excerpt generation experiment.
*
Expand Down
5 changes: 5 additions & 0 deletions includes/Experiments/Image_Generation/Image_Generation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
use WordPress\AI\Abilities\Image\Import_Base64_Image as Image_Import_Ability;
use WordPress\AI\Abstracts\Abstract_Experiment;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Image generation experiment.
*
Expand Down
5 changes: 5 additions & 0 deletions includes/Experiments/Summarization/Summarization.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
use WordPress\AI\Abilities\Summarization\Summarization as Summarization_Ability;
use WordPress\AI\Abstracts\Abstract_Experiment;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Content summarization experiment.
*
Expand Down
5 changes: 5 additions & 0 deletions includes/Experiments/Title_Generation/Title_Generation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
use WordPress\AI\Abstracts\Abstract_Experiment;
use WordPress\AI\Asset_Loader;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Title generation experiment.
*
Expand Down
5 changes: 5 additions & 0 deletions includes/Settings/Settings_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
use function WordPress\AI\has_ai_credentials;
use function WordPress\AI\has_valid_ai_credentials;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Manages the admin settings page for AI experiments.
*
Expand Down
5 changes: 5 additions & 0 deletions includes/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
use Throwable;
use WordPress\AI_Client\AI_Client;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Normalizes the content by cleaning it and removing unwanted HTML tags.
*
Expand Down
Loading