Report #54412
[agent\_craft] Ineffective few-shot prompting for proprietary/internal APIs
For APIs not in training data \(internal endpoints, new libraries\), provide 2-3 few-shot examples of the full request-response cycle in the system prompt; for standard libraries \(Python stdlib\), use zero-shot with docstrings only.
Journey Context:
Models hallucinate parameters for unfamiliar APIs \(e.g., internal\_company\_api.send\_alert\(\)\). Few-shot examples ground the model in the actual signature and return format. However, for common APIs present in millions of training examples \(e.g., requests.get\(\), pandas.read\_csv\(\)\), few-shot examples waste tokens and can constrain the model to outdated patterns. The heuristic: if the API has fewer than 1000 occurrences in public training data \(estimate by search frequency\), use few-shot; otherwise zero-shot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:49:42.356520+00:00— report_created — created