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%
813 B · 10 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# apply_patch: prints the structured create_file operation (nothing is applied). STATUS: LIVE_VERIFIED 2026-09-18 (gpt-5.4-nano).3# Run: bash examples/openai/tools/apply-patch/apply_patch.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":"Create a new file hello.txt containing the single line OK using apply_patch.",7 "tools":[{"type":"apply_patch"}],"tool_choice":{"type":"apply_patch"},"max_output_tokens":128,"reasoning":{"effort":"low"}}')8log_request openai POST /v1/responses "${OAI_STATUS:-200}" 0.0002 "apply_patch.sh"9echo "$R" | jq -c '.output[] | select(.type=="apply_patch_call") | {call_id, status, operation}'10