How to get Varied Naming in Response

I’m using the chat completion API to generate names for Dungeons and Dragons shops for an app I’m making and I noticed that the generated names always start with “The”. I don’t mind some starting like that, but I don’t want all of the them starting that way. This is my current prompt:

Suggest 5 Dungeons and Dragons shops with the name and type as a JSON array of objects in the following format: {“shops”: [{ “name”: “The name of the shop”, “type”: “The type of shop (Blacksmith, Apothecary, Armorer, etc)” }]}

As an example, these are some of the names I get back:

  1. The Dragon’s Hoard
  2. The Alchemical Emporium
  3. The Shielded Haven
  4. The Enchanted Scroll
  5. The Arcane Forge

If I add something like “The names shouldn’t all start with ‘The’”, then none of the shops start that way, which isn’t what I want either. Is there a way I can find a middle ground where some names start with “The” and others don’t?

Let’s code this for the AI. gpt-3.5-turbo-0301 because it is not as dumb.

System:

You are a dungeon master’s AI assistant.

User:

"""
I host a Dungeons and Dragons game. I need AI-generated names for the stores and shops in a town where players can purchase items, total 50 store numbers (store number are not output).
"""

# shop naming
if store_number % 4:
    store name begins with "The"
if store_number % 3:
    store name is only a one-word name

# output object specification
{
    "shops": [
        {
            "name": "str",
            "type": "str"
        },
        ...
    ]
}

Response (finish_reason: 999 tokens):

{
    "shops": [
        {
            "name": "The Gilded Hammer",
            "type": "Blacksmith"
        },
        {
            "name": "Arcanum",
            "type": "Magic Shop"
        },
        {
            "name": "The Silver Chalice",
            "type": "Tavern"
        },
        {
            "name": "The Rusty Anchor",
            "type": "General Store"
        },
        {
            "name": "Mystique",
            "type": "Jewelry Store"
        },
        {
            "name": "The Parchment Scroll",
            "type": "Bookstore"
        },
        {
            "name": "The Emerald Flask",
            "type": "Alchemy Shop"
        },
        {
            "name": "Bounty",
            "type": "Hunting Store"
        },
        {
            "name": "The Soaring Eagle",
            "type": "Inn"
        },
        {
            "name": "The Crimson Shield",
            "type": "Armory"
        },
        {
            "name": "Sundries",
            "type": "General Store"
        },
        {
            "name": "The Golden Quill",
            "type": "Scribe Shop"
        },
        {
            "name": "The Mystic's Eye",
            "type": "Divination Shop"
        },
        {
            "name": "The Laughing Dragon",
            "type": "Tavern"
        },
        {
            "name": "Enchantress",
            "type": "Magic Shop"
        },
        {
            "name": "The Sturdy Oak",
            "type": "Carpentry Shop"
        },
        {
            "name": "The Prancing Pony",
            "type": "Stable"
        },
        {
            "name": "Gems",
            "type": "Jewelry Store"
        },
        {
            "name": "The Wandering Minstrel",
            "type": "Music Store"
        },
        {
            "name": "The Silent Whisper",
            "type": "Thieves' Guild"
        },
        {
            "name": "The Shining Beacon",
            "type": "Temple"
        },
        {
            "name": "Elixirs",
            "type": "Potion Shop"
        },
        {
            "name": "The Hungry Wolf",
            "type": "Butcher Shop"
        },
        {
            "name": "The Silver Loom",
            "type": "Tailor Shop"
        },
        {
            "name": "Majesty",
            "type": "Royal Court"
        },
        {
            "name": "The Iron Fist",
            "type": "Fighter's Guild"
        },
        {
            "name": "The Gentle Touch",
            "type": "Healer's Guild"
        },
        {
            "name": "The Arcane Library",
            "type": "Mage's Guild"
        },
        {
            "name": "The Lucky Horseshoe",
            "type": "Stable"
        },
        {
            "name": "The Singing Siren",
            "type": "Tavern"
        },
        {
            "name": "The Jade Serpent",
            "type": "Exotic Goods Store"
        },
        {
            "name": "The Celestial Compass",
            "type": "Navigation Shop"
        },
        {
            "name": "The Copper Kettle",
            "type": "Cookware Store"
        },
        {
            "name": "The Swift Arrow",
            "type": "Fletcher Shop"
        },
        {
            "name": "The Crystal Ball",
            "type": "Divination Shop"
        },
        {
            "name": "The Feathered Quiver",
            "type": "Archery Store"
        },
        {
            "name": "The Siren's Song",
            "type": "Bard's College"
        },
        {
            "name": "The Fiery Forge",
            "type": "Blacksmith"
        },
        {
            "name": "The Worn Tome",
            "type": "Bookstore"
        },
        {
            "name": "The Royal Jewel",
            "type": "Jewelry Store"
        },
        {
            "name": "The Glistening Scale",
            "type": "Armory"
        },
        {
            "name": "The Golden Apple",
            "type": "Fruit Stand"
        },
        {
            "name": "The Crescent Moon",
            "type": "Inn"
        },
        {
            "name": "The Woven Basket",
            "type": "Weaver's Shop"
        },
        {
            "name

A sample from gpt-4 which might simulate the math better, or get the idea.


Sure, here are the names and types of 50 stores and shops in the town:

```json
{
    "shops": [
        {
            "name": "The Gilded Griffin",
            "type": "Blacksmith"
        },
        {
            "name": "Frostfire",
            "type": "Magic Shop"
        },
        {
            "name": "The Prancing Pony",
            "type": "Tavern"
        },
        {
            "name": "Moonstone",
            "type": "Jewelry Store"
        },
        {
            "name": "The Cursed Scroll",
            "type": "Bookstore"
        },
        {
            "name": "Dragonhide",
            "type": "Leather Goods Store"
        },
        {
            "name": "The Wandering Wyvern",
            "type": "Inn"
        },
        {
            "name": "Starfall",
            "type": "Apothecary"
        },
        {
            "name": "The Shimmering Shield",
            "type": "Armory"
        },
        {
            "name": "Mystic",
            "type": "Occult Shop"
        },
       

I threw another factor in to consider, but you can just use one mod %, and then also include an index key in your json for counting as the output is produced.

1 Like

Hey so I was using the system and user prompts in the above post and it was working great for the longest time, but randomly now the responses I’m getting are not good. For one, if I ask it to generate 1 shop, it’ll sometimes give me 1, or 3, or 5, or maybe even 10. I explicitly have the number of shops it should generate in the prompt, yet it doesn’t abide by that. Also, it keeps generating the exact same types of shop names like 80% of the time. For some reason, it won’t stop giving me “The Adventurer’s Emporium”, “The Arcane Emporium”, or “The Enchanted Emporium”. I’m really not sure what’s suddenly made this prompt start giving such inconsistent (or I guess consistent) results.