AI Assist v4.1.0: Dynamic styleguide support in AI Assist

Dynamic styleguide

It is now possible to provide a styleguide async function. The function is passed a context object with Sanity client and the current documentId and schemaType.

This can allow editors to mange the styleguide through a Sanity document, for instance.

assist({
translate: {
styleguide: ({client, documentId, schemaType}) => client.fetch('* [_id=="styleguide.singleton"][0].styleguide')
},
})

Consider caching the results: the function is invoked every time translate runs.