Famous people: admin page, own prompt, one photo, public pages
- Admin "Híres emberek": birth data, one photo (S3: DigitalOcean Spaces in production, RustFS in development), a face point that every crop keeps in view, publishing, and a detailed portrait written with its own `celebrity` prompt (third person, by name, from the chart alone). - The photo is stored once (upright JPEG, at most 2000 px, no metadata); next/image makes the sizes from it, so Cloudflare can cache those. - Public list and pages (/hires-emberek), in the sitemap, with a share image showing the face and the chart. - Share images: the wheel's glyphs and numbers are drawn with the card's fonts (inside the SVG image they came out as boxes, on every card). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -427,6 +427,39 @@ mod analyses {
|
||||
}
|
||||
}
|
||||
|
||||
#[sqlx::test(migrator = "db::MIGRATOR")]
|
||||
async fn writes_a_famous_persons_analysis_with_their_name(db: PgPool) {
|
||||
let s = setup(&db).await;
|
||||
sqlx::query("UPDATE charts SET kind = 'celebrity', is_primary = false WHERE id = $1")
|
||||
.bind(s.chart)
|
||||
.execute(&db)
|
||||
.await
|
||||
.unwrap();
|
||||
sqlx::query("INSERT INTO celebrities (id, chart_id, name, slug) VALUES ($1, $2, 'Teszt Elek', 'teszt-elek')")
|
||||
.bind(Uuid::now_v7())
|
||||
.bind(s.chart)
|
||||
.execute(&db)
|
||||
.await
|
||||
.unwrap();
|
||||
let id = request_analysis(&db, &s).await;
|
||||
sqlx::query("UPDATE analyses SET kind = 'celebrity', credits_charged = 0 WHERE id = $1")
|
||||
.bind(id)
|
||||
.execute(&db)
|
||||
.await
|
||||
.unwrap();
|
||||
let (fake, url) = fake_openrouter(vec![reply(&content(Kind::Celebrity))]).await;
|
||||
let a = analyzer(&db, &url);
|
||||
assert!(a.claim(Lane::Quick).await.unwrap().is_none(), "not in the quick lane");
|
||||
assert!(run_once(&a).await);
|
||||
assert_eq!(row(&db, id).await.0, "done");
|
||||
let requests = fake.requests.lock().unwrap();
|
||||
let system = requests[0]["messages"][0]["content"].as_str().unwrap();
|
||||
let user = requests[0]["messages"][1]["content"].as_str().unwrap();
|
||||
assert!(system.contains("harmadik személyben"));
|
||||
assert!(user.starts_with("Képletadatok:\n\nNév: Teszt Elek\n\n") && user.contains("- Sun: Pisces"));
|
||||
assert_eq!(requests[0]["response_format"]["json_schema"]["name"], "celebrity_analysis");
|
||||
}
|
||||
|
||||
#[sqlx::test(migrator = "db::MIGRATOR")]
|
||||
async fn uses_the_admin_edited_system_prompt(db: PgPool) {
|
||||
let s = setup(&db).await;
|
||||
|
||||
Reference in New Issue
Block a user