SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
13 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
812 B · 10 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# Shell tool, LOCAL environment: prints the model's shell_call proposal; nothing is executed. STATUS: LIVE_VERIFIED 2026-09-18 (gpt-5.4-nano).3# Run: bash examples/openai/tools/shell/shell.sh4set -eo pipefail  # no -u: oai() runs in $(...) subshells, so OAI_STATUS may be unset in the parent5source "$(dirname "$0")/../../../../scripts/lib.sh"6R=$(oai POST /v1/responses -d '{"model":"gpt-5.4-nano","input":"Propose the shell command `echo OK`. Do not explain.",7 "tools":[{"type":"shell","environment":{"type":"local"}}],"tool_choice":{"type":"shell"},"max_output_tokens":64,"reasoning":{"effort":"low"}}')8log_request openai POST /v1/responses "${OAI_STATUS:-200}" 0.0001 "shell.sh local"9echo "$R" | jq -c '.output[] | select(.type=="shell_call") | {call_id, action, environment, status}'10