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
When using the plugin to translate text the GenerateController::actionIndex() returns the following. Would just sending and waiting for the request suffice instead of streaming it? It'd remove some complexity and users have to wait for the final result anyways.
data: {"id":"****","object":"chat.completion.chunk","created":1707917150,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"rol
data: null
data: null
data: null
data: null
data: null
data: null
data: null
data: null
data: null
data: null
<pre>An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html/vendor/mostlyserious/craft-promptly/src/Controllers/Traits/HasFetching.php on line 83. in /var/www/html/vendor/yiisoft/yii2/web/Response.php:369
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/web/Response.php(342): yii\web\Response->sendHeaders()
#1 /var/www/html/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#2 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(192): yii\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#3 /var/www/html/vendor/yiisoft/yii2/base/ErrorHandler.php(152): craft\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#4 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(66): yii\base\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#5 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#6 {main}
Previous exception:
yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html/vendor/mostlyserious/craft-promptly/src/Controllers/Traits/HasFetching.php on line 83. in /var/www/html/vendor/yiisoft/yii2/web/Response.php:369
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/web/Response.php(342): yii\web\Response->sendHeaders()
#1 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#2 /var/www/html/web/index.php(33): yii\base\Application->run()
#3 {main}</pre>
The text was updated successfully, but these errors were encountered:
@ddnetters Yeah, working with streaming in PHP has been a chore and unfortunately this was pretty much the first go at an OpenAI integration. Would agree but we had a number of other stakeholders who felt streaming would be important for perceived performance. I've had the opportunity to work on a number of other OpenAI integrations since initially releasing this plugin and will be coming back through to refactor quite a bit to improve these hiccups. At the moment my agency is slammed with development work and I haven't been able to dedicate the time I'd like to making improvements here but it is at the top of my list of priorities as soon as I have the chance.
When using the plugin to translate text the
GenerateController::actionIndex()
returns the following. Would just sending and waiting for the request suffice instead of streaming it? It'd remove some complexity and users have to wait for the final result anyways.The text was updated successfully, but these errors were encountered: