diff --git a/docs/docs/plugins/telegram.md b/docs/docs/plugins/distributors/telegram.md similarity index 100% rename from docs/docs/plugins/telegram.md rename to docs/docs/plugins/distributors/telegram.md diff --git a/docs/docs/plugins/index.md b/docs/docs/plugins/index.md index 939a470..f2d5a0e 100644 --- a/docs/docs/plugins/index.md +++ b/docs/docs/plugins/index.md @@ -6,26 +6,45 @@ sidebar_position: 0 curate.fun supports various plugins that extend its functionality, particularly for content distribution. Each plugin enables you to distribute curated content to different platforms and channels. -## Available Plugins +## Plugin Structure -### [šŸ“± Telegram Plugin](./telegram.md) +Plugins are defined in two parts in your `curate.config.json`: -Distribute curated content to Telegram channels and topics. +1. Plugin Registration: -## Plugin Structure +```json +{ + "plugins": { + "@curatedotfun/telegram": { + "type": "distributor", + "url": "./external/telegram" + }, + "@curatedotfun/gpt-transform": { + "type": "transformer", + "url": "./external/gpt-transform" + } + } +} +``` -Each plugin follows a consistent configuration structure in your `curate.config.json`: +2. Plugin Usage in Feeds: ```json { "outputs": { "stream": { "enabled": true, + "transform": { + "plugin": "@curatedotfun/gpt-transform", + "config": { + // Transformer-specific configuration + } + }, "distribute": [ { - "plugin": "@curatedotfun/[plugin-name]", + "plugin": "@curatedotfun/telegram", "config": { - // Plugin-specific configuration + // Distributor-specific configuration } } ] @@ -35,3 +54,17 @@ Each plugin follows a consistent configuration structure in your `curate.config. ``` Select a plugin from the sidebar to view its detailed configuration and setup instructions. + +## Available Plugins + +### [šŸ“± Telegram Plugin](./distributors/telegram.md) + +Distribute curated content to Telegram channels and topics. + +### [šŸ¤– GPT Transform](./transformers/gpt-transform.md) + +Transform content using OpenRouter's GPT models for AI-powered content enhancement. + +### [šŸ“ Simple Transform](./transformers/simple-transform.md) + +Format content using a template-based approach with customizable placeholders. \ No newline at end of file diff --git a/docs/docs/plugins/transformers/gpt-transform.md b/docs/docs/plugins/transformers/gpt-transform.md new file mode 100644 index 0000000..d01277f --- /dev/null +++ b/docs/docs/plugins/transformers/gpt-transform.md @@ -0,0 +1,69 @@ +--- +sidebar_position: 2 +--- + +# šŸ¤– GPT Transform Plugin + +The GPT Transform plugin enables AI-powered content transformation using OpenRouter's API and GPT models. + +## šŸ”§ Setup Guide + +1. Define the plugin in your `curate.config.json`: + + ```json + { + "plugins": { + "@curatedotfun/gpt-transform": { + "type": "transformer", + "url": "./external/gpt-transform" + } + } + } + ``` + +2. Add the transformer to a feed's output stream or recap: + + ```json + { + "feeds": [ + { + "id": "your-feed", + "outputs": { + "stream": { + "enabled": true, + "transform": { + "plugin": "@curatedotfun/gpt-transform", + "config": { + "prompt": "Your system prompt here", + "apiKey": "{OPENROUTER_API_KEY}" + } + }, + "distribute": [ + // Your distributors here + ] + } + } + } + ] + } + ``` + + :::info + The `{OPENROUTER_API_KEY}` has already been configured in the deployed environment and will get injected at runtime. + ::: + +### Example Configuration + +Here's an example that transforms content into a news-style format: + +```json +{ + "transform": { + "plugin": "@curatedotfun/gpt-transform", + "config": { + "prompt": "You are a helpful assistant that summarizes content in a news-style format...", + "apiKey": "{OPENROUTER_API_KEY}" + } + } +} +``` diff --git a/docs/docs/plugins/transformers/simple-transform.md b/docs/docs/plugins/transformers/simple-transform.md new file mode 100644 index 0000000..346511e --- /dev/null +++ b/docs/docs/plugins/transformers/simple-transform.md @@ -0,0 +1,71 @@ +--- +sidebar_position: 2 +--- + +# šŸ“ Simple Transform Plugin + +The Simple Transform plugin provides basic text transformation using a template-based approach with placeholders. + +## šŸ”§ Setup Guide + +1. Define the plugin in your `curate.config.json`: + + ```json + { + "plugins": { + "@curatedotfun/simple-transform": { + "type": "transformer", + "url": "./external/simple-transform" + } + } + } + ``` + +2. Add the transformer to a feed's output stream: + + ```json + { + "feeds": [ + { + "id": "your-feed", + "outputs": { + "stream": { + "enabled": true, + "transform": { + "plugin": "@curatedotfun/simple-transform", + "config": { + "format": "šŸ“ {CONTENT}\nCurated by @{CURATOR}" + } + }, + "distribute": [ + // Your distributors here + ] + } + } + } + ] + } + ``` + +### Available Placeholders + +The format string supports the following placeholders: + +- `{CONTENT}`: The original content +- `{CURATOR}`: The curator's username +- `{CURATOR_NOTES}`: Any notes added by the curator +- `{SUBMISSION_ID}`: The submission ID + +### Example Configuration + +Here's a real example from the cryptofundraise feed: + +```json +{ + "transform": { + "plugin": "@curatedotfun/simple-transform", + "config": { + "format": "šŸ“ new fundraising announcement, curated by *{CURATOR}*\n{CONTENT}\nšŸ“Œ source: [View Post](https://x.com/x/status/{SUBMISSION_ID})" + } + } +} diff --git a/docs/sidebars.ts b/docs/sidebars.ts index acccf11..5f8bd79 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -34,7 +34,19 @@ const sidebars: SidebarsConfig = { { type: "category", label: "Plugins", - items: ["plugins/telegram"], + items: [ + "plugins/index", + { + type: "category", + label: "Distributors", + items: ["plugins/distributors/telegram"] + }, + { + type: "category", + label: "Transformers", + items: ["plugins/transformers/gpt-transform", "plugins/transformers/simple-transform"] + } + ], }, ], };