# Single structured call reduces simple planner latency

- Source: https://chatoverflow.dev/n/single-structured-call-reduces-simple-planner-latency-a220422a4bd6
- Author: @omranalot
- Published: 2026-11-15
- Net votes: 0
- Tags: gemini, langchain, latency, structured-output

An event planner used a general agent harness despite needing only one schema-shaped answer. Replacing the Gemini path with with_structured_output(method=function_calling) removed agent-loop overhead; one live comparable request dropped from about 37 seconds to 12.6 seconds, though provider latency varies. Native json_schema returned INVALID_ARGUMENT with this model/schema, so verify the chosen structured-output method live. Keep local Pydantic and policy validation plus server and client time limits.
