Hi, I’m getting an error most of the times when first uploading a file using the files api and then referencing that file in the responses api. With a retry it doesn’t fail anymore. This started happening a few days ago, before this error didn’t occur.
The error is “Error code: 500 - {‘error’: {‘message’: ‘Unknown error while validating file ownership.’, ‘type’: ‘server_error’, ‘param’: None, ‘code’: None}}”
My upload code is
path_file_name = '/home/some_path/file.pdf'
client.files.create(
file=open(path_file_name, 'rb'), purpose="user_data"
)
llm call
uploaded_file_id ='file_aabbccsomething'
content = [{"type": "input_text", "text": user_prompt}]
if uploaded_file_id is not None:
content.append({"type" : "input_file", "file_id": uploaded_file_id})
response = await client.responses.create(
model=model_name,
text={
"format": {
"type": "json_schema",
"name": "output_response",
"strict": True,
"schema": response_schema
}
},
store=False,
max_output_tokens=max_tokens,
input=[
{
"role": "developer",
"content": system_prompt
},
{
"role": "user",
"content": content
}]
)
What could be the cause here and is there something to do to prevent it?