# How do I consistently get a GPT to show an image created via Code Interpreter?

**URL:** <https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209>\
**Category:** ChatGPT\
**Tags:** gpts\
**Created:** [November 25, 2023, 5:26pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209 "2023-11-25T17:26:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonmesmith](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@simonmesmith](https://community.openai.com/u/simonmesmith)\
**Post date:** [November 25, 2023, 5:26pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/1 "2023-11-25T17:26:34Z")

</div>

I’m creating [Diagram Genie](https://chat.openai.com/g/g-5D7kQMqjW-diagram-genie), a GPT that generates diagrams using Graphviz.

I can get the GPT to consistently generate a file for download. But I’d also like it to show the diagram inline, using a markdown image reference.

Unfortunately, I can’t consistently get it to both (1) generate a download link and (2) show the image inline.

Inline images need to reference a different URL, for user content, than the download link, and this seems to confuse the GPT.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![robert.jf.close](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/robert.jf.close/32/256952_2.png) [@robert.jf.close](https://community.openai.com/u/robert.jf.close)\
**Post date:** [December 13, 2023, 5:24pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/2 "2023-12-13T17:24:41Z")

</div>

I am also struggling with this, except I always want the image\_file returned. I have also not figured out how to retrieve the file when this is added to the text reply “Download the image” either.

---

<div class="post-metadata">

**Author:** ![robert.jf.close](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/robert.jf.close/32/256952_2.png) [@robert.jf.close](https://community.openai.com/u/robert.jf.close)\
**Post date:** [December 13, 2023, 6:01pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/3 "2023-12-13T18:01:51Z")

</div>

Actually, I now see that the file id is included in the annotation and I just use that to get the image. So now I just want it to stop offering the image in the text reply.

---

<div class="post-metadata">

**Author:** ![robert.jf.close](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/robert.jf.close/32/256952_2.png) [@robert.jf.close](https://community.openai.com/u/robert.jf.close)\
**Post date:** [December 13, 2023, 6:21pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/4 "2023-12-13T18:21:44Z")

</div>

Are you always able to get the annotations when a file is referenced in the text? What am I supposed to do with this message if there is no file ID included in the annotations? My annotations are empty.  
`{ "id": "msg_n4Tw0MdurPcCYGOMyYdkBeuW", "object": "thread.message", "created_at": 1702491022, "thread_id": "thread_v9CtLDXsXhBG6TTzd2Z22CwN", "role": "assistant", "content": [{ "type": "text", "text": { "value": "Here is the chart displaying the... :\n\n![name](sandbox:/mnt/data/name.png)", "annotations": [] } } ], "file_ids": [], "assistant_id": "asst_bqxCGppY3ZjVI0tK6ULUzh2K", "run_id": "run_Cu1VYGXDx5XjrbWQhPzVXsjv", "metadata": {} }`

---

<div class="post-metadata">

**Author:** ![simonmesmith](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@simonmesmith](https://community.openai.com/u/simonmesmith)\
**Post date:** [December 13, 2023, 6:54pm UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/5 "2023-12-13T18:54:00Z")

</div>

I think you’re referring to the Assistants API and I was referring to a GPT. Sorry, but I don’t think I can help with that issue ☹

---

<div class="post-metadata">

**Author:** ![marco.debenedictis](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/marco.debenedictis/32/448369_2.png) [@marco.debenedictis](https://community.openai.com/u/marco.debenedictis)\
**Post date:** [July 30, 2024, 9:41am UTC](https://community.openai.com/t/how-do-i-consistently-get-a-gpt-to-show-an-image-created-via-code-interpreter/526209/6 "2024-07-30T09:41:32Z")

</div>

under Assistant API I’ve the same issue, using **graphviz** library, so NO file\_id value, instead with **mathplot** library I received the file\_id in the message with type ‘image’ (or similar).  
Indeed graphviz are more actractive than mathplot.  
Any idea? is it a bug or what?
