Skip to content

feat: per-request timeout and retry overrides #3

@0xneobyte

Description

@0xneobyte

Problem

timeout and max_retries are configured once at client initialization and apply globally to every request. There is no way to override them for individual calls. A developer querying a complex document may need a 60s timeout for that one call without affecting all other requests.

Proposed Behaviour

Each method accepts optional parameters to override the global defaults for that call only.

# Long timeout for one specific call, global default unchanged
response = await client.query("...", timeout=60.0, max_retries=0)
  • Overrides apply to that single call only
  • Supported parameters: timeout, max_retries
  • Global client config is never mutated

Files to Modify

File Change
src/brainus_ai/client.py Add optional timeout and max_retries kwargs to query(), get_usage(), get_plans()

Acceptance Criteria

  • query() accepts timeout and max_retries overrides
  • get_usage() and get_plans() accept the same overrides
  • Global client config is not affected by per-request overrides
  • Default behaviour when no overrides are passed is unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions