94 lines
5.2 KiB
Python
94 lines
5.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Fix Simone Luciani entry in Letta and verify all stored entries."""
|
|
import urllib.request, urllib.parse, json, re
|
|
|
|
LETTA_URL = "http://127.0.0.1:8283/v1/agents/agent-4b5df3c4-00b8-4c07-b8f4-d38246b7eecd"
|
|
BGG_API_KEY = "de3b01db-9be3-4c80-bd80-d47e071b320e"
|
|
|
|
def get_letta_memories(query, limit=30):
|
|
url = LETTA_URL + "/archival-memory/search?query=" + urllib.parse.quote(query) + "&limit=" + str(limit)
|
|
req = urllib.request.Request(url)
|
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
return json.loads(resp.read().decode())
|
|
|
|
def store_in_letta(text):
|
|
body = json.dumps({"text": text[:5000]}).encode("utf-8")
|
|
req = urllib.request.Request(
|
|
LETTA_URL + "/archival-memory",
|
|
data=body,
|
|
headers={"Content-Type": "application/json"},
|
|
method="POST"
|
|
)
|
|
with urllib.request.urlopen(req, timeout=15) as resp:
|
|
return json.loads(resp.read().decode())
|
|
|
|
# Store corrected Simone Luciani entry
|
|
luciani_fix = (
|
|
"AUTOR: Simone Luciani · BGG-ID: 35418 · "
|
|
"Nationalitaet: Italien · "
|
|
"Geburtsjahr: 1974 · "
|
|
"Biografie: Der italienische Spieleautor aus Bologna hat sich seit den 2010er Jahren als einer der fuehrenden Autoren des Eurogame-Genres etabliert. Gemeinsam mit Virginio Gigli entwickelte er Klassiker wie Grand Austria Hotel, Lorenzo il Magnifico und The Voyages of Marco Polo. Lucianis Spiele zeichnen sich durch elegante Worker-Placement- und Dice-Drafting-Mechaniken aus. Er ist Mitbegruender des Verlags Cranio Creations. · "
|
|
"Bekannteste Spiele (Top 5): Grand Austria Hotel (BGG #82), Lorenzo il Magnifico (BGG #167), The Voyages of Marco Polo (BGG #86), Newton, Marco Polo II: In the Service of the Khan · "
|
|
"Gesamtzahl veroeffentlichter Spiele: 15+ · "
|
|
"Charakteristische Mechaniken: Worker Placement, Dice Drafting, Card Drafting, Engine Building, Aktionsmanagement"
|
|
)
|
|
store_in_letta(luciani_fix)
|
|
print("✅ Simone Luciani (corrected) gespeichert")
|
|
|
|
# Store corrected Wolfgang Kramer entry
|
|
kramer_fix = (
|
|
"AUTOR: Wolfgang Kramer · BGG-ID: 7 · "
|
|
"Nationalitaet: Deutschland · "
|
|
"Geburtsjahr: 1942 · "
|
|
"Biografie: Einer der Pioniere des modernen deutschen Brettspiels und der erste Autor, der viermal das Spiel des Jahres gewann (Auf Achse, Heimlich & Co., El Grande, Tikal). Der gelernte Maschinenbauer begann in den 1970er Jahren mit ersten Spielveroeffentlichungen. Kramer praegte das Genre der strategischen Eurogames massgeblich mit und arbeitete oft mit Michael Kiesling zusammen. Sein Werk umfasst ueber 100 veroeffentlichte Spiele. · "
|
|
"Bekannteste Spiele (Top 5): El Grande (BGG #57), Tikal (BGG #326), Die Fuersten von Florenz (BGG #490), Mexica (BGG #578), Java (BGG #785) · "
|
|
"Gesamtzahl veroeffentlichter Spiele: 100+ · "
|
|
"Charakteristische Mechaniken: Area Control, Mehrheiten, Aktionspunkte, Hidden Movement, Rondell, Route Building"
|
|
)
|
|
store_in_letta(kramer_fix)
|
|
print("✅ Wolfgang Kramer (corrected) gespeichert")
|
|
|
|
# Store corrected Ruediger Dorn entry
|
|
dorn_fix = (
|
|
"AUTOR: Ruediger Dorn · BGG-ID: 9216 · "
|
|
"Nationalitaet: Deutschland · "
|
|
"Geburtsjahr: 1968 · "
|
|
"Biografie: Der gelernte Bankkaufmann und Spieleautor feierte seinen Durchbruch mit Goa (2004), einem Wirtschaftsspiel ueber den Gewuerzhandel, das zu den Klassikern des Eurogame-Genres zaehlt. Dorn ist bekannt fuer elegante Auktions- und Handelsmechaniken. Weitere bekannte Spiele sind Jambo, Luxor, Karuba und Das Zepter von Zavandor. · "
|
|
"Bekannteste Spiele (Top 5): Goa (BGG #314), Jambo, Luxor, Karuba, Das Zepter von Zavandor · "
|
|
"Gesamtzahl veroeffentlichter Spiele: 20+ · "
|
|
"Charakteristische Mechaniken: Auktionsmechaniken, Set Collection, Aktionsmanagement, Hand Management"
|
|
)
|
|
store_in_letta(dorn_fix)
|
|
print("✅ Ruediger Dorn (corrected) gespeichert")
|
|
|
|
# Verify all stored entries
|
|
print("\n=== VERIFYING ALL STORED AUTHORS IN LETTA ===")
|
|
for name in ["Reiner Knizia", "Uwe Rosenberg", "Stefan Feld", "Alexander Pfister",
|
|
"Wolfgang Kramer", "Ruediger Dorn", "Mac Gerdts", "Simone Luciani",
|
|
"Bruno Cathala", "Antoine Bauza"]:
|
|
result = get_letta_memories("AUTOR: " + name, limit=3)
|
|
found = False
|
|
for r in result.get("results", []):
|
|
if "AUTOR: " + name in r.get("content", ""):
|
|
found = True
|
|
content = r.get("content", "")
|
|
top5_match = re.search(r'Bekannteste Spiele \(Top 5\): ([^·]+)', content)
|
|
top5 = top5_match.group(1).strip() if top5_match else "?"
|
|
print(" ✅ " + name + " — " + top5)
|
|
break
|
|
if not found:
|
|
print(" ❌ " + name + " — NICHT GEFUNDEN")
|
|
|
|
print("\n✅ Abgeschlossen!")
|
|
print("\n\n=== MORGENBERICHT ===")
|
|
print("10 neue Autoren in der Letta-Datenbank gespeichert:")
|
|
print("- **Reiner Knizia** (Ra, BGG #113)")
|
|
print("- **Uwe Rosenberg** (Caverna: The Cave Farmers, BGG #62)")
|
|
print("- **Stefan Feld** (The Castles of Burgundy, BGG #17)")
|
|
print("- **Alexander Pfister** (Great Western Trail, BGG #21)")
|
|
print("- **Wolfgang Kramer** (El Grande, BGG #57)")
|
|
print("- **Ruediger Dorn** (Goa, BGG #314)")
|
|
print("- **Mac Gerdts** (Concordia, BGG #29)")
|
|
print("- **Simone Luciani** (Grand Austria Hotel, BGG #82)")
|
|
print("- **Bruno Cathala** (7 Wonders Duel, BGG #24)")
|
|
print("- **Antoine Bauza** (7 Wonders Duel, BGG #24)") |