from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# Get a file from a skill (text files return content, binary files return URL)
file_resp = client.skills.get_file(
skill_id='skill-uuid-here',
file_path='scripts/main.py',
expire=1800 # URL expires in 30 minutes
)
print(f"File: {file_resp.path} ({file_resp.mime})")
if file_resp.content:
print(f"Content: {file_resp.content.raw}")
if file_resp.url:
print(f"Download URL: {file_resp.url}"){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"content": {
"raw": "<string>",
"type": "<string>"
},
"mime": "<string>",
"path": "<string>",
"url": "<string>"
}
}Get file content or download URL from agent skill. If the file is text-based (parseable), returns parsed content. Otherwise, returns a presigned download URL.
from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# Get a file from a skill (text files return content, binary files return URL)
file_resp = client.skills.get_file(
skill_id='skill-uuid-here',
file_path='scripts/main.py',
expire=1800 # URL expires in 30 minutes
)
print(f"File: {file_resp.path} ({file_resp.mime})")
if file_resp.content:
print(f"Content: {file_resp.content.raw}")
if file_resp.url:
print(f"Download URL: {file_resp.url}"){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"content": {
"raw": "<string>",
"type": "<string>"
},
"mime": "<string>",
"path": "<string>",
"url": "<string>"
}
}Project Bearer token (e.g., "Bearer sk-ac-xxxx")
Agent skill UUID
File path within the skill (e.g., 'scripts/extract_text.json')
URL expiration in seconds for presigned URL (default 900)