Ogre with purple bandaids and a temper that leaves crushed bones and broken dreams in its wake.
A simple database of AI-generated monsters.
Monster Collector is a simple web application to create a database of AI-generated monsters.
Monster names and descriptions are generated by the AI large language model (LLM) Cohere. Generated monsters are added to a table displayed on the page and saved to a local database. When generating a new monster, a custom prompt may be used to alter the type of monster created. The custom prompt is appended to the default prompt and allows customizing the type of generation from the LLM.
The table of monsters utilizes the contenteditable
HTML attribute to allow inline editing of monster details. An ajax call triggers the save to an API method on the backend.
All data changes are saved in an audit log with the history stored in the database. Audit history is available by hovering your mouse over any row in the table.
Install the required libraries in VSCode before running the project.
- Open a Terminal in VSCode.
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
dotnet tool install --global dotnet-ef
- Create a file
Monster Collector/.env
with the contents:CohereApiKey=<YOUR_API_KEY> OpenAIApiKey=<YOUR_API_KEY>
You can register a Cohere API key here.
You can register an OpenAI API key here.
To re-generate the monsters in the database, use the following steps.
- Delete the files
MonsterManager.sqlite
,MonsterManager.sqlite-shm
,MonsterManager.sqlite-wal
.
To re-generate the entire database, use the following steps.
- Delete the folder
Migrations
. dotnet ef migrations add InitialCreate
dotnet ef database update
Monsters that are generated by the LLM can be customized to almost any style by entering a custom prompt in the textbox provided. The custom prompt is appended onto the standard prompt used by the program when generating monsters.
Example 1: "A beautiful rainbow monster that is friendly and happy."
Example 2: "An extremely dramatic monster constructed from fancy fabrics from around the world."
Returns details for a specific monster by Id. The Id can be found in the table row data-id
HTML attribute.
Updates a specific monster by Id and payload.
Generate a new monster.
Deletes a specific monster by Id.
- Visual Studio Code
- C# .NET 8.0
- MVC
- Razor
- EntityFramework
- Sqlite
- LLM Cohere and OpenAI
MIT
Kory Becker http://www.primaryobjects.com/kory-becker