Allow packages to format their property values for the AI content tools
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend-api-design
Research direction
Start by reading the existing IAIPropertyValueHandler pattern, ContentToolHelpers, and PropertyValueFormatter in the v17/main source. Trace how properties are read with culture and how built-in formatting is selected, then assess the proposed formatter registration and fallback behavior. Done means packages can register a formatter by editor schema alias and the built-in rules remain the fallback; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Description
Problem
The content tools (get_umbraco_content and others built on ContentToolHelpers) pass every property through PropertyValueFormatter. That class is internal and has rules only for core editors:
- rich text and Markdown are stripped to plain text;
- media and content pickers are reduced to name and URL;
- blocks are recursed;
- strings are truncated.
Every other editor's converted value goes to the model unchanged.
For a package editor whose value converter builds a rich model, that has three effects:
- Large tool output. Our editor stores a small selection (about 200 bytes of JSON). Its converter turns that into the full content the front end renders, 9–34 KB per property. The model receives all of it on every page read: about 80 KB for one test page with five such properties, while a summary of a few hundred bytes would do.
- No access to the stored value. To edit the property, the model needs the stored value, but it only ever sees the converted one. We worked around this with our own tool that reads the stored value.
- The culture doesn't reach the converter. The property is read with
GetValue(culture), but a converter that picks its output language fromIVariationContextAccessorstill sees the request's culture. On a culture-variant page the model gets the default language.
Proposal
An extension point that follows the existing IAIPropertyValueHandler pattern:
public interface IAIPropertyValueFormatter : IDiscoverable
{
string ForPropertyEditorSchemaAlias { get; }
// Return what the model should see for this property; null falls back to the built-in rules.
object? Format(IPublishedProperty property, string? culture);
}
Registered through builder.AIPropertyValueFormatters() and discovered automatically, with the built-in rules as the fallback. A package could then give the model a compact, culture-aware summary of its value instead of the full model.
Setting the variation context to the requested culture while formatting would also solve point 3 for every converter, independently of this proposal.
Environment: Umbraco 17.6.2, Umbraco.AI 17.8.2 (confirmed against the v17/main source).
- Dominant language
- C#
- Stars
- 36
- Forks
- 29
- Avg merge
- 4h 54m
- Merged PRs (30d)
- 105
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from umbraco/Umbraco.AI
-
bug state/ready
Difficulty 3/5 1-2 days Newbie friendliness 74/100
umbraco/Umbraco.AI#814 ·
Maintainers usually reply within 1 day
-
bug component/agent component/copilot-workspace component/provider-anthropic state/ready
Difficulty 4/5 3-5 days Newbie friendliness 48/100
umbraco/Umbraco.AI#810 · 3 comments ·
Maintainers usually reply within 1 day
-
component/copilot state/blocked
Difficulty 4/5 3-5 days Newbie friendliness 48/100
umbraco/Umbraco.AI#188 · 2 comments ·
Maintainers usually reply within 1 day
All issues in umbraco/Umbraco.AI
Similar issues
-
In-car displays show 0 km/h and P while the AV drivesPossibly taken @bazilinskyy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bazilinskyy/coupled-sim#366 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BaryoDev/umbraco-pwa#196 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/fluentui-blazor#5688 ·
Maintainers usually reply within 1 day
-
bug flaky lsp-transport small
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day