Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "TheSexy6BotWorker",
"name": "TheSexy6BotWorker (Debug)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/TheSexy6BotWorker/bin/Debug/net9.0/TheSexy6BotWorker.dll",
"program": "${workspaceFolder}/src/dotnet/TheSexy6BotWorker/bin/Debug/net9.0/TheSexy6BotWorker.dll",
"args": [],
"cwd": "${workspaceFolder}/TheSexy6BotWorker",
"cwd": "${workspaceFolder}/src/dotnet/TheSexy6BotWorker",
"console": "integratedTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "neverOpen",
Expand All @@ -20,8 +20,10 @@
},
"requireExactSource": false,
"env": {
"LOCAL_DEV": "true"
"DOTNET_ENVIRONMENT": "Development",
"Mcp__Enabled": "true",
"Mcp__StrictStartup": "false"
}
}
]
}
}
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/TheSexy6BotWorker/TheSexy6BotWorker.csproj",
"${workspaceFolder}/src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -18,4 +18,4 @@
}
}
]
}
}
67 changes: 61 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A Discord bot built as a .NET 9.0 Worker Service that integrates multiple AI mod
- Rate limiting during high activity (5+ messages in 15 seconds)
- **Semantic Kernel Plugins**:
- Weather data via Open-Meteo API (no API key required)
- Web search via Perplexity API
- Tavily direct API tools (`tavily_search`, `tavily_extract`, `tavily_crawl`, `tavily_map`)
- **Threaded Conversations**: Reply chain context (up to 10 messages deep)
- **Dynamic Status**: Bot updates Discord status with witty AI-generated messages (batched, rate-limited)
- **Local Development Mode**: Run with test command prefixes for safe testing
Expand Down Expand Up @@ -95,7 +95,7 @@ Grok's engagement mode personality:
- API keys for:
- Google AI Gemini
- X.AI Grok
- Perplexity
- Tavily
- (Optional) Docker for containerized deployment

## Setup Instructions
Expand All @@ -121,8 +121,8 @@ dotnet user-secrets --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csp
# Set X.AI Grok API key
dotnet user-secrets --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj set "GrokKey" "your-grok-api-key"

# Set Perplexity API key
dotnet user-secrets --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj set "PerplexityApiKey" "your-perplexity-api-key"
# Set Tavily API key
dotnet user-secrets --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj set "TavilyApiKey" "your-tavily-api-key"
```

**User Secrets ID**: `dotnet-TheSexy6BotWorker-d23e68fa-7622-4b43-ac67-735c9cf191f4`
Expand Down Expand Up @@ -158,6 +158,7 @@ In Discord:
- `grok <message>` - Chat with Grok AI (starts engagement session)
- `ping` - Test bot responsiveness
- `/ping` - DSharpPlus slash command
- `/tools` or `/plugins` - List callable Kernel tools

### Engagement Mode Usage

Expand All @@ -180,6 +181,49 @@ DOTNET_ENVIRONMENT=Development dotnet run --project src/dotnet/TheSexy6BotWorker

Commands become: `test-gemini`, `test-grok`, `test-ping`

### OpenTelemetry + Aspire Dashboard (Standalone)

The worker exports logs, traces, and metrics using OTLP (`AddOtlpExporter`).

Start the Aspire Dashboard locally:

```bash
docker run --rm -it -d \
-p 18888:18888 \
-p 4317:18889 \
-p 4318:18890 \
--name aspire-dashboard \
mcr.microsoft.com/dotnet/aspire-dashboard:latest
```

Run the bot (it will export to OTLP defaults, including `http://localhost:4317` for gRPC):

```bash
dotnet run --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj
```

Open the dashboard UI at `http://localhost:18888`.

Optional explicit exporter settings:

```bash
# Bash/Linux
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
dotnet run --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj

# PowerShell
$env:OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"
$env:OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
dotnet run --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj
```

Disable OTEL temporarily:

```bash
OTEL_SDK_DISABLED=true dotnet run --project src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj
```

## Testing

```bash
Expand All @@ -195,6 +239,17 @@ dotnet test --filter "FullyQualifiedName~ConversationSession"
dotnet test --filter "FullyQualifiedName~Markdown"
```

Tavily integration tests are live-network and opt-in:

```bash
# Enable live Tavily API tests + provide key
RUN_TAVILY_LIVE_TESTS=true \
TAVILY_API_KEY=tvly-your-key \
dotnet test --filter "FullyQualifiedName~TavilyApiIntegrationTests"
```

`TavilyApiIntegrationTests` also accepts `TavilyApiKey` from user secrets and `TAVILY_API_ENDPOINT` to override the default endpoint (`https://api.tavily.com`).

## Docker Build and Deployment

### Local Docker Build
Expand All @@ -209,7 +264,7 @@ docker build -t thesexy6bot:latest .
docker run -e DiscordToken="your-token" \
-e GeminiKey="your-key" \
-e GrokKey="your-key" \
-e PerplexityApiKey="your-key" \
-e TavilyApiKey="your-key" \
thesexy6bot:latest
```

Expand Down Expand Up @@ -280,7 +335,7 @@ var md = new ObjectMarkdownBuilder<Config>(config)
| `DiscordToken` | Discord bot token | Yes |
| `GeminiKey` | Google AI Gemini API key | Yes |
| `GrokKey` | X.AI Grok API key | Yes |
| `PerplexityApiKey` | Perplexity API key | Yes |
| `TavilyApiKey` | Tavily API key | Yes |
| `DOTNET_ENVIRONMENT` | Set to `Development` to enable test command prefixes | No |

## Key Dependencies
Expand Down
4 changes: 4 additions & 0 deletions TheSexy6BotWorker.slnx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<Solution>
<Folder Name="/Solution Items/" />
<Folder Name="/src/" />
<Folder Name="/src/dotnet/">
<Project Path="src/dotnet/TheSexy6BotWorker.Tests/TheSexy6BotWorker.Tests.csproj" />
</Folder>
<Project Path="src/dotnet/TheSexy6BotWorker/TheSexy6BotWorker.csproj" />
</Solution>

This file was deleted.

This file was deleted.

Loading
Loading