Configure timeouts for long-running converse requests.
Some converse calls may take longer to complete, especially when processing large files, complex prompts, or when the agent performs extensive tool use. By default, SDK requests timeout after 30 minutes. For long-running operations, you can increase the timeout to accommodate these scenarios.
Set a default timeout for all requests when initializing the client:
Copy
Ask AI
from datagrid_ai import Datagrid# Configure the default timeout for all requests (1 hour)client = Datagrid( timeout=60.0 * 60, # 1 hour in seconds)response = client.converse(prompt="Analyze this large dataset")
from datagrid_ai import Datagridclient = Datagrid()# Override timeout for a specific request (1 hour)response = client.with_options(timeout=60.0 * 60).converse( prompt="Process this complex task",)