SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
14 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
1.4 KB · 20 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# STATUS: see examples/manifest-openai-agents.json — POST /v1/agents/environments/templates (hosted-sandbox config, no compute started), GET, DELETE.3set -euo pipefail4cd "$(dirname "$0")/../../.."; source scripts/lib.sh5out=$(mktemp); trap 'rm -f "$out"' EXIT6B=(-H "OpenAI-Beta: agents=v1")7oai POST /v1/agents/environments/templates "${B[@]}" -d '{8  "name": "atlas-example-template",9  "packages": {"python": ["pandas==2.2.3"], "system": [], "npm": []},10  "setup_commands": [{"command": "mkdir -p /workspace/outputs"}],11  "network": {"access": "restricted", "allowed_domains": ["pypi.org", "files.pythonhosted.org"]},12  "env": {"ATLAS": "1"}, "files": [{"type": "inline", "path": "/workspace/README.md", "data": "IyBBdGxhcwo="}]}' > "$out"; body=$(cat "$out")13log_request openai POST /v1/agents/environments/templates "$OAI_STATUS" 0 "example environment_template_create.sh"14echo "HTTP $OAI_STATUS"; echo "$body" | mask15tid=$(printf '%s' "$body" | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')16oai GET "/v1/agents/environments/templates/$tid" "${B[@]}" > "$out"; mask < "$out"17log_request openai GET "/v1/agents/environments/templates/{id}" "$OAI_STATUS" 0 "example environment_template_create.sh"18oai DELETE "/v1/agents/environments/templates/$tid" "${B[@]}" > "$out"; mask < "$out"; echo "HTTP $OAI_STATUS"19log_request openai DELETE "/v1/agents/environments/templates/{id}" "$OAI_STATUS" 0 "example environment_template_create.sh"20