Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions allPlugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"metaImage": "img/social/calendar-craft.jpg",
"metaDescription": "Calendar is an effective event management and calendaring plugin. Its user-friendly interface simplifies the creation of events with complex recurring rules and exclusions."
},
{
"name": "AI Assistant",
"slug": "/craft/ai-assistant",
"latestVersionSlug": "/craft/ai-assistant/v1",
"metaImage": "img/social/ai-assistant-craft.jpg",
"metaDescription": "AI Assistant is a plugin that helps you create content with AI. It's a tool that helps you create content with AI."
},
{
"name": "Express Forms",
"slug": "https://discontinued-docs.solspace.com/express-forms",
Expand Down
5 changes: 5 additions & 0 deletions craft-ai-assistant/configuration/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Configuration",
"position": 3
}

37 changes: 37 additions & 0 deletions craft-ai-assistant/configuration/integrations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
sidebar_position: 2
---

# Integrations

AI Assistant supports multiple AI providers. Configure your integrations to enable AI-powered content generation.

## Supported Providers

- **OpenAI** - GPT models (GPT-4, GPT-3.5, etc.)
- **Google Gemini** - Gemini models
- **Anthropic** - Claude models
- **xAI** - Grok models
- **Replicate** - Various AI models

## Setting Up an Integration

1. Go to **AI Assistant → Integrations**
2. Click **New Integration**
3. Choose provider (OpenAI, Gemini, Anthropic, xAI, Replicate)
4. Set API key, model, and defaults
5. Save and test

## Integration Settings

Each integration can be configured with:

- **Enable/Disable** - Toggle the integration on or off
- **API Key** - Your provider's API key
- **Model Selection** - Choose which model to use
- **Default Settings** - Set default parameters for the integration

## Testing Integrations

After configuring an integration, you can test it using the Quick AI Actions widget or by using the inline AI button on any enabled field.

32 changes: 32 additions & 0 deletions craft-ai-assistant/configuration/prompts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
sidebar_position: 3
---

# Prompts

Prompts are the instructions you give to the AI to generate content. AI Assistant includes built-in prompts and allows you to create custom prompts.

## Built-in Prompts

AI Assistant comes with several built-in prompts for common content generation tasks. These prompts are ready to use and can be customized.

## Custom Prompts

1. Go to **AI Assistant → Prompts**
2. Click **New Prompt**
3. Enter a name and prompt text
4. Optionally bind the prompt to a specific integration
5. Set sort order
6. Save

## Prompt Binding

You can bind a prompt to a specific integration. When a prompt is bound to an integration:

- That integration will be used automatically when the prompt is selected
- The prompt will only appear when that integration is enabled

## Sort Order

Prompts can be ordered to appear in your preferred sequence. Set a sort order value (lower numbers appear first) to organize your prompts.

34 changes: 34 additions & 0 deletions craft-ai-assistant/configuration/settings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
sidebar_position: 1
---

# Settings

AI Assistant settings allow you to configure which fields show the inline AI button and set up field-specific prompts.

## Field Enablement

1. Go to **AI Assistant → Settings**
2. Toggle which fields show the inline AI button
3. Save

## Field-Specific Prompts

You can preselect a prompt for each enabled field so the Generate modal opens with the right context:

1. Go to **AI Assistant → Settings**
2. In the "Field Prompts" table, choose a prompt per field (or keep "Any")
3. Save Settings

### Behavior on Entry Edit Pages

- When you click the inline AI button, the modal will auto-select the field's prompt.
- This works for Craft fields (Plain Text, CKEditor, Redactor, TinyMCE, Assets) and for the built-in Title field (handle `title`).
- For Title specifically, the modal reads the selection from plugin settings, so it's honored even though Title isn't a custom Craft field.

### Notes

- Choosing "Any" means the modal won't preselect a specific prompt.
- If a prompt is bound to a particular integration, that integration is used automatically; otherwise the selected integration is used.
- Changes you make to the selected prompt inside an entry are not saved back to Settings; edit the mapping in **AI Assistant → Settings**.

5 changes: 5 additions & 0 deletions craft-ai-assistant/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "User Guides",
"position": 4
}

88 changes: 88 additions & 0 deletions craft-ai-assistant/guides/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
sidebar_position: 1
---

# Getting Started

This guide will help you get started with AI Assistant for Craft CMS.

## Installation

1. Require the package: `composer require solspace/craft-aiassistant`
2. In Craft CP → Plugins, install "AI Assistant"
3. Configure providers in **AI Assistant → Integrations**
4. Enable fields in **AI Assistant → Settings**

## Configuration

### Setting Up Integrations

1. Go to **AI Assistant → Integrations**
2. Click **New Integration**
3. Choose provider (OpenAI, Gemini, Anthropic, xAI, Replicate), set API key, model, and defaults
4. Save and test

### Enabling Fields

1. Go to **AI Assistant → Settings**
2. Toggle which fields show the inline AI button
3. Save

### Configuring Prompts

1. Go to **AI Assistant → Prompts**
2. Create custom prompts or view built-in prompts
3. Optionally bind a prompt to a specific integration

### Field-Specific Prompts

You can preselect a prompt for each enabled field so the Generate modal opens with the right context:

1. Go to **AI Assistant → Settings**
2. In the "Field Prompts" table, choose a prompt per field (or keep "Any")
3. Save Settings

## Usage

### Using the Inline AI Button

1. Open any entry with enabled fields; an inline AI button appears inside the input area
2. Click the button to open the modal
3. Pick a prompt, edit "Prompt Text" as needed
4. Optionally enable "Include input context"
5. Generate and review in the right column; Insert replaces the field's content

### Quick AI Actions Widget

- Add the "AI Assistant Quick Actions" widget on the dashboard
- Select a prompt, edit "Prompt Text," Generate, and Copy as needed

## API Endpoints

- `GET /admin/ai-assistant/api/integrations`
- `GET /admin/ai-assistant/api/prompts`
- `POST /admin/ai-assistant/api/generate-text`
- `POST /admin/ai-assistant/api/generate-image` (coming soon)

## File Structure

```
aiassistant/
├── src/
│ ├── assets/ # JS/CSS + AssetBundle
│ ├── controllers/ # CP + API endpoints
│ ├── models/ # Integration, Prompt, Settings
│ ├── records/ # ActiveRecord for DB tables
│ ├── services/ # Business logic + helpers
│ ├── Integrations/ # Providers (OpenAI, Gemini, …)
│ ├── templates/ # Twig (modal, widget, CP screens)
│ ├── AiAssistant.php # Main plugin class
│ ├── icon-mask.svg
│ └── icon.svg
└── composer.json
```

## Support

For issues and feature requests, please contact Solspace.

Loading