Skip to content

Commit 1b0b2d9

Browse files
committed
feat(location): add new Restaurant Galeria
1 parent 40869e0 commit 1b0b2d9

File tree

11 files changed

+253
-1
lines changed

11 files changed

+253
-1
lines changed

.github/workflows/site.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
shell: bash
9595
run: |
9696
mkdir -p tmp-data
97-
for loc in $(ls -1 data | grep -v galeria);
97+
for loc in $(ls -1 data);
9898
do
9999
jq '.offers = inputs' data/${loc}/details.json <(jq -s 'reduce .[] as $item ({}; . * $item)' data/${loc}/2*.json) > tmp-data/merged_${loc}.json
100100
done

data/galeria/details.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Restaurant Galeria",
3+
"link": "https://galeria-restaurant.de/standorte/",
4+
"offers": {},
5+
"details": ["inkl. Softdrink", "Kartenzahlung ja"]
6+
}

locations/galeria/config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
config = {
2+
"userImageFile": "image.jpg",
3+
"userMessage": """Extract the JSON containing the meal offers from the following image of a week menu in table layout.
4+
5+
Also keep following in mind:
6+
- Clean up each meal name and remove all line breaks and special characters and add commas and "und" where necessary.
7+
- All meals have the same price stated inside the image.
8+
- This menu has no week offers
9+
10+
These points are most important before you finally create the JSON and shall be revised:
11+
- did you leave out the correct dates and are they actually empty. you cannot add a meal to a date which is a holiday but do not forget to add all meals to the date
12+
- did you add all dates to the JSON
13+
14+
Explain if you leave out a day, but not for Saturday and Sunday!
15+
""",
16+
"max_tokens": 2000
17+
}
18+
prompt_overrides = {
19+
"addCurrentDate": True,
20+
"model_provider": "google",
21+
"visionModel": "gemini-2.0-flash"
22+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os, sys, inspect
2+
sys.path.append(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + '/../.shared')
3+
from DefaultMealChat import DefaultMealChat
4+
from config import config, prompt_overrides
5+
6+
# Create an instance of DefaultMealChat
7+
meal_chat = DefaultMealChat(
8+
**config,
9+
promptOverrides=prompt_overrides)
10+
11+
meal_chat.processImageAndWriteToFile()
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"2025-03-31": [
3+
{
4+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen!",
5+
"price": 13.95
6+
}
7+
],
8+
"2025-04-01": [
9+
{
10+
"desc": "Hackfleischbällchen, Paprikasauce, Butter-Gemüsereis und Cole Slaw",
11+
"price": 13.95
12+
}
13+
],
14+
"2025-04-02": [
15+
{
16+
"desc": "Käsespätzle, Röstzwiebeln und Beilagensalat",
17+
"price": 13.95
18+
}
19+
],
20+
"2025-04-03": [
21+
{
22+
"desc": "Hähnchen \"Korma\", Paprika und Butternudeln",
23+
"price": 13.95
24+
}
25+
],
26+
"2025-04-04": [
27+
{
28+
"desc": "Seelachsfilet im Kräutermantel, Brokkoli und Kartoffeln",
29+
"price": 13.95
30+
}
31+
],
32+
"2025-04-07": [
33+
{
34+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen!",
35+
"price": 13.95
36+
}
37+
],
38+
"2025-04-08": [
39+
{
40+
"desc": "Hühnerfrikassee, Reis und Farmersalat",
41+
"price": 13.95
42+
}
43+
],
44+
"2025-04-09": [
45+
{
46+
"desc": "Asia-Wok-Pfanne, Asia-Gemüse, Mienudeln und Teriyaki-Sauce",
47+
"price": 13.95
48+
}
49+
],
50+
"2025-04-10": [
51+
{
52+
"desc": "Schweinebraten, Bratensauce, Honig-Pastinake und Salzkartoffeln",
53+
"price": 13.95
54+
}
55+
],
56+
"2025-04-11": [
57+
{
58+
"desc": "Fish & Chips, Remouladensauce und Gurkensalat",
59+
"price": 13.95
60+
}
61+
],
62+
"2025-04-14": [
63+
{
64+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen!",
65+
"price": 13.95
66+
}
67+
],
68+
"2025-04-15": [
69+
{
70+
"desc": "Königsberger Klopse, Kapernsauce und Reis",
71+
"price": 13.95
72+
}
73+
],
74+
"2025-04-16": [
75+
{
76+
"desc": "Hähnchen-Geschnetzeltes, Champignons und Spätzle",
77+
"price": 13.95
78+
}
79+
],
80+
"2025-04-17": [
81+
{
82+
"desc": "Pfeffersteak vom Schwein, Leipziger Allerlei und Bratkartoffeln",
83+
"price": 13.95
84+
}
85+
],
86+
"2025-04-18": [],
87+
"2025-04-21": [],
88+
"2025-04-22": [
89+
{
90+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen!",
91+
"price": 13.95
92+
}
93+
],
94+
"2025-04-23": [
95+
{
96+
"desc": "Ofen-Gnocchi, Käsesauce, Blattspinat und Krautsalat",
97+
"price": 13.95
98+
}
99+
],
100+
"2025-04-24": [
101+
{
102+
"desc": "Nürnberger Würstchen, Bratensauce, Sauerkraut und Kartoffelstampf",
103+
"price": 13.95
104+
}
105+
],
106+
"2025-04-25": [
107+
{
108+
"desc": "Pazifisches Buttfilet in Petersilienpanade, Remouladensauce, Blattspinat und Petersilienkartoffeln",
109+
"price": 13.95
110+
}
111+
],
112+
"2025-04-28": [
113+
{
114+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen!",
115+
"price": 13.95
116+
}
117+
],
118+
"2025-04-29": [
119+
{
120+
"desc": "Hähnchenbrust, Zwiebelsauce, Blattspinat und Kartoffeln",
121+
"price": 13.95
122+
}
123+
],
124+
"2025-04-30": [
125+
{
126+
"desc": "Pasta \"Spinaci\", Spinat-Kirschtomaten-Sahnesauce, Grana Padano und Beilagensalat",
127+
"price": 13.95
128+
}
129+
],
130+
"2025-05-01": [],
131+
"2025-05-02": [
132+
{
133+
"desc": "Seelachs, Kräutersauce, Brokkoli und Reis",
134+
"price": 13.95
135+
}
136+
]
137+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"completion_tokens": 1398,
3+
"prompt_tokens": 4309,
4+
"total_tokens": 5707
5+
}

tests/galeria/image.jpg

596 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"2025-04-21": [],
3+
"2025-04-22": [
4+
{
5+
"desc": "Küchenchef-Tag, Lassen Sie sich überraschen",
6+
"price": 13.95
7+
}
8+
],
9+
"2025-04-23": [
10+
{
11+
"desc": "Ofen-Gnocchi, Käsesauce, Blattspinat, Krautsalat",
12+
"price": 13.95
13+
}
14+
],
15+
"2025-04-24": [
16+
{
17+
"desc": "Nürnberger Würstchen, Bratensauce, Sauerkraut, Kartoffelstampf",
18+
"price": 13.95
19+
}
20+
],
21+
"2025-04-25": [
22+
{
23+
"desc": "Pazifisches Buttfilet in Petersilienpanade, Remouladensauce, Blattspinat, Petersilienkartoffeln",
24+
"price": 13.95
25+
}
26+
]
27+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"completion_tokens": 302,
3+
"completion_tokens_details": {
4+
"accepted_prediction_tokens": 0,
5+
"audio_tokens": 0,
6+
"reasoning_tokens": 0,
7+
"rejected_prediction_tokens": 0
8+
},
9+
"prompt_tokens": 1990,
10+
"prompt_tokens_details": {
11+
"audio_tokens": 0,
12+
"cached_tokens": 0
13+
},
14+
"total_tokens": 2292
15+
}

tests/galeria/test_chatgpt.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import unittest
2+
import os, sys, inspect
3+
sys.path.append(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + '/../../locations/.shared')
4+
sys.path.append(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + '/../../locations/' + os.path.basename(os.path.dirname(inspect.getfile(inspect.currentframe()))))
5+
from DefaultMealChat import DefaultMealChat
6+
from config import config, prompt_overrides
7+
from testconfig import testconfig
8+
9+
class TestRatskeller(unittest.TestCase):
10+
def test_process_chatgpt(self):
11+
test_cases = [
12+
{"prompt_override": {"model_provider": "openai", "visionModel": "gpt-4o-2024-08-06"}},
13+
{"prompt_override": {"model_provider": "google", "visionModel": "gemini-2.0-flash"}},
14+
]
15+
16+
for case in test_cases:
17+
with self.subTest(case=case):
18+
# Create an instance of DefaultMealChat
19+
meal_chat = DefaultMealChat(
20+
**config,
21+
**testconfig,
22+
promptOverrides={**prompt_overrides, **case["prompt_override"]}
23+
)
24+
25+
meal_chat.processImageAndWriteToFile()

0 commit comments

Comments
 (0)