aixplain File Manager
aixplain File Manager is an aixplain-managed utility tool that saves files and text into your workspace storage and returns a hosted download URL and resource ID for each item. Use it to persist an agent's outputs — generated documents, reports, datasets — so they can be downloaded or reused later, instead of returning raw content inline.
View the asset on the aixplain Marketplace.
Setup
from aixplain import Aixplain
aix = Aixplain(api_key="<AIXPLAIN_API_KEY>")
Get the tool
aixplain File Manager is a built-in utility, so you fetch it by ID rather than connecting it. There is no OAuth step and no config payload.
FILE_MANAGER_ID = "6a0216cffb2a801f1c41e32e"
file_manager = aix.Tool.get(FILE_MANAGER_ID)
print("Name:", file_manager.name)
print("Description:", file_manager.description)
You can also discover it with aix.Tool.search("file manager").
Available Actions
| Action | Description |
|---|---|
save_content | Save one or more pieces of text as files |
save_files | Save one or more existing files into storage by URL |
Each action takes a data payload. The inputs per action:
| Action | Input | Required | Notes |
|---|---|---|---|
save_content | contents | Yes | List of strings — one file is created per string |
save_content | names | Yes | List of file names, one per content item |
save_content | tags | No | Optional list of tags to attach to the resources |
save_files | urls | Yes | List of source file URLs to ingest |
save_files | names | No | List of file names, one per URL |
save_files | tags | No | Optional list of tags to attach to the resources |
Every successful call returns a list with one entry per item, each containing the resource id, the name, and a signedUrl (a time-limited download link).
Save text content
Write one or more strings to storage and get back a hosted link for each.
result = file_manager.run(
action="save_content",
data={
"contents": ["Q3 revenue summary: total $1.2M, up 14% QoQ."],
"names": ["q3_summary.txt"],
},
)
print(result.data)
Save files by URL
Ingest existing files by URL into your workspace storage.
result = file_manager.run(
action="save_files",
data={
"urls": ["https://your-source.example.com/report.pdf"],
"names": ["report.pdf"],
},
)
print(result.data)
On failure, the item is returned with an error field instead of an id/signedUrl:
[{'url': 'https://...', 'name': 'report.pdf', 'error': 'Failed to create file resource'}]
save_files ingests URLs that aixplain can reach. Source URLs that are not reachable from the platform return Failed to create file resource. For content you generate at runtime, use save_content instead of writing the content to an external URL first.