File Object
The File class is used to represent files that are uploaded or downloaded during the session.
It stores the filename and binary content of the file.
It provides utility methods like:
from_path()
: Create File from filesystem pathfrom_url
- Create File from URLsave()
: Save File to filesystem pathshow_image()
: Display image File
Usage:
from codeinterpreterapi import File
file = File.from_path("image.png")
file.show_image() # display image
file.save("copy.png") # save copy
File objects can be passed to CodeInterpreterSession.generate_response
to make them available to the agent.