Never show which AI model writes the analyses
The model name was in the public config, in every analysis response, in /v1/credits, on the packages page and in the example page data. Admins still see it in the prompt trials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -130,7 +130,6 @@ pub async fn credits(State(state): St, auth: AuthUser) -> ApiResult<Json<Value>>
|
|||||||
.await?;
|
.await?;
|
||||||
Ok(Json(json!({
|
Ok(Json(json!({
|
||||||
"balance": balance.view(),
|
"balance": balance.view(),
|
||||||
"analysis_model": state.config.analysis_model,
|
|
||||||
"ledger": ledger.into_iter().map(|(id, unit, delta, reason, analysis_id, note, at)| json!({
|
"ledger": ledger.into_iter().map(|(id, unit, delta, reason, analysis_id, note, at)| json!({
|
||||||
"id": id, "unit": unit, "delta": delta, "reason": reason,
|
"id": id, "unit": unit, "delta": delta, "reason": reason,
|
||||||
"analysis_id": analysis_id, "note": note, "created_at": rfc3339(at),
|
"analysis_id": analysis_id, "note": note, "created_at": rfc3339(at),
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ use crate::views::{rfc3339, rfc3339_opt, sha256_hex};
|
|||||||
use db::Role;
|
use db::Role;
|
||||||
|
|
||||||
#[derive(Debug, Clone, sqlx::FromRow)]
|
#[derive(Debug, Clone, sqlx::FromRow)]
|
||||||
|
/// An analysis as users see it; the model is left out on purpose (a business secret).
|
||||||
pub struct AnalysisRow {
|
pub struct AnalysisRow {
|
||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub kind: String,
|
pub kind: String,
|
||||||
pub chart_id: Option<Uuid>,
|
pub chart_id: Option<Uuid>,
|
||||||
pub synastry_id: Option<Uuid>,
|
pub synastry_id: Option<Uuid>,
|
||||||
pub language: String,
|
pub language: String,
|
||||||
pub model: String,
|
|
||||||
pub prompt_version: String,
|
pub prompt_version: String,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub content: Option<Value>,
|
pub content: Option<Value>,
|
||||||
@@ -48,8 +48,8 @@ pub struct AnalysisRow {
|
|||||||
pub completed_at: Option<OffsetDateTime>,
|
pub completed_at: Option<OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ANALYSIS_COLUMNS: &str = "id, kind, chart_id, synastry_id, language, model, prompt_version, status, content, \
|
const ANALYSIS_COLUMNS: &str = "id, kind, chart_id, synastry_id, language, prompt_version, status, content, error, \
|
||||||
error, credits_charged, created_at, completed_at";
|
credits_charged, created_at, completed_at";
|
||||||
|
|
||||||
impl AnalysisRow {
|
impl AnalysisRow {
|
||||||
pub fn view(&self) -> Value {
|
pub fn view(&self) -> Value {
|
||||||
@@ -59,7 +59,6 @@ impl AnalysisRow {
|
|||||||
"chart_id": self.chart_id,
|
"chart_id": self.chart_id,
|
||||||
"synastry_id": self.synastry_id,
|
"synastry_id": self.synastry_id,
|
||||||
"language": self.language,
|
"language": self.language,
|
||||||
"model": self.model,
|
|
||||||
"prompt_version": self.prompt_version,
|
"prompt_version": self.prompt_version,
|
||||||
"status": self.status,
|
"status": self.status,
|
||||||
"content": self.content,
|
"content": self.content,
|
||||||
|
|||||||
@@ -134,8 +134,6 @@ async fn public_config(State(state): St) -> Json<Value> {
|
|||||||
Json(json!({
|
Json(json!({
|
||||||
"google_login": { "enabled": state.google.enabled(), "client_id": c.google_client_ids.first() },
|
"google_login": { "enabled": state.google.enabled(), "client_id": c.google_client_ids.first() },
|
||||||
"locales": c.supported_locales,
|
"locales": c.supported_locales,
|
||||||
"analysis_model": c.analysis_model,
|
|
||||||
"summary_model": c.summary_model,
|
|
||||||
"password_login": c.password_login,
|
"password_login": c.password_login,
|
||||||
"mock_payments": c.mock_payments,
|
"mock_payments": c.mock_payments,
|
||||||
"signup_mode": c.signup_mode.as_str(),
|
"signup_mode": c.signup_mode.as_str(),
|
||||||
|
|||||||
@@ -487,8 +487,8 @@ async fn analyses_spend_units_and_reuse_results(pool: PgPool) {
|
|||||||
let list = app.get(&uri, Some(&anna)).await.body;
|
let list = app.get(&uri, Some(&anna)).await.body;
|
||||||
let summary = &list["analyses"][0];
|
let summary = &list["analyses"][0];
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
(summary["kind"].as_str(), summary["status"].as_str(), summary["model"].as_str(), &summary["credits_charged"]),
|
(summary["kind"].as_str(), summary["status"].as_str(), &summary["credits_charged"]),
|
||||||
(Some("summary"), Some("pending"), Some("anthropic/claude-summary"), &json!(0))
|
(Some("summary"), Some("pending"), &json!(0))
|
||||||
);
|
);
|
||||||
let r = app.call("POST", &format!("/v1/charts/{}/summary", chart["id"].as_str().unwrap()), Some(&anna), None).await;
|
let r = app.call("POST", &format!("/v1/charts/{}/summary", chart["id"].as_str().unwrap()), Some(&anna), None).await;
|
||||||
assert_eq!((r.status, &r.body["id"]), (StatusCode::OK, &summary["id"]));
|
assert_eq!((r.status, &r.body["id"]), (StatusCode::OK, &summary["id"]));
|
||||||
@@ -504,10 +504,18 @@ async fn analyses_spend_units_and_reuse_results(pool: PgPool) {
|
|||||||
let r = app.call("POST", &uri, Some(&anna), None).await;
|
let r = app.call("POST", &uri, Some(&anna), None).await;
|
||||||
assert_eq!(r.status, StatusCode::ACCEPTED, "{}", r.body);
|
assert_eq!(r.status, StatusCode::ACCEPTED, "{}", r.body);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
(r.body["status"].as_str(), r.body["language"].as_str(), r.body["model"].as_str(), &r.body["credits_charged"]),
|
(r.body["status"].as_str(), r.body["language"].as_str(), &r.body["credits_charged"]),
|
||||||
(Some("pending"), Some("hu"), Some("anthropic/claude-test"), &json!(1))
|
(Some("pending"), Some("hu"), &json!(1))
|
||||||
);
|
);
|
||||||
let first = r.body["id"].as_str().unwrap().to_string();
|
let first = r.body["id"].as_str().unwrap().to_string();
|
||||||
|
// the model is used but never shown to users
|
||||||
|
assert!(r.body.get("model").is_none() && summary.get("model").is_none());
|
||||||
|
let (model,): (String,) = sqlx::query_as("SELECT model FROM analyses WHERE id = $1::uuid")
|
||||||
|
.bind(&first)
|
||||||
|
.fetch_one(&app.pool)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(model, "anthropic/claude-test");
|
||||||
assert_eq!(app.get("/v1/credits", Some(&anna)).await.body["balance"], json!({"natal": 1, "synastry": 0}));
|
assert_eq!(app.get("/v1/credits", Some(&anna)).await.body["balance"], json!({"natal": 1, "synastry": 0}));
|
||||||
|
|
||||||
// same request again: the same analysis, no charge
|
// same request again: the same analysis, no charge
|
||||||
@@ -631,8 +639,7 @@ async fn public_config_and_health(pool: PgPool) {
|
|||||||
assert_eq!(r.body["google_login"]["enabled"], true);
|
assert_eq!(r.body["google_login"]["enabled"], true);
|
||||||
assert_eq!(r.body["google_login"]["client_id"], GOOGLE_CLIENT);
|
assert_eq!(r.body["google_login"]["client_id"], GOOGLE_CLIENT);
|
||||||
assert_eq!(r.body["locales"], json!(["hu", "en"]));
|
assert_eq!(r.body["locales"], json!(["hu", "en"]));
|
||||||
assert_eq!(r.body["analysis_model"], "anthropic/claude-test");
|
assert!(r.body.get("analysis_model").is_none() && r.body.get("summary_model").is_none());
|
||||||
assert_eq!(r.body["summary_model"], "anthropic/claude-summary");
|
|
||||||
assert_eq!(app.get("/healthz", None).await.status, StatusCode::OK);
|
assert_eq!(app.get("/healthz", None).await.status, StatusCode::OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default async function PackagesPage() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AiNote model={config?.analysis_model} />
|
<AiNote />
|
||||||
|
|
||||||
<section className="card holdings" aria-label="Amid most van">
|
<section className="card holdings" aria-label="Amid most van">
|
||||||
<span className="eyebrow">Most</span>
|
<span className="eyebrow">Most</span>
|
||||||
|
|||||||
@@ -1,28 +1,16 @@
|
|||||||
/** Shown where people decide: the analyses are written by top AI models. */
|
/** Shown where people decide: the analyses are written by top AI models (never named: a business secret). */
|
||||||
export const AI_SHORT =
|
export const AI_SHORT =
|
||||||
"A legfejlettebb AI-modellek írják: egy tapasztalt asztrológus írásos elemzéséhez közelítő mélység, töredék áron.";
|
"A legfejlettebb AI-modellek írják: egy tapasztalt asztrológus írásos elemzéséhez közelítő mélység, töredék áron.";
|
||||||
|
|
||||||
/** `anthropic/claude-opus-5.5` → `Claude Opus 5.5`. */
|
/** A highlighted note on the analysis quality. */
|
||||||
export function modelName(id: string | null | undefined): string | null {
|
export function AiNote() {
|
||||||
const name = id?.split("/").pop()?.trim();
|
|
||||||
if (!name) return null;
|
|
||||||
return name
|
|
||||||
.split("-")
|
|
||||||
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
||||||
.join(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A highlighted note on the analysis quality, optionally naming the model in use. */
|
|
||||||
export function AiNote({ model }: { model?: string | null }) {
|
|
||||||
const name = modelName(model);
|
|
||||||
return (
|
return (
|
||||||
<section className="card ai-note" aria-labelledby="ai-note-title">
|
<section className="card ai-note" aria-labelledby="ai-note-title">
|
||||||
<span className="eyebrow">Az elemzésekről</span>
|
<span className="eyebrow">Az elemzésekről</span>
|
||||||
<h2 id="ai-note-title">Profi mélység, töredék áron</h2>
|
<h2 id="ai-note-title">Profi mélység, töredék áron</h2>
|
||||||
<p className="muted">
|
<p className="muted">
|
||||||
Az elemzéseket a legfejlettebb AI-modellek írják{name ? ` (jelenleg: ${name})` : ""}, a képleted pontos
|
Az elemzéseket a legfejlettebb AI-modellek írják, a képleted pontos pozícióiból. Részletességben és
|
||||||
pozícióiból. Részletességben és árnyaltságban megközelítik egy tapasztalt asztrológus írásos elemzését, annak
|
árnyaltságban megközelítik egy tapasztalt asztrológus írásos elemzését, annak az árnak a töredékéért.
|
||||||
az árnak a töredékéért.
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -50,8 +50,6 @@
|
|||||||
"title": "Oroszlánarc, óceáni mélység"
|
"title": "Oroszlánarc, óceáni mélység"
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"analysis_model": "anthropic/claude-opus-5.5",
|
|
||||||
"summary_model": "anthropic/claude-sonnet-5.5",
|
|
||||||
"prompt_version": "v2",
|
"prompt_version": "v2",
|
||||||
"generated": "2026-11-16"
|
"generated": "2026-11-16"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -63,8 +63,6 @@ export interface UnitBalance {
|
|||||||
export interface PublicConfig {
|
export interface PublicConfig {
|
||||||
google_login: { enabled: boolean; client_id: string | null };
|
google_login: { enabled: boolean; client_id: string | null };
|
||||||
locales: string[];
|
locales: string[];
|
||||||
analysis_model: string;
|
|
||||||
summary_model: string;
|
|
||||||
password_login: boolean;
|
password_login: boolean;
|
||||||
password_min_length: number;
|
password_min_length: number;
|
||||||
mock_payments: boolean;
|
mock_payments: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user