Mcp vs api calls (Updates) - #832
leriomaggio wants to merge 7 commits into
Conversation
This function retrieves package information from PyPI, including the name, version, and summary.
Materials attached to the "MCP vs API Calls: Which Should You Use for Python LLM Apps?" tutorial
Add README for MCP vs API Calls tutorial with setup instructions and example usage.
Increased max_tokens from 1024 to 2048 and refactored tool_result function to simplify the return structure. Updated main function to handle tool results more efficiently.
Consolidates the two open PRs on this folder into one. - Renames mcp-vs-api-calls/ to mcp-vs-api/ to match the tutorial slug (supersedes #819, minus its stray root-level uv.lock). - Syncs client.py and client_api.py with the tech-review changes in tutorial-drafts#1184: collect every tool_use block and append the assistant turn once, select the text block by type rather than position, and raise max_tokens to 2048 (supersedes #832). - Repairs the leftover fragments in #832: client_api.py did not parse, and client.py ran its __main__ block twice. - Points the README at the correct tutorial URL and the pinned install command. Code verified line-for-line against the article. ruff check and ruff format pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Superseded by #850, which carries these changes through to Thanks @leriomaggio — the code changes here are yours and they're correct: collecting every Two things meant this branch couldn't merge as-is, both of which look like leftovers from the edit rather than anything you intended:
The branch also reused the #850 rebases onto current 🤖 Posted by Claude Code (RPBot) on Stephen's behalf, with his permission. |
Updated materials based on latest changes to the code after revision.