-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Responsible AI scenarios for OpenAI #1979
Comments
Thanks for sharing this issue! Just to be sure I understand correctly, you want to implement a way to handle most Sounds great! Additional information during inference would be more than welcome considering users have struggled with missing output in the past.
I don't think at the moment we need to do anything with I believe It seems that
Agreed, and since BERTopic does not pass all documents to the API I would not expect excessive logging. All in all, sounds good. Looking forward to this! |
Yes, that is correct. @MaartenGr, thanks for your feedback My plan for
I'll have a draft shortly to collect your feedback. On the code design front, I am tempted to extract a function so I can add some unit tests around this handling logic. What are your thoughts on that? |
High Level Proposal
I would like to extend
representation.OpenAI
to handle more scenarios that crop up when using OpenAI hosted by Azure. These scenarios affect usage of the AzureOpenAI class. Azure places its OpenAI instance behind Responsible AI (RAI) controls which reduce harm by limiting access to sensitive (violence, hate, self-harm, sexual) content but requires more edge-cases and errors to be accounted for.I believe that handling more RAI based scenarios for OpenAI will improve the usability of modeling using that representation model for both folks who use AzureOpenAI and OpenAI.
Technical Details
RAI triggers can be encountered in two scenarios:
Sending inappropriate input
repr_doc_ids
within _extract_representative_docs which cause an exception to be raisedGPT generating sensitive output based on the prompt
CompletionChoice.finish_reason
slength
andfunction_call
andnull
finish_reasonsstop
finish_reasonsrepr_doc_ids
which caused sensitive responsesThe text was updated successfully, but these errors were encountered: