Skip to content

AI Content Re-writer Integration #1

Description

@harshankur

Summary

Add an AI-powered rewriting feature to the Inscript editor that allows users to polish, summarize, or change the tone of their blog posts using local (Ollama) or cloud-based (OpenAI, Claude) LLMs.

Purpose

To streamline the editing process by providing built-in tools for:

  • Improving grammar and flow.
  • Changing tone (e.g., Professional, Casual, Academic).
  • Summarizing long sections.
  • Generating SEO-friendly descriptions from content.

Proposed Features

  • Provider Support:
    • Ollama: For local-first, private processing (no API key required, just a local URL).
    • OpenAI/Claude/OpenRouter: Via standard API key configuration.
  • Contextual Actions: A floating toolbar button or a "Sparkle" icon in the Tiptap editor that appears when text is selected.
  • Preview Diff: A side-by-side or "Proposed" view where users can see the AI's changes before accepting them.
  • Custom Prompts: Ability to provide a custom instruction (e.g., "Rewrite this like a 1920s detective").

Technical Considerations

Backend (server.js)

  • Add a new /api/ai/rewrite endpoint.
  • Implement a provider-agnostic interface to handle different API schemas.
  • Use environment variables (.env) for storing API keys and preferred provider settings.

Frontend (src/App.jsx)

  • Create a new Tiptap extension or use a custom modal for AI interactions.
  • Add a configuration UI in the settings for selecting the AI provider and entering keys.

Deployment Environment

  • Ensure the feature respects the Docker environment (e.g., linking to host.docker.internal:11434 for Ollama).

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions