- Issue created by @marcus_johansson
- First commit to issue fork.
- 🇬🇧United Kingdom justanothermark
Created an MR for this.
I also want to suggest creating a follow-up ticket to remove the `$include_pre_prompt` parameter from `AssistantMessageBuilder::buildMessage()`. We already pass the AIAssistant to this parameter so the Message Builder can check this directly to see whether or not to include the pre prompt. In turn, this means we can simplify `AiAssistantApiRunner::process` and keep all references to the prompt files in a single place. However, this would introduce backwards compatibility issues so I haven't included it as part of the MR.
- 🇩🇪Germany marcus_johansson
Thanks Mark - I did realize one thing that I forgot to put in the proposed resolution that we should add here,
If they actual are overriding already, we can assume at the moment that they are using a custom prompt. We should create a update hook that outputs a warning about it, so they have seen it? Or some other way of letting them know that this has happened, otherwise I'm not sure we can add it into 1.0 branch, since it is changing running sites.
- 🇬🇧United Kingdom justanothermark
Ah yeah, that makes sense @marcus_johansson. I've added an update hook and implemented hook_requirements to provide warnings with links to the documentation if the site is using advanced mode but doesn't have custom prompts enabled.
- 🇮🇳India akulsaxena
The changes LGTM
But there seem to be some PHPCS error in the file. Seems like a single small error.
can you please fix it, moving it to NW for now - 🇬🇧United Kingdom justanothermark
My mistake, I'd fixed that but not pushed the change. Updated now.
- 🇩🇪Germany marcus_johansson
I added two comments here that needs to be fixed before we can merge it - the prompt should only be loaded from the text file the first time they ever run, the next coming times it should run from cache to not cause I/O. No cache flushing strategy would be needed, since this ever only changes on composer updates, when you should clear cache anyway.
- 🇬🇧United Kingdom justanothermark
@marcus_johansson Added caching as requested. Worth noting that I've done this with a trait to avoid adding a new argument to the service (which would break backwards compatibility and mean we couldn't merge this fix until 2.x). This also means we can reuse the cache bin in other places if needed.
-
marcus_johansson →
committed 3d5d7588 on 1.0.x authored by
justanothermark →
Issue #3499378 by justanothermark. Added ai_assistant_custom_prompts...
-
marcus_johansson →
committed 3d5d7588 on 1.0.x authored by
justanothermark →
Automatically closed - issue fixed for 2 weeks with no activity.