Skip to content

Commit aa2cf44

Browse files
committed
modified prompt for more variety in generated items
1 parent 71aac56 commit aa2cf44

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

Backend/Sources/Core/PromptBuilder.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ import Foundation
22

33
public struct PromptBuilder {
44
public static func prompt(countryName: String?) -> String {
5-
let localized: String
5+
let location: String
66
if let countryName {
7-
localized = "in the country of \(countryName)"
7+
location = "in the country of \(countryName)"
88
} else {
9-
localized = "anywhere in the world"
9+
location = "somewhere in the world"
1010
}
1111
return
12-
"random food item popular \(localized), in the style of Overcooked"
12+
"""
13+
Create an image of one randomly chosen prepared dish, snack, pastry, or street food
14+
that is genuinely eaten \(location), in the style of Overcooked, transparent background.
15+
Favor specific regional, city, market, bakery, holiday, breakfast, dessert, or
16+
home-cooked foods over the first national stereotype. Show exactly one hero item;
17+
no combo meals, side dishes, drinks, menus, flags, labels, or text.
18+
Avoid defaulting to globally common fast food such as hamburgers, fries, pizza, or hot dogs
19+
unless the subject is a distinctive named local variation.
20+
"""
1321
}
1422
}

SPEC.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ Rules:
142142
- Build the public `url`.
143143
- When budget remains:
144144
- Generate a fresh unique image key.
145-
- Build the prompt as a single random dish popular in the request country.
145+
- Build the prompt as one randomly chosen prepared dish, snack, pastry, or street food genuinely eaten in the request country.
146146
- Include a normalized `-{country-slug}` suffix in the generated key when country lookup succeeds.
147-
- Instruct the model to prefer specific, visually distinct local dishes over generic national defaults, and to avoid repeatedly defaulting to globally common fast food unless it is genuinely the random choice.
147+
- Instruct the model to prefer specific regional, city, market, bakery, holiday, breakfast, dessert, or home-cooked foods over the first national stereotype.
148+
- Instruct the model to show exactly one hero food item with no combo meals, side dishes, drinks, menus, flags, labels, or text.
149+
- Instruct the model to avoid defaulting to globally common fast food such as hamburgers, fries, pizza, or hot dogs unless the subject is a distinctive named local variation.
148150
- Fall back to the same prompt structure scoped to somewhere in the world when the client IP or country cannot be resolved.
149151
- Call the OpenAI image generation API with model `gpt-image-1.5`.
150152
- Upload the PNG to the generated image key used for the dated generation pool.
@@ -194,6 +196,7 @@ The implementation is considered complete when:
194196
- The backend returns `200` only after a fresh image upload succeeds or a random fallback image has been selected.
195197
- When the daily budget is exhausted, the backend returns a random existing generated image instead of making a new OpenAI request.
196198
- Fresh generations use the request origin country in the prompt when the server can resolve it from the client IP, and otherwise fall back to the generic worldwide prompt.
199+
- Fresh generation prompts ask for one specific, non-stereotyped hero food item and discourage generic fast-food defaults and combo meals.
197200
- Fresh generations include a country slug suffix in the image key when the request country is known.
198201
- When the daily budget is exhausted, fallback selection prefers existing images whose keys match the current request country and otherwise falls back to any existing image.
199202
- The backend persists deterministic daily per-page cache keys separately from the dated generation pool.

0 commit comments

Comments
 (0)