Remove non-existent purpose field from Files API examples (#1081)

The Files API upload endpoint does not accept a purpose parameter.
Drop it from the managed-agents skill examples (TS and curl).
This commit is contained in:
Lance Martin
2026-05-03 06:58:40 -07:00
committed by GitHub
parent 5128e1865d
commit d230a6dd6e
4 changed files with 2 additions and 5 deletions

View File

@@ -248,8 +248,7 @@ curl -X POST https://api.anthropic.com/v1/files \
-H "x-api-key: $ANTHROPIC_API_KEY" \ -H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \ -H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: files-api-2025-04-14" \ -H "anthropic-beta: files-api-2025-04-14" \
-F "file=@path/to/file.txt" \ -F "file=@path/to/file.txt"
-F "purpose=agent"
``` ```
--- ---

View File

@@ -168,7 +168,7 @@ The `Promise.all([stream, send])` shape works too, but stream-first is simpler a
**The mounted resource has a different `file_id` than the file you uploaded.** Session creation makes a session-scoped copy. **The mounted resource has a different `file_id` than the file you uploaded.** Session creation makes a session-scoped copy.
```ts ```ts
const uploaded = await client.beta.files.upload({ file, purpose: 'agent_resource' }) const uploaded = await client.beta.files.upload({ file })
// uploaded.id → the original file // uploaded.id → the original file
const session = await client.beta.sessions.create({ const session = await client.beta.sessions.create({
/* ... */ /* ... */

View File

@@ -63,7 +63,6 @@ Upload a file first via the Files API, then reference by `file_id` + `mount_path
// 1. Upload // 1. Upload
const file = await client.beta.files.upload({ const file = await client.beta.files.upload({
file: fs.createReadStream("data.csv"), file: fs.createReadStream("data.csv"),
purpose: "agent",
}); });
// 2. Attach as a session resource // 2. Attach as a session resource

View File

@@ -273,7 +273,6 @@ import fs from "fs";
const file = await client.beta.files.upload({ const file = await client.beta.files.upload({
file: fs.createReadStream("data.csv"), file: fs.createReadStream("data.csv"),
purpose: "agent",
}); });
// Use in a session // Use in a session