Grokking Agentic Design Patterns
0% completed
Designing for Portability: Keeping the Pattern Independent of the Vendor
The center of a Desk loop appears below, with four comments marking the places where the agent's code depends on one vendor's API:
const reply = vendorA.createMessage({ model: "vendor-a-large", // 1. A model name inside the loop tools: deskToolsInVendorAFormat, // 2. Tool definitions in this vendor's format messages: historyInVendorAFormat // 3. A history in this vendor's format }) if (reply.stop_reason === "tool_use") { // 4. This vendor's stop value for (const block of reply.content) { if (block.type === "tool_use") runTool(block) } }
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%