Skip to content

humanmade/wp-ai-workbench

Repository files navigation

AI WorkBench for WordPress

  • Create 'Prompts'. A specific instruction provided to an AI model (ChatGPT) to generate a desired output.
  • Create 'System Prompts' and assign to prompts. A set of instructions shared by many prompts. E.g. the editorial style guide or guidance on tone of voice.
  • Create 'Contexts'. Additional information to be passed with your prompt. Supports the following types:
    • Query results. Build a query that is run and the results get passed along with your prompt. e.g. latest posts within a category.

Supports placeholders (in prompts, system prompts and contexts). When executing a prompt, pass data to replace any placeholders. Allows you to create generic prompts and context queries so you can generate different results by passing different data.

Features

AI Content Block

Currently experimental. Define AI_WORKBENCH_DISABLE_BLOCKS to true to enable.

The AI Content block provides an editorial interface for inserting AI Content.

  • Select from available prompts in the block settings sidebar
  • Generate AI content directly in the block editor
  • Review and accept updated content.

Usage

$data = [ 'tag_name' => 'trump', 'tag_label' => 'Donald Trump' ];
$result = AI_Workbench\Prompts\run( $prompt, $data );
// $result is an array containing:
// - 'result': The AI-generated content
// - 'prompt': The full prompt WP_Post object
// - 'generated_at': Timestamp when generated
// - 'prompt_id': The prompt post ID
echo $result['result']; // Output the AI result

Setup

Add either Open AI key or AWS Bedrock credentials in the settings page, and pick from available models.

About

WordPress AI Workbench. Create prompts and provide content as context.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors