- create - Create presigned URL for file upload
- create_batch - Create presigned URLs for batch file upload
Generate a presigned URL for uploading a single file to the specified namespace.
from agentset import Agentset
with Agentset(
namespace_id="ns_123",
token="AGENTSET_API_KEY",
) as a_client:
res = a_client.uploads.create(file_name="document.pdf", content_type="application/pdf", file_size=1024)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
file_name |
str |
✔️ |
File name |
document.pdf |
content_type |
str |
✔️ |
Content type |
application/pdf |
file_size |
float |
✔️ |
File size in bytes |
1024 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.CreateUploadResponse
| Error Type |
Status Code |
Content Type |
| errors.BadRequestError |
400 |
application/json |
| errors.UnauthorizedError |
401 |
application/json |
| errors.ForbiddenError |
403 |
application/json |
| errors.NotFoundError |
404 |
application/json |
| errors.ConflictError |
409 |
application/json |
| errors.InviteExpiredError |
410 |
application/json |
| errors.UnprocessableEntityError |
422 |
application/json |
| errors.RateLimitExceededError |
429 |
application/json |
| errors.InternalServerError |
500 |
application/json |
| errors.AgentsetDefaultError |
4XX, 5XX |
*/* |
Generate presigned URLs for uploading multiple files to the specified namespace.
from agentset import Agentset
with Agentset(
namespace_id="ns_123",
token="AGENTSET_API_KEY",
) as a_client:
res = a_client.uploads.create_batch(files=[])
# Handle response
print(res)
models.CreateBatchUploadResponse
| Error Type |
Status Code |
Content Type |
| errors.BadRequestError |
400 |
application/json |
| errors.UnauthorizedError |
401 |
application/json |
| errors.ForbiddenError |
403 |
application/json |
| errors.NotFoundError |
404 |
application/json |
| errors.ConflictError |
409 |
application/json |
| errors.InviteExpiredError |
410 |
application/json |
| errors.UnprocessableEntityError |
422 |
application/json |
| errors.RateLimitExceededError |
429 |
application/json |
| errors.InternalServerError |
500 |
application/json |
| errors.AgentsetDefaultError |
4XX, 5XX |
*/* |