Skip to content

Throw explicit error when content filtering is triggered#94

Merged
jnu merged 1 commit into
mainfrom
content-error
May 21, 2025
Merged

Throw explicit error when content filtering is triggered#94
jnu merged 1 commit into
mainfrom
content-error

Conversation

@jnu

@jnu jnu commented May 21, 2025

Copy link
Copy Markdown
Contributor

Content filtering in an OpenAI response often results in an empty or partial result. We were previously just ignoring this, since we assume there's no content filtering policy set up when our application is run.

As a sanity check, we will start inspecting the stop_reason and surface this as an error if the response was flagged by the content filter.

The new FilteredContentError will instruct the user to check their settings and no result will be returned (the pipeline will be aborted at this point).

@jnu jnu merged commit 43f5f7c into main May 21, 2025
1 check passed
@jnu jnu deleted the content-error branch May 21, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant