No content in response using openai.azure.com

hello. I ocassionally encounter this issue that no content exists in the response.
May I ask the reason ?

Thanks.

openai.api_key = MY_OPENAI_KEY
openai.api_base = "https://lge-chatgpt-002.openai.azure.com/"
openai.api_type = 'azure'
openai.api_version = '2023-09-01-preview'

messages = [{'role': 'system', 'content': '\nYou are web shopping.\nI will give you instructions about what to do.\nYou have to follow the instructions.\nEvery round I will give you an observation and a list of available actions,\nyou have to respond an action based on the state and instruction.\n\nYou can use search action if search is available.\nYou can click one of the buttons in clickables.\nYou can think and the system will not execute your thinking process.\n\nAn action should be of the following structure:\nsearch[keywords]\nclick[value]\nthink[logic process]\n\nOtherwise, your action is invalid and you should avoid that.\nTry to avoid generating texts which cause [invalid response] from the user. \n\nKeywords in search are up to you, but the value in click must be a value in the list of available actions.\nRemember that your keywords in search should be carefully designed.\n'}, 
            {'role': 'user', 'content': '\nWebshop \nInstruction:  \ni would like a 3 ounce bottle of bright citrus deodorant for sensitive skin, and price lower than 50.00 dollars \n[Search]\n'}, 
            {'role': 'assistant', 'content': '\nsearch[3 ounce bright citrus deodorant sensitive skin]\n'}, 
            {'role': 'user', 'content': ' \n[Back to Search] \nPage 1 (Total results: 50) \n[Next >] \n[B078GWRC1J] \nBright Citrus Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and Breastfeeding, Contains Organic Calendula 3-Ounce \n$10.99 \n[B078GTKVXY] \nGinger Fresh Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and Breastfeeding, Contains Organic Calendula 3-Ounce \n$10.99 \n[B08KBVJ4XN] \nBarrel and Oak - Aluminum-Free Deodorant, Deodorant for Men, Essential Oil-Based Scent, 24-Hour Odor Protection, Cedar & Patchouli Blend, Gentle on Sensitive Skin (Mountain Sage, 2.7 oz, 2-Pack) \n$15.95 \n'}, 
            {'role': 'assistant', 'content': '\nthink[B078GWRC1J and B078GTKVXY are bright citrus deodorant less then 50 dollars. I can check B078GWRC1J first.]\n'}, 
            {'role': 'user', 'content': '\nOK.\n'}, 
            {'role': 'assistant', 'content': '\nclick[B078GWRC1J]\n'}, 
            {'role': 'user', 'content': '\n[Back to Search] \n[< Prev] \nscent [assorted scents][bright citrus][calming lavender][ginger fresh][simply non-scents]\nsize [travel set (4-pack)][3 ounce (pack of 1)][3-ounce (2-pack)]\nBright Citrus Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and Breastfeeding, Contains Organic Calendula 3-Ounce \nPrice: $10.99 \nRating: N.A. \n[Description] \n[Features] \n[Reviews] \n[Attributes] \n[Buy Now]  \n'}, 
            {'role': 'assistant', 'content': "\nthink[For 3 ounce bottle of bright citrus deodorant for sensitive skin, the item has options 'bright citrus' and '3 ounce (pack of 1)' and seems good to buy.]\n"}, 
            {'role': 'user', 'content': '\nOK.\n'}, {'role': 'assistant', 'content': '\nclick[bright citrus]\n'}, 
            {'role': 'user', 'content': '\nYou have clicked bright citrus.\n'},
            {'role': 'assistant', 'content': '\nclick[3 ounce (pack of 1)]\n'}, 
            {'role': 'user', 'content': '\nYou have clicked 3 ounce (pack of 1). \n'}, 
            {'role': 'assistant', 'content': '\nclick[Buy Now]\n'}, 
            {'role': 'user', 'content': '\nWebShop \nInstruction:  \ni am interested in buying pullover for women which is machine washable and have women christmas gifts-a153-khaki color, and of size 3x-large, and price lower than 60.00 dollars \n[Search] '}, 
            {'role': 'assistant', 'content': 'search[women pullover machine washable christmas gifts-a153-khaki 3x-large]'}, 
            {'role': 'user', 'content': "\n[Back to Search] \nPage 1 (Total results: 50) \n[Next >] \n[B09L1JYY7R] \nWomen Button Cowl Neck Sweaters Chunky Knit Long Sleeve Asymmetric Wrap Pullover Sweater Jumper Tops Fall Sweatshirt \n$10.85 to $23.42 \n[B09L4TPVSV] \nNaRHbrg Plus Size Women Tunic Tops for Leggings Christmas Graphic Print Shirt Casual Long Sleeve Blouse Holiday T Shirts \n$3.99 to $11.99 \n[B08M6C7FWX] \nAODONG Sweaters for Women,Women's Casual Turtlek Neck Asymmetric Hem Wrap Color Block Button Pullover Chunky Knit Sweater \n$3.48 to $10.99 "}, 
            {'role': 'assistant', 'content': "think[B09L1JYY7R is a women's pullover with machine washable and in khaki color. I can check it first.]"}, 
            {'role': 'user', 'content': 'OK.'}, 
            {'role': 'assistant', 'content': 'click[B09L1JYY7R]'}, 
            {'role': 'user', 'content': '\n[Back to Search] \n[< Prev] \ncolor [women christmas gifts-a135-army green][women christmas gifts-a136-beige][women christmas gifts-a137-blue][women christmas gifts-a138-brown][women christmas gifts-a139-navy][women christmas gifts-a143-red][women christmas gifts-a144-brown][women christmas gifts-a146-khaki][women christmas gifts-a147-army green][women christmas gifts-a148-black][women christmas gifts-a149-blue][women christmas gifts-a150-dark blue][women christmas gifts-a151-green][women christmas gifts-a152-gray][women christmas gifts-a153-khaki][women christmas gifts-a154-navy][women christmas gifts-a155-wine][women christmas gifts-a156-white][women christmas gifts-a157-yellow][women christmas gifts-a140-red][women christmas gifts-a142-brown][women christmas gifts-a145-gray][women christmas gifts-a140-blue2][women christmas gifts-a161-black][women christmas gifts-a162-green][women christmas gifts-a163-red][women christmas gifts-a164-blue][women christmas gifts-a165-yellow][women christmas gifts-a166-dark gray][women christmas gifts-a167-gray][women christmas gifts-a168-pink][women christmas gifts-a133-black][women christmas gifts-a134-khaki][women christmas gifts-a143-black2][women christmas gifts-a160-brown]\nsize [small][medium][large][x-large][xx-large][3x-large]\nWomen Button Cowl Neck Sweaters Chunky Knit Long Sleeve Asymmetric Wrap Pullover Sweater Jumper Tops Fall Sweatshirt \nPrice: $10.85 to $23.42 \nRating: N.A. \n[Description] \n[Features] \n[Reviews] \n[Attributes] \n[Buy Now] '}, 
            {'role': 'assistant', 'content': "think[For a women's pullover in khaki color and size 3x-large, the item 'Women Button Cowl Neck Sweaters Chunky Knit Long Sleeve Asymmetric Wrap Pullover Sweater Jumper Tops Fall Sweatshirt' seems suitable.]"}, 
            {'role': 'user', 'content': 'OK.'}, 
            {'role': 'assistant', 'content': 'click[women christmas gifts-a153-khaki]'}, 
            {'role': 'user', 'content': 'You have clicked women christmas gifts-a153-khaki.'}]

token_cnt_tiktoken = openai_func.tiktoken_usage(messages)
print(token_cnt_tiktoken)

response = openai.ChatCompletion.create(  # type: ignore
          engine = "gpt-35-turbo",
          model='gpt-3.5-turbo-1106',
          messages=messages,
          temperature=1.0,
          max_tokens=385,
          top_p=0.9,
          stop= None,
          #seed=777
      )

answer: str = response["choices"][0]["message"]['content']
print(answer)

'''
<OpenAIObject chat.completion id=chatcmpl-8kxX1bmS69Pxf1UF9CgOlCNFdf48p at 0x7f8652bf6540> JSON: {
  "id": "chatcmpl-8kxX1bmS69Pxf1UF9CgOlCNFdf48p",
  "object": "chat.completion",
  "created": 1706202619,
  "model": "gpt-35-turbo",
  "prompt_filter_results": [
    {
      "prompt_index": 0,
      "content_filter_results": {
        "hate": {
          "filtered": false,
          "severity": "safe"
        },
        "self_harm": {
          "filtered": false,
          "severity": "safe"
        },
        "sexual": {
          "filtered": false,
          "severity": "safe"
        },
        "violence": {
          "filtered": false,
          "severity": "safe"
        }
      }
    }
  ],
  "choices": [
    {
      "finish_reason": "content_filter",
      "index": 0,
      "message": {
        "role": "assistant"
      },
      "content_filter_results": {
        "hate": {
          "filtered": false,
          "severity": "safe"
        },
        "self_harm": {
          "filtered": false,
          "severity": "safe"
        },
        "sexual": {
          "filtered": true,
          "severity": "medium"
        },
        "violence": {
          "filtered": false,
          "severity": "safe"
        }
      }
    }
  ],
  "usage": {
    "prompt_tokens": 1508,
    "completion_tokens": 6,
    "total_tokens": 1514
  }
}
'''

because of the filteration ?

I’ve not used Azure, but I think that’s a safe bet.

Until someone who’s used Azure can chime in, you might look back at one of the other responses you’ve gotten without any content and check the filtered status to see if it’s a common attribute.

But, I think it’s safe to assume this is the answer.