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 have a array with different blocks in HTML format (extracted from Gutenberg in WordPress).
For each iteration, I want to send the HTML to the API and ask it to modify the text according to a prompt.
When I have to do a loop like this, do I have to do :
foreach ($blocks as $block) {
$result = $client->chat()->create([
'model' => 'gpt-4',
'messages' => [
['role' => 'system', 'content' => 'Replace Paris with Berlin in the following HTML code.'],
['role' => 'user', 'content' => '<div class="">Text to edit From Paris</div>'],
],
]);
}
Or is there another solution?
Do I have to resend the history each time? I don't think I'll need it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
Here's what I'm trying to do:
I have a array with different blocks in HTML format (extracted from Gutenberg in WordPress).
For each iteration, I want to send the HTML to the API and ask it to modify the text according to a prompt.
When I have to do a loop like this, do I have to do :
Or is there another solution?
Do I have to resend the history each time? I don't think I'll need it.
Thanks for help :)
Beta Was this translation helpful? Give feedback.
All reactions