Problem/Motivation
The OpenAiProvider::embeddings() OpenAiProvider::chat() OpenAiProvider::textToImage() and OpenAiProvider::textToSpeech()methods accept a $tags array, which is used to pass context or flags (such as 'skip_moderation').
However, the current implementation calls $this->moderationEndpoints($input) unconditionally, even if the skip_moderation tag is present, so the module still performs a moderation request regardless.
Steps to reproduce
Proposed resolution
Update embeddings(), chat(), and other relevant methods to check if the skip_moderation tag is present before calling the moderation endpoint.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork ai_provider_openai-3569926
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ben.bastow commentedComment #4
scott_euser commentedThanks! This is to make use of #3510599: Allow skipping of moderations for some embeddings (controlled input), looks good to me!
Comment #5
scott_euser commentedAh looks like its already available in #3510601: Allow skipping of moderations for some embeddings (not all), credited you there, closing this as a duplicate as it came later.