Imported from CREAsTIVE/MikoGPT (
AGENTS.md). Install upstream withnpx skills add CREAsTIVE/MikoGPT. Copyright stays with the author.
AGENTS.md
Workspace Rules
- Main workspace:
D:\dev\projects\MikoGPT - Keep heavy downloads, package caches, generated artifacts, and build output on
D:where possible. - Do not rely on SSH from sandboxed tooling.
- Never add real credentials to tracked files.
- Prefer
rg/rg --filesfor searches.
Project Orientation
- Solution:
MikoGPT.sln - Main project:
MikoGPT/MikoGPT.csproj - Target framework:
.NET 8 - This repo has been trimmed to the main bot. Historical prototypes were removed from the cleaned history.
Main Entry Points
MikoGPT/Program.cs: thin process entry point.MikoGPT/Hosting/BotHost.cs: application startup, VK/Telegram loop wiring, config, services, and model API setup.MikoGPT/Messenger/IBotMessage.cs,IBotContext.cs: platform-agnostic message and send-context abstractions.MikoGPT/Messenger/Vk/*: VK-specific routing, long polling, inline keyboard, VK script, API extensions, and VK runtime glue.MikoGPT/Messenger/Telegram/*: Telegram routing, polling, message/context adapters.MikoGPT/Services/*: startup helpers for web interface and console commands.MikoGPT/Config.cs: config schema and environment variable overrides.MikoGPT/config.example.json: safe non-secret sample config.MikoGPT/Database.cs: JSON document persistence for chats, users, and stored code blocks.MikoGPT/Web/*: minimalHttpListenerweb API/static file responses.MikoGPT/apis/*andMikoGPT/ImageApis/*: model and image API adapters.
Configuration
MikoGPT/config.jsonis ignored and local-only.- Use
MikoGPT/config.example.jsonas the non-secret template. - Secrets should come from environment variables:
MIKOGPT_VK_API_KEY— VK community API key (optional; VK disabled if absent)MIKOGPT_OPENAI_API_KEYS— comma-separated OpenAI-compatible keysMIKOGPT_TELEGRAM_BOT_TOKEN— Telegram bot token (optional; Telegram disabled if absent)
- Runtime data and generated API keys are ignored:
MikoGPT/database/MikoGPT/datadase/MikoGPT/keys.json
Dependency Style
- Prefer service registration in
BotHost.BuildContainer()using Autofac. - Prefer constructor injection for app services:
public SomeConsumer(SomeService someService)
{
this.someService = someService;
}
- Avoid static service access for runtime dependencies. Register services in
BotHost.BuildContainer()and inject them directly.
Build Notes
Use:
dotnet restore .\MikoGPT.sln
dotnet build .\MikoGPT.sln
Recovery Direction
- Preserve behavior first; avoid broad rewrites until the main bot can build and run.
- When changing model integrations, hide them behind
IChatCompletion/LanguageModelrather than scattering API calls throughProgram.cs. - Add small tests around serialization and routing before migrating model APIs.