Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:4thfever Cultivation world simulator merge story prompt with goldfinger

From Leeroopedia
Knowledge Sources
Domains Narrative_Generation, Prompt_Engineering
Last Updated 2026-10-22 14:00 GMT

Overview

Concrete tool for enriching story prompts with avatar "goldfinger" story hints, provided by the Cultivation World Simulator goldfinger system.

Description

The merge_story_prompt_with_goldfinger function concatenates a base story prompt with each actor's goldfinger story hints. "Goldfinger" refers to a character's unique cheat/ability that should be highlighted in narrative text.

The function:

  1. Normalizes the base prompt (strips whitespace)
  2. Calls `build_goldfinger_story_hint(*avatars)` to collect each avatar's goldfinger hints
  3. Concatenates them with a header "外挂相关重点:" (Goldfinger key points)
  4. Returns the merged prompt with double-newline separation

If no goldfinger hints exist, returns just the base prompt.

Usage

Import and call this function when:

  • Story event creation: called by `StoryEventService.maybe_create_story` before passing the prompt to `StoryTeller`

Code Reference

Source Location

Signature

def merge_story_prompt_with_goldfinger(
    base_prompt: str,
    *avatars: Optional["Avatar"]
) -> str:
    """Merge base prompt with goldfinger story hints for each avatar."""

Import

from src.classes.goldfinger import merge_story_prompt_with_goldfinger

I/O Contract

Inputs

Name Type Required Description
base_prompt str Yes Original story prompt
*avatars None Yes Actors for goldfinger hint extraction

Outputs

Name Type Description
return str Enriched prompt with goldfinger hints appended

Usage Examples

Enrich Prompt Before Story Generation

from src.classes.goldfinger import merge_story_prompt_with_goldfinger

enriched_prompt = merge_story_prompt_with_goldfinger(
    "A fierce battle in the eastern mountains.",
    avatar_a, avatar_b,
)
story = await StoryTeller.tell_story(
    event_text, result_text, avatar_a, avatar_b,
    prompt=enriched_prompt,
)

Related Pages

Implements Principle

Required Environments

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment