Azure / Azure/azure-sdk-for-python
Azure OpenAI Stored Completions does not store (AI Foundry)
- Lingua principale
- Python
- Stelle
- 5.6k
- Fork
- 3.4k
- Merge medio
- 2g
- PR unite (30g)
- 217
Descrizione
- **Package Name**: AZURE OpenAI
- **Package Version**: openai == 2.6.0
- **Operating System**: Windows Server 2025 Datacenter
- **Python Version**: 3.12
**Describe the bug**
If there is an image in the prompt encoded in base64, client.chat.completions.create() provides a chat completion ID when store = True, but retrieving the completion_id returns 404, and completion is not visible in the portal. This may be a feature request, but this is not documented so im reporting as a bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Define AzureOpenAI client:
`client = AzureOpenAI(
api_version=api_version,
azure_endpoint=endpoint,
api_key=subscription_key,
)`
I have tried many combinations of endpoints, API versions, and clients (ie. OpenAI(), AzureOpenAI()) All have this same issue.
2. Sample prompt with image and request a chat completion
```
test_image_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=="
messages = [
{
"role": "system",
"content": "You are a helpful assistant.",
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What color would you say this image is?"
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{test_image_base64}"
}
}
]
}
]
response = client.chat.completions.create(
messages=messages,
max_completion_tokens=13107,
temperature=1.0,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0,
model=deployment,
store=True,
metadata={
"user": "reviewbot",
"category": "testing-with-image",
}
)
response_message = response.choices[0].message
print(f"Response: {response_message.content}")
```
The response returns a completion ID, and completes successfully with no errors.
Stored completion does not appear in portal or via retrieval. When the image is not included in the request the chat completion stores successfully.
**Expected behavior**
I would expect that chats with images would be stored. I understand the issue with storage and a user could send huge images. If the user can fine-tune vision models, i'd think that images could be stored in stored completions.
FWIW the OpenAI API stores prompts with images and you can see the image when reviewing the completion in their portal. I'd want similar function in the AI Foundry portal
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the AzureOpenAI client.chat.completions.create entry point and the stored-completion retrieval flow described in the report. Reproduce the request with and without the base64 image, using the supplied API settings and payload, then compare the returned ID with portal visibility and retrieval. Done means the image-containing completion is stored and retrievable, or the limitation is clearly documented.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, cloud
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100