core.prompt_utils
Prompt interpolation and JSON field extraction utilities.
Prompt interpolation and JSON field extraction utilities.
- extract_json_field(data, path)[source]
Extract a value from JSON using dot notation path.
Supports: - Simple fields: “field_name” - Nested objects: “object.field” - Array indices: “array.0” - Combined: “object.array.0.field”
- interpolate_prompt(prompt, history, strict=False)[source]
Replace {{prompt_name.response}} patterns with actual content.
- Parameters:
- Returns:
Tuple of (resolved_prompt, set_of_interpolated_prompt_names)
- Return type:
Functions
- extract_json_field(data, path)[source]
Extract a value from JSON using dot notation path.
Supports: - Simple fields: “field_name” - Nested objects: “object.field” - Array indices: “array.0” - Combined: “object.array.0.field”