This is very lightweight plugin to send HTTP requests and parse JSON in bluerpints.
Demo project shows interaction with two neural models: text-generative and text-to-speech.
I used text-generation-webui to run this model and this fork of coqui TTS. Demo project also uses Runtime Audio Importer plugins (it's free on Unreal Marketplace).
Json parser starts with two global functions: "Json from File" or "Json from String". After you created JsonItem variable from a string template or loaded it from file, read or write any field inside using functions: SetBooleanField, SetNumericField, SetStringField and GetBooleanField, GetNumericField, GetStringField. All these functions require path, which consists of hierarchy of json fields separated by dot (.) symbol. For arrays use square brackets with element index or name of a field inside.
For exmaple, standard OpenAI request looks like this:
{
"messages": [
{
"role": "user",
"content": "Hello! Who are you?"
},
{
"role": "system",
"content": "Answer in rhyme."
}
],
"mode": "chat"
}
Path to user content ("Hello! Who are you?" string) is messages[role="user"].content (quotes are optional) or messages[0].content.
To send HTTP requests, use HTTPSubsystem. It has three useful events OnTextResponse, OnDataResponse and OnResponseError and simple function HTTPRequest.