Currently we simply create a url using mermaid code to Kroki.io service and return to ChatGPT.
Kroki only creates the svg from the mermaid code on demand as the chat tries to display it inline. Thus a 1-2 second delay after the link is inserted in the chat.
To fix this we need to kick of fetch of the svg from Kroki before returning the response, and return a shortened link that will return the already fetched svg by the time chat tries to render the link.
Currently we simply create a url using mermaid code to Kroki.io service and return to ChatGPT. Kroki only creates the svg from the mermaid code on demand as the chat tries to display it inline. Thus a 1-2 second delay after the link is inserted in the chat. To fix this we need to kick of fetch of the svg from Kroki before returning the response, and return a shortened link that will return the already fetched svg by the time chat tries to render the link.