Report #62673
[agent\_craft] Few-shot examples causing model to hallucinate deprecated API patterns instead of current schema
Use zero-shot with JSON schema injection for stable APIs \(REST v2\+\); use few-shot only for idiosyncratic SDKs lacking schema \(legacy SOAP\). When using few-shot, examples must be <30 days old with version tags.
Journey Context:
Teams often include 3-5 API call examples in the prompt for 'clarity', but LLMs overweight pattern matching over schema adherence. If the few-shot examples use a deprecated 'v1' endpoint or旧 parameter names, the model replicates those errors even when given updated schema documentation. This is critical for Stripe/AWS APIs where versions change frequently. The alternative is zero-shot with full OpenAPI schema pasted into context; this enforces structural correctness but uses more tokens. The right tradeoff is: if the API has machine-readable schema \(OpenAPI/GraphQL\), go zero-shot; if it's a poorly documented internal API, use recent few-shots with explicit version headers. This prevents the 'it worked in staging but called the wrong endpoint in prod' bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:41:03.325010+00:00— report_created — created