Here’s an example of using a function. The method offered helps the AI:
Code that returns random dice will allow the AI to answer better. Function code can be used to enhance knowledge or skill with its return text, or to take external action and have the AI report on the success.
The realtime API depicted in your screen shot typically is used with voice responses.
If you want to obtain text that is preformatted so that it can be accepted easily, as the final result of what the AI produces, you would use “structured outputs” - where the AI fills in each field of pre-determined keys of a JSON. That could be used in your otherwise non-AI application.
For example, you might have the AI produce book genre for your input book title and summary. Then you’d only want {“genre”: “comedy”} as the output that your application can understand.
Perhaps you need to investigate more how you expect the procedural flow to happen in an application, and where AI is useful, if not simply making a chatbot to talk with. In the most basic form, you tell the AI what response to generate, and it writes that with its IQ and existing knowledge.
YOU are the one providing the function response back to the AI model.
