Add AI writing assistant plugin with local backend, brave search, and image generation support
- Implement local backend AI provider with Ollama integration - Add Brave Search API integration for real-time search suggestions - Add image generation manager with multiple AI providers - Create hybrid provider system with local/cloud fallback - Add comprehensive settings UI with provider management - Implement Gutenberg sidebar with writing assistance controls - Add SEO schema generation for AI-generated content - Multiple provider support: OpenRouter, local backend, Codex
This commit is contained in:
@@ -318,8 +318,9 @@ class WP_Agentic_Writer_Settings {
|
||||
public function sanitize_settings( $input ) {
|
||||
$sanitized = array();
|
||||
|
||||
// Sanitize API key (don't strip tags, but trim).
|
||||
// Sanitize API keys (don't strip tags, but trim).
|
||||
$sanitized['openrouter_api_key'] = trim( $input['openrouter_api_key'] ?? '' );
|
||||
$sanitized['brave_search_api_key'] = trim( $input['brave_search_api_key'] ?? '' );
|
||||
|
||||
// Sanitize model names (6 models as per model-preset-brief.md).
|
||||
$sanitized['chat_model'] = sanitize_text_field( $input['chat_model'] ?? 'google/gemini-2.5-flash' );
|
||||
@@ -392,6 +393,7 @@ class WP_Agentic_Writer_Settings {
|
||||
|
||||
// Extract settings (6 models as per model-preset-brief.md).
|
||||
$api_key = $settings['openrouter_api_key'] ?? '';
|
||||
$brave_api_key = $settings['brave_search_api_key'] ?? '';
|
||||
$chat_model = $settings['chat_model'] ?? 'google/gemini-2.5-flash';
|
||||
$clarity_model = $settings['clarity_model'] ?? 'google/gemini-2.5-flash';
|
||||
$planning_model = $settings['planning_model'] ?? 'google/gemini-2.5-flash';
|
||||
@@ -1029,7 +1031,7 @@ class WP_Agentic_Writer_Settings {
|
||||
planning: 'google/gemini-2.5-flash',
|
||||
writing: 'mistralai/mistral-small-creative',
|
||||
refinement: 'google/gemini-2.5-flash',
|
||||
image: 'openai/gpt-4o'
|
||||
image: 'black-forest-labs/flux.2-klein'
|
||||
},
|
||||
balanced: {
|
||||
chat: 'google/gemini-2.5-flash',
|
||||
@@ -1037,7 +1039,7 @@ class WP_Agentic_Writer_Settings {
|
||||
planning: 'google/gemini-2.5-flash',
|
||||
writing: 'anthropic/claude-3.5-sonnet',
|
||||
refinement: 'anthropic/claude-3.5-sonnet',
|
||||
image: 'openai/gpt-4o'
|
||||
image: 'sourceful/riverflow-v2-max'
|
||||
},
|
||||
premium: {
|
||||
chat: 'google/gemini-3-flash-preview',
|
||||
@@ -1045,7 +1047,7 @@ class WP_Agentic_Writer_Settings {
|
||||
planning: 'google/gemini-3-flash-preview',
|
||||
writing: 'openai/gpt-4.1',
|
||||
refinement: 'openai/gpt-4.1',
|
||||
image: 'openai/gpt-4o'
|
||||
image: 'black-forest-labs/flux.2-max'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user