- Issue created by @_michel_
- ๐ฌ๐งUnited Kingdom MrDaleSmith
When using OpenAI, the code at line 160 in Drupal\ai_ckeditor\Controller\AiRequest::doRequest() is returning an OpenAI iterator; when using Anthropic it is returning a plain ChartMessage. This means that when the code then tries to iterate through the response, it skips past without triggering any kind of error.
I'm not sure whether this means that Anthropic don't support streamed responses, or whether its as simple as us checking whether the return is iterable and only using a foreach if it is, or if there's been an oversight in the return the Anthropic provider is returning (in white case this will be an issue for that module). I'll need a maintainer to confirm the best approach.
- ๐ฉ๐ชGermany marcus_johansson
@mrdalesmith Its the later, not all providers supports streamed responses and the 3rd party provider is responsible of creating this logic at the moment.
There is a MR to make sure that the non-streamed reponses gets put in one streamed blob, but it has not been approved or merged yet and is a little bit out of date.
Its documented here: https://project.pages.drupalcode.org/ai/developers/develop_third_party_m...
- ๐ฌ๐งUnited Kingdom MrDaleSmith
I'm going to close this as a duplicate, since https://www.drupal.org/project/ai_provider_anthropic/issues/3498151 ๐ Text generated by ckeditor request to claude does not appear Active exists in the Anthropic provider issue queue and the fix needs to be made there, not here.
- ๐ฌ๐งUnited Kingdom MrDaleSmith
Wrong way round: issue needs fixing HERE not in https://www.drupal.org/project/ai_provider_anthropic/issues/3498151 ๐ Text generated by ckeditor request to claude does not appear Active
- Merge request !414Correctly check for streamed response in CK Editor Generate โ (Open) created by MrDaleSmith
- ๐ฉ๐ชGermany tomsaw Essen
MR !141 does not apply as patch :(
drupal/core: 10.4.1
drupal/ai: 1.0.2 - ๐ฌ๐งUnited Kingdom MrDaleSmith
The MR is made against the dev version of the module by default: have you tried testing against that?
- ๐ฉ๐ชGermany jan kellermann
jan kellermann โ made their first commit to this issueโs fork.
- ๐ฉ๐ชGermany jan kellermann
MR solves the problem for me. Unfortunately, MR still makes changes to the code that are not directly related, for example removing the 3rd parameter when calling the chat() function. Therefore I cannot give an RTBC.
- ๐ฉ๐ชGermany jan kellermann
Therefore, I created a new fork and MR!417 that only fixes the bug and does not make any other changes in code or function.
Feel free to test and give feedback. Thanks a lot.
- ๐ฉ๐ชGermany tomsaw Essen
Oops my fault.
Moved to @dev, applied MR! 417 -> works.
I feel happyness, like a squirrel that found a batch of walnuts in the winter! - ๐ฌ๐งUnited Kingdom MrDaleSmith
Yeah those changes were because of work getting merged in after this MR was opened, not a deliberate removal: the bugfix only branch works fine too.
- ๐ฉ๐ชGermany jan kellermann
jan kellermann โ changed the visibility of the branch 3499361-ckeditor-does-not to hidden.
- ๐ฉ๐ชGermany jan kellermann
Thanks for the feedback (I didn't expect a deliberate removal either :) ).
I have hidden the MR!414 and set the ticket to RTBC.