Hello Jeremy Borg,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you would like to access file generated by code interpreter.
Follow these four steps for AI Hub Projects, not AI Foundry. https://free.blessedness.top/en-us/azure/ai-foundry/openai/how-to/code-interpreter
A. Modify your Python code to explicitly save the CSV file and return it as a downloadable object. For an example:
import pandas as pd
df = pd.DataFrame(data)
df.to_csv("output.csv", index=False)
return "output.csv"
This is to make sure the agent is configured to return file references.
B. Use FileReferenceContent or StreamingFileReferenceContent in AI Hub, files are returned as part of the assistant's response. So, use the SDK to extract file references:
foreach (var chunk in agent.InvokeStreamingAsync(message, thread))
{
var fileIds = chunk.Items.OfType<StreamingFileReferenceContent>().Select(f => f.FileId);
foreach (var id in fileIds)
{
var file = fileClient.GetFile(id);
var data = await fileClient.DownloadFileAsync(id);
File.WriteAllBytes($"downloads/{file.Filename}", data.ToArray());
}
}
For a similar accepted answer on this platform, see - https://free.blessedness.top/en-us/answers/questions/2288698/how-to-download-files-generated-by-the-code-interp
C. Make sure you're using the correct SDK for AI Hub (not AI Foundry). - https://free.blessedness.top/en-us/azure/ai-foundry/agents/how-to/tools/code-interpreter
D. If SDK fails, manually export CSV from the AI Foundry Playground (if available).
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.