Hello,
This is a feature request. I’ve been playing with latest structured outputs feature particularly using python with pydantic. I love it.
Currently, a refusal from the model means there is unsafe input/output. In my use case, I would like the model to refuse to process the request for various reasons (e.g.: Using vison API, when there is nothing to see in the image).
For example:
completion = client.beta.chat.completions.parse(
model="gpt-4o-2024-08-06",
response_format=Ticket,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Extract the necessary information from the image. Format your response in JSON. If no information can be extracted, refuse to process the request.",
},
{
"type": "image_url",
"image_url": {"detail": "auto", "url": image.file},
},
],
}
],
)