Consensus not reached

Hello. I am new to Motoko and I was working with the openAI where my canister gets to send a request to the service I built to Interract with the OpenAI but while I was testing this on the local dev, it was working fine but now on the main net, it is saying consensus not reached.

Anyone faced this problem before? Considering that the generative response of the openAI, there is bound to be different response to same question asked.

How do I resolve this.

1 Like

Hello! Did you read the HTTPS outcalls documentation? In particular the known limitations are relevant here: The output of the transformation function must be the same for each response, otherwise you’ll get exactly the error that you encountered.

It worked when running locally because there is only a single replica, so consensus is reached trivially.

The only way to make this work is to find a way to get the same answer for the same request—or at least get answers that are so similar that you can make them consistent using the transformation function.

2 Likes

@THLO yes I did. But I am trying to see if I can set up a proxy to help reduce the number of request made to the AI service