@@ -52,6 +52,7 @@ def _parse_metadata(metadata: Any) -> dict[str, Any]:
5252from pydantic import BaseModel , ConfigDict , Field , field_validator , model_validator
5353
5454from hindsight_api import MemoryEngine
55+ from hindsight_api .config import RETAIN_EXTRACTION_MODES
5556
5657
5758def _annotation_is_nullable (annotation : Any ) -> bool :
@@ -1245,7 +1246,7 @@ class CreateBankRequest(BaseModel):
12451246 )
12461247 retain_extraction_mode : str | None = Field (
12471248 default = None ,
1248- description = "Fact extraction mode: 'concise' (default), 'verbose', or 'custom '." ,
1249+ description = "Fact extraction mode: 'concise' (default), 'verbose', 'custom', 'verbatim', or 'chunks '." ,
12491250 )
12501251 retain_custom_instructions : str | None = Field (
12511252 default = None ,
@@ -2206,7 +2207,8 @@ class BankTemplateConfig(BaseModel):
22062207 reflect_mission : str | None = Field (default = None , description = "Mission/context for Reflect operations" )
22072208 retain_mission : str | None = Field (default = None , description = "Steers what gets extracted during retain" )
22082209 retain_extraction_mode : str | None = Field (
2209- default = None , description = "Fact extraction mode: 'concise' (default), 'verbose', or 'custom'"
2210+ default = None ,
2211+ description = "Fact extraction mode: 'concise' (default), 'verbose', 'custom', 'verbatim', or 'chunks'" ,
22102212 )
22112213 retain_custom_instructions : str | None = Field (
22122214 default = None , description = "Custom extraction prompt (when mode='custom')"
@@ -2432,10 +2434,10 @@ def validate_bank_template(manifest: "BankTemplateManifest") -> list[str]:
24322434 if manifest .bank :
24332435 bank = manifest .bank
24342436 if bank .retain_extraction_mode is not None :
2435- valid_modes = ("concise" , "verbose" , "custom" , "chunks" )
2436- if bank .retain_extraction_mode not in valid_modes :
2437+ if bank .retain_extraction_mode not in RETAIN_EXTRACTION_MODES :
24372438 errors .append (
2438- f"bank.retain_extraction_mode: must be one of { valid_modes } , got '{ bank .retain_extraction_mode } '"
2439+ "bank.retain_extraction_mode: "
2440+ f"must be one of { RETAIN_EXTRACTION_MODES } , got '{ bank .retain_extraction_mode } '"
24392441 )
24402442 if bank .retain_custom_instructions and bank .retain_extraction_mode != "custom" :
24412443 errors .append ("bank.retain_custom_instructions: requires retain_extraction_mode='custom'" )
0 commit comments