How to tell if streaming completion ended due to content filtering

Kieran Paton 0 Reputation points
2023-03-06T06:26:01.5366667+00:00

I'm using the streaming completions option in my application - currently it seems the streaming just stops part way through if a content filtering issue is detected in the results. Is there any way to tell that it was stopped due to content filtering vs just ending normally? Or possible to get any feedback on why the content was deemed unacceptable? Thanks.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,942 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 45,036 Reputation points Microsoft Employee
    2023-03-07T04:11:26.77+00:00

    Kieran Paton I think for the case where streaming completions call has at least one response filtered the JSON response will have a finish_reason of "content_filter" and for cases where all content passed content filters finish_reason will be either 'length' or 'stop' for each generated response.

    Some of the scenarios are explained on this page with more information. I hope this helps!!

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.