You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use the following statement to send a prompt to OpenAI. However, it usually takes about 38s to get a response, during this period. The application is blocked. Is there a way to send the prompt asynchronously so that the function will return immediately and when the response is back, a callback function can be notified?
var Chat := OpenAI.Chat.Create(
procedure(Params: TChatParams)
begin
Params.Messages([TChatMessageBuild.Create(TMessageRole.User, Text)]);
Params.MaxTokens(1024);
end);
Thank you.
The text was updated successfully, but these errors were encountered:
Thank you so much. Just check that and it seems TTask is a simplified version of TThread that does not require me to inherit a class and implement Execute. Much simpler. Thank you.
Hi,
I try to use the following statement to send a prompt to OpenAI. However, it usually takes about 38s to get a response, during this period. The application is blocked. Is there a way to send the prompt asynchronously so that the function will return immediately and when the response is back, a callback function can be notified?
Thank you.
The text was updated successfully, but these errors were encountered: