Skip to content
Subset

For developers

Developer reference

The provider seam, the prompt filter, and where generated content is stored so another plugin can find it.

The provider seam

A provider is a small object: it takes a prompt and returns text, or throws. Which one is used is a setting, and adding one is a registration rather than a patch.

<?php
// PLACEHOLDER — interface name, method signature and action name are not final.
add_action( 'subset_content_builder_register_providers', function ( $registry ) {
	$registry->add( 'local-llama', new My_Local_Llama_Provider() );
} );

The interface stays deliberately narrow. Streaming, function calling and tool use are all things a provider might support and the editor does not ask for, because the editor’s job is “put text in this block” and every capability the interface grows is a capability every provider then has to implement or stub.

Planned for 1.2.0Changelog

Third-party providers are planned for after the first release. Until then the provider list is fixed and the free version uses your own key against it.

Filtering the prompt

Everything sent to a provider passes through one filter. That is intentional: one place to audit, one place to redact, one place to add a house style.

<?php
// PLACEHOLDER — filter name and context shape are not final.
add_filter(
	'subset_content_builder_prompt',
	function ( string $prompt, array $context ): string {
		// Never let a draft mention a competitor by name.
		return $prompt . "\n\nDo not name any company other than ours.";
	},
	10,
	2
);

Where generated content lives

Generations are WordPress revisions, which means they are revision post-type rows parented to the post, and every existing revision API works on them.

<?php
// This part is not a placeholder: it is the WordPress API, and it works today.
$revisions = wp_get_post_revisions( $post_id );

A meta key marking which revisions came from a generation (placeholder — not final) is planned, so that an editorial workflow plugin can tell a generated draft from a human edit. Until it exists, the two are indistinguishable, which is worth knowing if you are building a review queue.

What will deliberately not be extensible

There is no hook that publishes a post. Generation produces a draft revision and stops. An action that skips the editor is the one request we will refuse, because the whole premise of the plugin is that a person reads the thing before it goes out.

Hosted credits are not a provider you can register. The Pro add-on’s hosted generation runs against our own account with our own bill attached, and the seam for it is not a public one.

The free version’s promise, in code terms

Worth stating precisely, because “free forever” is a claim that needs a mechanism behind it: the free plugin makes requests from your server to your provider using your key. There is no call to any subset.dev endpoint in a generation path, no telemetry attached to a prompt, and no licence check gating a generation. If you find one, that is a bug and a serious one — please open an issue.

github.com/function-form/subset/issues (opens in a new tab)