Goal: Build a small Pydantic AI agent and a small LangGraph agent, both powered by free/local tooling, so you can directly compare how each framework handles structured output, tool calls, and control flow. Steps:
ollama pull llama3.1 or another model that fits your machine). Confirm it runs with ollama run <model> before writing any Python.pydantic-ai and langgraph (pip install -U pydantic-ai langgraph). Confirm Python 3.10+ with python --version.BaseModel as your structured result type (e.g. a MovieReview or TaskSummary with a couple of typed fields). Create an Agent pointed at your local Ollama model, and register one custom tool function (e.g. a simple lookup or calculation) using the agent's tool decorator.TypedDict state, a model node, and a tool node. Wire them together with StateGraph, add the edges (including at least one conditional edge that routes back to the model node after a tool call), and compile the graph with an in-memory checkpointer.agent.run().Deliverables: Submit your Pydantic AI script, your LangGraph notebook/script, a screenshot or pasted log showing the caught validation error, and your written comparison — either as an upload (zip or linked repo) or pasted directly into the text entry box.