The prompt your SDK sends is not the prompt you wrote
The article discusses the challenges faced when the SDK does not send the expected prompt. The author created a tool called agenttap to intercept and analyze the actual JSON requests sent by the SDK. This tool helps identify discrepancies between the intended and actual requests, improving debugging for AI interactions.
- ▪The author encountered issues where the SDK modified the request body unexpectedly.
- ▪Agenttap captures the full request details, including URL, headers, and body, for analysis.
- ▪The tool allows users to replay and diff requests to identify changes and regressions.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3915555) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Mukunda Rao Katta Posted on May 21 The prompt your SDK sends is not the prompt you wrote #hermesagent #ai #llm #python A reply from Claude came back nonsense. The system prompt looked fine in my code. The messages looked fine in my logs. So I added a print(messages) right before client.messages.create(...). Still fine. I was looking in the wrong place. The SDK was building the request body. What hit the wire was not what I was printing.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).