Enable ChatGPT Via OpenAI API's on Yellow AI

Hey Guys!

I am planning to integrate ChatGPT with Yellow AI Bot where there are a lot of students who need help in terms of learning so I am planning to help them with the bot.

So, I am planning to integrate the bot and when I use the API node. I am getting this as response.

{
	"id": "cmpl-6Zzi56bmBvFPuGtLA5MdVQWhdOCuG",
	"object": "text_completion",
	"created": 1674036713,
	"model": "text-davinci-003",
	"choices": [
		{
			"text": "\n\nThis is indeed a test",
			"index": 0,
			"logprobs": null,
			"finish_reason": "length"
		}
	],
	"usage": {
		"prompt_tokens": 5,
		"completion_tokens": 7,
		"total_tokens": 12
	}
}

Now, I am planning to get the choices[0].text but I am not able to fetch the response and I have tried almost everything reading the documentation so can I please get the help on this.

1 Like

@Xaif

If you’re using a function to pull out the data - standard JS format of response.choices[0].text should work.

If you’re trying to parse and fetch this data directly after the API call from within the bot flow (without a function) — then you can use the format {{{variables.apiResponse.choices.0.text}}}

within the bot flow, you can’t parse using choices[0] — it has to be choices.0

Hey @gautham

I tried this method but it’s not working for me for some reason.

https://ibb.co/37DZ6WY
https://ibb.co/hmvr1cM
https://ibb.co/jzQKDHc

Attaching the screenshots above & it’s not working I will also create a support ticket for the same.

@Xaif

in the screenshot, it shows that you’re writing {{apiResponse.choic…}}
the correct format is {{{variables.apiResponse.choices.0.text}}}