ワークアイテムを更新
POST/v1/environments/{environment_id}/work/{work_id}
注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。
マージセマンティクスでワークアイテムのメタデータを更新します。
Parameters
Returns
ワークアイテムを更新
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaSelfHostedWork, err := client.Beta.Environments.Work.Update(
context.TODO(),
"work_id",
anthropic.BetaEnvironmentWorkUpdateParams{
EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
BetaSelfHostedWorkUpdateRequest: anthropic.BetaSelfHostedWorkUpdateRequestParam{
Metadata: map[string]string{
"foo": "string",
},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}Response 200
{
"id": "id",
"acknowledged_at": "acknowledged_at",
"created_at": "created_at",
"data": {
"id": "id",
"type": "session"
},
"environment_id": "environment_id",
"latest_heartbeat_at": "latest_heartbeat_at",
"metadata": {
"foo": "string"
},
"secret": "secret",
"started_at": "started_at",
"state": "queued",
"stop_requested_at": "stop_requested_at",
"stopped_at": "stopped_at",
"type": "work"
}Returns Examples
Response 200
{
"id": "id",
"acknowledged_at": "acknowledged_at",
"created_at": "created_at",
"data": {
"id": "id",
"type": "session"
},
"environment_id": "environment_id",
"latest_heartbeat_at": "latest_heartbeat_at",
"metadata": {
"foo": "string"
},
"secret": "secret",
"started_at": "started_at",
"state": "queued",
"stop_requested_at": "stop_requested_at",
"stopped_at": "stopped_at",
"type": "work"
}