Skip to content

Commit

Permalink
Merge pull request #9 from bozp-pzob/feature-configs
Browse files Browse the repository at this point in the history
Feature configs
  • Loading branch information
bozp-pzob authored Feb 25, 2025
2 parents 7ab37a7 + 7b40c51 commit 9f49ec3
Show file tree
Hide file tree
Showing 32 changed files with 5,177 additions and 390 deletions.
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ TWITTER_EMAIL= # Account email
DISCORD_APP_ID=
DISCORD_TOKEN=
CODEX_API_KEY= # Market Data
```

## GitHub Actions Secrets Single File
Expand All @@ -82,7 +84,8 @@ DISCORD_TOKEN=
"SITE_NAME": "",
"DISCORD_APP_ID": "",
"DISCORD_TOKEN": "",
"BIRDEYE_API_KEY": ""
"BIRDEYE_API_KEY": "",
"CODEX_API_KEY": "",
}
```

Expand All @@ -94,28 +97,36 @@ DISCORD_TOKEN=
# Development mode
npm run dev

# Development mode using the sources.json config
npm run dev -- --source=sources.json

# Build and run production
npm run build
npm start

# Generate daily summary
npm run generator

# Generate daily summary for specific date
npm run generator --date=2025-01-01

# Grab Historical Data from sources ( default 60 days )
npm run historical

# Grab Historical Data from sources ( Specific number of days )
npm run historical --day=10
# Grab Historical Data for specific date from the sources.json config
npm run historical -- --source=sources.json --date=2025-01-01


# Grab Historical Data for specific date range from the sources.json config
npm run historical -- --source=sources.json --after=2025-01-01 --before=2025-01-06

# Grab Historical Data for after specific date from the sources.json config
npm run historical -- --source=sources.json --after=2025-01-01

# Grab Historical Data for before specific date from the sources.json config //Limited to Jan 1, 2024
npm run historical -- --source=sources.json --before=2025-01-01
```

## Project Structure

```
config/ # JSON-Based Configuration System
src/
├── aggregator/ # Core aggregation logic
├── aggregator/ # Core aggregation logic
├── plugins/
│ ├── ai/ # AI provider implementations
│ ├── enrichers/ # Content enrichment plugins
Expand All @@ -124,15 +135,14 @@ src/
│ └── storage/ # Database storage handlers
├── types.ts # TypeScript type definitions
├── index.ts # Main application entry
└── generator.ts # Summary generator entry
└── historical.ts # Grab historical data entry
└── historical.ts # Grab historical data entry and Generate Summary on Historical Data
```

## Adding New Sources

1. Implement the `ContentSource` interface
2. Add configuration in `index.ts`
3. Register the source with the aggregator
2. Add configuration in JSON config
3. Run System

Example:
```typescript
Expand All @@ -142,6 +152,9 @@ class NewSource implements ContentSource {
async fetchItems(): Promise<ContentItem[]> {
// Implementation
}
async fetchHistorical(date:string): Promise<ContentItem[]> {
// Implementation for historical fetching if source allows
}
}
```

Expand Down Expand Up @@ -221,6 +234,7 @@ Daily summaries are stored in JSON files with this structure:
### Cryptocurrency Analytics
- Token price monitoring (Solana)
- Market data from CoinGecko
- Market data from Codex
- Trading metrics and volume data

## Scheduled Tasks
Expand Down Expand Up @@ -249,7 +263,8 @@ DISCORD_APP_ID= # Discord application ID
DISCORD_TOKEN= # Bot token
# Analytics
BIRDEYE_API_KEY= # Optional: For Solana token analytics
BIRDEYE_API_KEY= # Optional: For Solana token analytics
CODEX_API_KEY= # Optional: Alternate way to pull any token
```

## Storage
Expand Down
117 changes: 117 additions & 0 deletions config/ai16zdao.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"settings": {
"runOnce": true
},
"sources": [
{
"type": "TwitterSource",
"name": "twitter",
"interval": 1800000,
"params": {
"username": "process.env.TWITTER_USERNAME",
"password": "process.env.TWITTER_PASSWORD",
"email": "process.env.TWITTER_EMAIL",
"accounts": ["daosdotfun", "ai16zdao", "shawmakesmagic"]
}
},
{
"type": "DiscordChannelSource",
"name": "discordChannel",
"interval": 360000,
"params": {
"botToken": "process.env.DISCORD_TOKEN",
"channelIds": ["1326603270893867064"],
"provider": "summaryOpenAiProvider"
}
},
{
"type": "DiscordAnnouncementSource",
"name": "discordAnnouncement",
"interval": 3600000,
"params": {
"botToken": "process.env.DISCORD_TOKEN",
"channelIds": ["1299473809166045357"]
}
},
{
"type": "GitHubDataSource",
"name": "elizaGithub",
"interval": 21600000,
"params": {
"contributorsUrl": "https://raw.githubusercontent.com/elizaOS/elizaos.github.io/refs/heads/main/data/daily/contributors.json",
"summaryUrl": "https://raw.githubusercontent.com/elizaOS/elizaos.github.io/refs/heads/main/data/daily/summary.json",
"historicalContributorUrl": "https://raw.githubusercontent.com/elizaOS/elizaos.github.io/refs/heads/main/data/daily/history/contributors_<year>_<month>_<day>.json",
"historicalSummaryUrl": "https://raw.githubusercontent.com/elizaOS/elizaos.github.io/refs/heads/main/data/daily/history/summary_<year>_<month>_<day>.json",
"githubCompany": "elizaOS",
"githubRepo": "eliza"
}
},
{
"type": "CodexAnalyticsSource",
"name": "codexAnalytics",
"interval": 43200000,
"params": {
"apiKey": "process.env.CODEX_API_KEY",
"tokenAddresses": ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599","HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC","So11111111111111111111111111111111111111112"]
}
}
],
"ai": [
{
"type": "OpenAIProvider",
"name": "summaryOpenAiProvider",
"params": {
"apiKey": "process.env.OPENAI_API_KEY",
"model": "openai/chatgpt-4o-latest",
"temperature": 0,
"useOpenRouter": true,
"siteUrl": "process.env.SITE_URL",
"siteName": "process.env.SITE_NAME"
}
},
{
"type": "OpenAIProvider",
"name": "miniOpenAiProvider",
"params": {
"apiKey": "process.env.OPENAI_API_KEY",
"model": "openai/gpt-4o-mini",
"temperature": 0,
"useOpenRouter": true,
"siteUrl": "process.env.SITE_URL",
"siteName": "process.env.SITE_NAME"
}
}
],
"enrichers": [
{
"type": "AiTopicsEnricher",
"name": "topicEnricher",
"params": {
"provider": "miniOpenAiProvider",
"thresholdLength": 30
}
}
],
"storage": [
{
"type": "SQLiteStorage",
"name": "SQLiteStorage",
"params": {
"dbPath": "data/db.sqlite"
}
}
],
"generators": [
{
"type": "DailySummaryGenerator",
"name": "DailySummaryGenerator",
"interval": 3600000,
"params": {
"provider": "summaryOpenAiProvider",
"storage": "SQLiteStorage",
"summaryType": "dailySummary",
"source": "aiSummary"
}
}
]
}
75 changes: 75 additions & 0 deletions config/sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"settings": {
"runOnce": true,
"onlyFetch": false
},
"sources": [
{
"type": "CodexAnalyticsSource",
"name": "codexAnalytics",
"interval": 43200000,
"params": {
"apiKey": "process.env.CODEX_API_KEY",
"tokenAddresses": ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599","HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC","So11111111111111111111111111111111111111112"]
}
}
],
"ai": [
{
"type": "OpenAIProvider",
"name": "summaryOpenAiProvider",
"params": {
"apiKey": "process.env.OPENAI_API_KEY",
"model": "openai/chatgpt-4o-latest",
"temperature": 0,
"useOpenRouter": true,
"siteUrl": "process.env.SITE_URL",
"siteName": "process.env.SITE_NAME"
}
},
{
"type": "OpenAIProvider",
"name": "miniOpenAiProvider",
"params": {
"apiKey": "process.env.OPENAI_API_KEY",
"model": "openai/gpt-4o-mini",
"temperature": 0,
"useOpenRouter": true,
"siteUrl": "process.env.SITE_URL",
"siteName": "process.env.SITE_NAME"
}
}
],
"enrichers": [
{
"type": "AiTopicsEnricher",
"name": "topicEnricher",
"params": {
"provider": "miniOpenAiProvider",
"thresholdLength": 30
}
}
],
"storage": [
{
"type": "SQLiteStorage",
"name": "SQLiteStorage",
"params": {
"dbPath": "data/db.sqlite"
}
}
],
"generators": [
{
"type": "DailySummaryGenerator",
"name": "DailySummaryGenerator",
"interval": 3600000,
"params": {
"provider": "summaryOpenAiProvider",
"storage": "SQLiteStorage",
"summaryType": "dailySummary",
"source": "aiSummary"
}
}
]
}
1 change: 1 addition & 0 deletions html/client/public/mask.gltf

Large diffs are not rendered by default.

Loading

0 comments on commit 9f49ec3

Please sign in to comment.