I’m interested in whether anyone has found a way to go beyond simple markdown rendering for AI completions.
Consider the following example -
Let’s imagine we’re building an AI that recommends movies. The initial prompt will instruct the model to call a searchMovies function based on the user’s taste. This works well, and the bot will return a markdown-formated list of movies based on the user’s input.
However, as a developer, I’d like to have fine control over the list of movies using Javascript and CSS. For that, I’d need the bot to reply with a predictable, machine-readable format (JSON, HTML)
I tried instructing the AI to format the answer as JSON but my trials so far, it seems like the AI wants to answer the question “properly” before showing the JSON. So it’ll still give a list of recommendations formatted in markdown before also displaying the JSON.
A similar problem I’m interested in solving is allowing the AI to render interactive elements like select boxes. For example, imagine the AI needs to know which country the user is from, and in addition to allowing the user to answer in text form, it can “render” a select box for the user to choose from.
You should at least be able to improve the output in a json container. Tell the AI that it is not a chatbot, but is a backend processor that interacts only with APIs that require properly-validated json, then providing the format schema.
I’ll try instructing the AI to be a backend processor interacting with APIs. The trouble is that I still need it to interact with the user
Perhaps I could run another model in the background when the searchMovies function is called, and have it answer the query? I’m not sure this kind of technique will even work, but I’ll try.
Is the markdown part of the training? Perhaps there is a way to influence what markdown is generated? If so, maybe I could instruct it to create custom tags around recommendations, which I could then parse accordingly.
Markdown is part of the overtraining of models to just be ChatGPT and render in the ChatGPT interface.
In the function return, you can return not just a json format, but if that is a consumable meant for the user, you can return as an instruction. A guess:
Movie results, print this json for user exactly as it appears: ```{“movies”:…```
the three backticks of markdown will place all in a code block if you have a renderer with a copy button.