from cerebras.cloud.sdk import Cerebras
import os
client = Cerebras(
api_key=os.environ.get("CEREBRAS_API_KEY"),
)
files = client.files.list(limit=20)
print(files)
{
"object": "list",
"data": [
{
"id": "file_123",
"object": "file",
"bytes": 1048576,
"filename": "batch-requests.jsonl",
"created_at": 1726315200,
"expires_at": 1726920000,
"purpose": "batch"
},
{
"id": "file_124",
"object": "file",
"bytes": 2097152,
"created_at": 1726315200,
"expires_at": 1726920000,
"filename": "batch-results.jsonl",
"purpose": "batch"
}
],
"has_more": false
}
from cerebras.cloud.sdk import Cerebras
import os
client = Cerebras(
api_key=os.environ.get("CEREBRAS_API_KEY"),
)
files = client.files.list(limit=20)
print(files)
{
"object": "list",
"data": [
{
"id": "file_123",
"object": "file",
"bytes": 1048576,
"filename": "batch-requests.jsonl",
"created_at": 1726315200,
"expires_at": 1726920000,
"purpose": "batch"
},
{
"id": "file_124",
"object": "file",
"bytes": 2097152,
"created_at": 1726315200,
"expires_at": 1726920000,
"filename": "batch-results.jsonl",
"purpose": "batch"
}
],
"has_more": false
}
20100[file-abc123, file-def456, file-jkl789, file-mno123] and pass after=file-def456, the response will return [file-jkl789, file-mno123].list.Show file properties
file.batch).from cerebras.cloud.sdk import Cerebras
import os
client = Cerebras(
api_key=os.environ.get("CEREBRAS_API_KEY"),
)
files = client.files.list(limit=20)
print(files)
{
"object": "list",
"data": [
{
"id": "file_123",
"object": "file",
"bytes": 1048576,
"filename": "batch-requests.jsonl",
"created_at": 1726315200,
"expires_at": 1726920000,
"purpose": "batch"
},
{
"id": "file_124",
"object": "file",
"bytes": 2097152,
"created_at": 1726315200,
"expires_at": 1726920000,
"filename": "batch-results.jsonl",
"purpose": "batch"
}
],
"has_more": false
}
Was this page helpful?