mirror of
https://github.com/vegu-ai/talemate.git
synced 2026-09-01 19:48:52 +02:00
test: derive DEFAULT_CONSOLIDATE from production and pin the shipped Consolidate default (#149) (#150)
* test: derive DEFAULT_CONSOLIDATE from production and pin the shipped Consolidate default (#149) * test: tighten test_consolidate_default comment to what the pin actually catches (PR #150 review)
This commit is contained in:
@@ -18,6 +18,11 @@ corresponding *real* production method can parse:
|
||||
|
||||
import json
|
||||
|
||||
from talemate.agents.creator.character import (
|
||||
CHARACTER_GENERATION_ASPECTS,
|
||||
CONSOLIDATE_TEMPLATES_FLAG,
|
||||
)
|
||||
|
||||
# prompt kinds per real request path, for routing assertions against
|
||||
# MockClient.prompt_history (see the corresponding Prompt.request calls)
|
||||
KIND_NAME = "analyze_freeform_24" # creator.determine-character-name
|
||||
@@ -27,17 +32,8 @@ KIND_SHEET = "create" # world_state.extract-character-sheet
|
||||
KIND_FOCAL = "analyze_1024" # focal.request default response_length
|
||||
KIND_UNIFIED = "create_4096" # creator.generate-character @ default budget
|
||||
|
||||
# the character_creation "Consolidate" config default (for restoring after
|
||||
# tests that widen or narrow the selection): every aspect, plus the
|
||||
# 'Attribute templates' fold flag
|
||||
DEFAULT_CONSOLIDATE = [
|
||||
"name",
|
||||
"description",
|
||||
"attributes",
|
||||
"dialogue_instructions",
|
||||
"example_dialogue",
|
||||
"attribute_templates",
|
||||
]
|
||||
# the character_creation "Consolidate" config default
|
||||
DEFAULT_CONSOLIDATE = list(CHARACTER_GENERATION_ASPECTS) + [CONSOLIDATE_TEMPLATES_FLAG]
|
||||
|
||||
|
||||
def prompt_kinds(client) -> list[str]:
|
||||
|
||||
@@ -33,6 +33,7 @@ from conftest import (
|
||||
client_responses,
|
||||
)
|
||||
from _character_test_helpers import (
|
||||
DEFAULT_CONSOLIDATE,
|
||||
KIND_DESCRIPTION,
|
||||
KIND_DIALOGUE_INSTRUCTIONS,
|
||||
KIND_NAME,
|
||||
@@ -466,6 +467,12 @@ async def test_generate_character_unified_example_dialogue_guidance_rendered(cre
|
||||
assert result.example_dialogue == ['Elena: "Oh dear!"']
|
||||
|
||||
|
||||
def test_consolidate_default(creator):
|
||||
# the shipped setting must stay the derived "everything" composition -
|
||||
# a hardcoded, narrowed or reordered value= fails here
|
||||
assert creator.cc_consolidate == DEFAULT_CONSOLIDATE
|
||||
|
||||
|
||||
def test_consolidate_templates_default(creator):
|
||||
assert creator.cc_consolidate_templates is True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user