mirror of
https://github.com/anthropics/skills.git
synced 2026-08-02 13:05:28 +08:00
Update claude-api skill: per-SDK doc split, code_execution_20260521, platform-availability, onboarding streamline (#1363)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
composer require "anthropic-ai/sdk"
|
||||
composer require "anthropic-ai/sdk" "guzzlehttp/guzzle:^7"
|
||||
```
|
||||
|
||||
## Client Initialization
|
||||
@@ -263,7 +263,14 @@ $client->beta->sessions->resources->delete($resource->id, sessionID: $session->i
|
||||
|
||||
## List and Download Session Files
|
||||
|
||||
> ℹ️ Listing and downloading files an agent wrote during a session is not yet documented for PHP in this skill or in the apps source examples. See `shared/managed-agents-events.md` and the `anthropic-ai/sdk` PHP repository for the file list/download bindings.
|
||||
```php
|
||||
$files = $client->beta->files->list(
|
||||
scopeID: 'sesn_abc123',
|
||||
betas: ['managed-agents-2026-04-01'],
|
||||
);
|
||||
$content = $client->beta->files->download($files->data[0]->id);
|
||||
file_put_contents('output.txt', $content);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -293,7 +300,7 @@ $client->beta->sessions->delete($session->id);
|
||||
```php
|
||||
use Anthropic\Beta\Agents\BetaManagedAgentsAgentToolset20260401Params;
|
||||
use Anthropic\Beta\Agents\BetaManagedAgentsMCPToolsetParams;
|
||||
use Anthropic\Beta\Agents\BetaManagedAgentsUrlmcpServerParams;
|
||||
use Anthropic\Beta\Agents\BetaManagedAgentsURLMCPServerParams;
|
||||
use Anthropic\Beta\Sessions\BetaManagedAgentsAgentParams;
|
||||
|
||||
// Agent declares MCP server (no auth here — auth goes in a vault)
|
||||
@@ -301,7 +308,7 @@ $agent = $client->beta->agents->create(
|
||||
name: 'GitHub Assistant',
|
||||
model: 'claude-opus-4-8',
|
||||
mcpServers: [
|
||||
BetaManagedAgentsUrlmcpServerParams::with(
|
||||
BetaManagedAgentsURLMCPServerParams::with(
|
||||
type: 'url',
|
||||
name: 'github',
|
||||
url: 'https://api.githubcopilot.com/mcp/',
|
||||
@@ -395,8 +402,8 @@ $session = $client->beta->sessions->create(
|
||||
[
|
||||
'type' => 'github_repository',
|
||||
'url' => 'https://github.com/org/repo',
|
||||
'mountPath' => '/workspace/repo',
|
||||
'authorizationToken' => 'ghp_your_github_token',
|
||||
'mount_path' => '/workspace/repo',
|
||||
'authorization_token' => 'ghp_your_github_token',
|
||||
],
|
||||
],
|
||||
);
|
||||
@@ -409,14 +416,14 @@ $resources = [
|
||||
[
|
||||
'type' => 'github_repository',
|
||||
'url' => 'https://github.com/org/frontend',
|
||||
'mountPath' => '/workspace/frontend',
|
||||
'authorizationToken' => 'ghp_your_github_token',
|
||||
'mount_path' => '/workspace/frontend',
|
||||
'authorization_token' => 'ghp_your_github_token',
|
||||
],
|
||||
[
|
||||
'type' => 'github_repository',
|
||||
'url' => 'https://github.com/org/backend',
|
||||
'mountPath' => '/workspace/backend',
|
||||
'authorizationToken' => 'ghp_your_github_token',
|
||||
'mount_path' => '/workspace/backend',
|
||||
'authorization_token' => 'ghp_your_github_token',
|
||||
],
|
||||
];
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user