callback_CallSimpleAI
Description
This async function is called when an AI request is completed and some response is returned.
Syntax
callback_CallSimpleAI(callId, threadId, succeeded, responseMessage, creditsUsed)
Argument
Description
callId
The id of this call request. It was returned in CallSimpleAI. This is a number.
threadId
The threadId of this conversation/thread. If you had not provided a thread id in the CallSimpleAI, then please note this down. It is the threadId which is assigned to this conversation/thread. This is a number.
succeeded
Boolean that tells us if the request was successful or not.
responseMessage
The reply from the GPT AI model. This is a String.
creditsUsed
The number of RNet AI credits this request used. This is a number.
Returns
N/A
Example Implementation
function callback_CallSimpleAI(callId, threadId, succeeded, responseMessage, creditsUsed){
show_message("call id "+string(callId) +" of thread id "+string(threadId)+" was success? "+string(succeeded)+" "+ responseMessage)
//save the thread id and use it in the next call if you want to continue this conversation.
}
Last updated