"""Skeleton generated from the blueprint. It runs offline: model calls are stubs you replace.""" from typing import TypedDict from langgraph.graph import StateGraph class State(TypedDict): request: str trace: list def call_model(step: str, model: str, state: State) -> str: # Replace with your model client. Keep the step name and model for tracing. return f"[{step} via {model or 'a model'}] {state['request']}" def rewrite(state: State) -> State: # Query rewriter (claude-haiku-4-5) output = call_model('rewrite', 'claude-haiku-4-5', state) return {"request": output, "trace": state["trace"] + ['rewrite']} def answer(state: State) -> State: # Answer writer (claude-haiku-4-5) output = call_model('answer', 'claude-haiku-4-5', state) return {"request": output, "trace": state["trace"] + ['answer']} graph = StateGraph(State) graph.add_node("rewrite", rewrite) graph.add_node("answer", answer) graph.set_entry_point("rewrite") graph.add_edge("rewrite", "answer") graph.set_finish_point("answer") app = graph.compile() def run(request: str) -> State: return app.invoke({"request": request, "trace": []}) if __name__ == "__main__": print(run("hello"))