Hey everyone,
Is it possible to generate XML using the “Generable” macro of the Foundation Model Framework?
Yeah, the Foundation Models framework doesn't provide an XML representation for a Generable
type. (It does provide a JSON
representation via rawContent and jsonString, if that matters.) You are free to provide your own implementation though, as shown below:
@Generable
struct YourGenerableType {
...
}
extension YourGenerableType.PartiallyGenerated {
var xmlString: String {
...
}
}
Best,
——
Ziqiao Chen
Worldwide Developer Relations.