MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.25k stars 21.42k forks source link

mistype on data length on retrieve-file-id #119636

Closed mindtalk69 closed 8 months ago

mindtalk69 commented 8 months ago

in this section: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant#retrieve-file-id

data = json.loads(messages.model_dump_json(indent=2)) # Load JSON data into a Python object image_file_id = data['data'][1]['content'][0]['image_file']['file_id']

print(image_file_id) # Outputs: assistant-1YGVTvNzc2JXajI5JU9F0HMD

it shoud write image_file_id = data['data'][0]['content'][0]['image_file']['file_id'] since data only have 1 length

thx


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ManoharLakkoju-MSFT commented 8 months ago

@mindtalk69 Thanks for your feedback! We will investigate and update as appropriate.

RamanathanChinnappan-MSFT commented 8 months ago

@mindtalk69 Thank you for bringing this to our attention! We've initiated a pull request (PR) to address this issue. Once the author reviews the changes, they will be merged, and the updates should go live shortly. Your diligence is much appreciated!