Refine play type integration flow and docs
This commit is contained in:
@@ -2,8 +2,8 @@ use super::*;
|
||||
|
||||
pub(crate) fn build_puzzle_form_seed_text(payload: &CreatePuzzleAgentSessionRequest) -> String {
|
||||
build_puzzle_form_seed_prompt(PuzzleFormSeedPromptParts {
|
||||
title: None,
|
||||
work_description: None,
|
||||
title: payload.work_title.as_deref(),
|
||||
work_description: payload.work_description.as_deref(),
|
||||
picture_description: payload
|
||||
.picture_description
|
||||
.as_deref()
|
||||
@@ -32,8 +32,8 @@ pub(crate) async fn save_puzzle_form_payload_before_compile(
|
||||
now: i64,
|
||||
) -> Result<String, Response> {
|
||||
let seed_text = build_puzzle_form_seed_text_from_parts(
|
||||
None,
|
||||
None,
|
||||
payload.work_title.as_deref(),
|
||||
payload.work_description.as_deref(),
|
||||
payload
|
||||
.picture_description
|
||||
.as_deref()
|
||||
|
||||
@@ -725,8 +725,8 @@ pub async fn execute_puzzle_agent_action(
|
||||
}
|
||||
"save_puzzle_form_draft" => {
|
||||
let seed_text = build_puzzle_form_seed_text_from_parts(
|
||||
None,
|
||||
None,
|
||||
payload.work_title.as_deref(),
|
||||
payload.work_description.as_deref(),
|
||||
payload
|
||||
.picture_description
|
||||
.as_deref()
|
||||
|
||||
@@ -384,6 +384,28 @@ fn puzzle_compile_error_preserves_vector_engine_unavailable_status() {
|
||||
assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn puzzle_form_seed_text_includes_work_metadata() {
|
||||
let payload = CreatePuzzleAgentSessionRequest {
|
||||
seed_text: Some("旧 seed 会被画面描述兜底覆盖。".to_string()),
|
||||
work_title: Some("雨夜猫街".to_string()),
|
||||
work_description: Some("123".to_string()),
|
||||
picture_description: Some("一只猫在雨夜灯牌下回头。".to_string()),
|
||||
reference_image_src: None,
|
||||
reference_image_srcs: Vec::new(),
|
||||
reference_image_asset_object_id: None,
|
||||
reference_image_asset_object_ids: Vec::new(),
|
||||
image_model: None,
|
||||
ai_redraw: Some(true),
|
||||
};
|
||||
|
||||
let seed_text = build_puzzle_form_seed_text(&payload);
|
||||
|
||||
assert!(seed_text.contains("作品名称:雨夜猫街"));
|
||||
assert!(seed_text.contains("作品描述:123"));
|
||||
assert!(seed_text.contains("画面描述:一只猫在雨夜灯牌下回头。"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn puzzle_compile_error_normalizes_legacy_apimart_image_message() {
|
||||
let error = map_puzzle_compile_error(SpacetimeClientError::Runtime(
|
||||
|
||||
Reference in New Issue
Block a user