import CodeBlock from "@theme/CodeBlock";
import TimeoutExample from "@examples/agents/agent_timeout.ts";

# Adding a timeout

By default, LangChain will wait indefinitely for a response from the model provider. If you want to add a timeout to an agent, you can pass a `timeout` option, when you run the agent. For example:

<CodeBlock language="typescript">{TimeoutExample}</CodeBlock>