Skip to content

Commit

Permalink
adds docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Feb 3, 2025
1 parent b4a6558 commit 29689a5
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 8 deletions.
File renamed without changes.
47 changes: 40 additions & 7 deletions docs/docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
]
Expand All @@ -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.
69 changes: 69 additions & 0 deletions docs/docs/plugins/transformers/gpt-transform.md
Original file line number Diff line number Diff line change
@@ -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}"
}
}
}
```
71 changes: 71 additions & 0 deletions docs/docs/plugins/transformers/simple-transform.md
Original file line number Diff line number Diff line change
@@ -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})"
}
}
}
14 changes: 13 additions & 1 deletion docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
],
},
],
};
Expand Down

0 comments on commit 29689a5

Please sign in to comment.