I created a project using VB to try out the ChatGPT API. I’m using the steps outlined here, except that I’d like to figure out how to do this with VB instead of C#.
I’m at the stage where I’m trying to get information out of a JsonObject. I keep getting object reference errors like the one below, so I know I’m not getting the answer that I want. I can see the answer in the JsonObject, though. (It’s the word “Springfield” because I asked ChatGPT what the capital of Illinois is.)
I have a feeling it may be because the Invoke Code activity I am using is written in C#, but then I wouldn’t expect to get a response from the API. I’m getting a response, as you can see, I’m just not getting the information I want out of it.
Can anyone help me figure out where I’m going wrong after deserializing the JSON?
Yeah, pretty sure I’m messing this all up because I’m mixing some C# with VB, but I’m not sure at what point that is causing the trouble. Like I said, I’m getting the response below, so it seems like my POST request is working, but I’m not getting the “text” value of “Springfield” from the response.
Thanks for the help, @ppr. I’m still doing something wrong. It’s giving me what I sent instead of what I received when I type in jsonOutput.ToString in the Immediate panel.