feat: Enhance placeholder system with AI context support
- Introduced `build_ai_placeholder_caption` function in `placeholder_registry.py` to generate AI context captions based on placeholder metadata. - Updated `resolve_placeholders` in `placeholder_resolver.py` to support modifiers for AI context, allowing for enhanced descriptions when placeholders are resolved. - Modified `get_placeholder_catalog` to include AI captions in the output, improving the metadata available for placeholders. - Adjusted `export_placeholder_values` to include AI captions in the exported data, enhancing the information provided to users. These changes improve the flexibility and functionality of the placeholder system, enabling richer context generation for dynamic content.
This commit is contained in:
1 parent
41bf593d4c
commit
baeddd7c13
5 files changed
+146
-27
No files matched your search
@@ -486,12 +486,15 @@ def export_placeholder_values(session: dict = Depends(require_auth)):
|
||||
export_data['placeholders_by_category'][category] = []
|
||||
for item in items:
|
||||
key = item['key'].replace('{{', '').replace('}}', '')
|
||||
export_data['placeholders_by_category'][category].append({
|
||||
row = {
|
||||
'key': item['key'],
|
||||
'description': item['description'],
|
||||
'value': cleaned_values.get(key, 'nicht verfügbar'),
|
||||
'example': item.get('example')
|
||||
})
|
||||
'example': item.get('example'),
|
||||
}
|
||||
if item.get('ai_caption'):
|
||||
row['ai_caption'] = item['ai_caption']
|
||||
export_data['placeholders_by_category'][category].append(row)
|
||||
|
||||
# Also include flat list for easy access
|
||||
export_data['all_placeholders'] = cleaned_values
|
||||
|
||||
Reference in new issue
Block a user