Skip to content

[Python] Request timeout is not implemented #398

@YevSent

Description

@YevSent

Bug Description

The Python Hindsight client accepts timeout parameter which is not enforced. Looking at the client implementation detail https://github.com/vectorize-io/hindsight/blob/main/hindsight-clients/python/hindsight_client/hindsight_client.py#L69, timeout argument is never used.

Steps to Reproduce

  1. Create a Hindsight client object with any custom timeout, for example 10 seconds.
from hindsight_client import Hindsight

client = Hindsight(base_url="http://localhost:8889", timeout=10.0)
  1. Try calling the Hindsight endpoint which is not responsible, for instance with a non-default port.
response = client.recall(bank_id="alice", query="What does Alice like?")

Expected Behavior

Since the endpoint is not responsible, the request should timeout in 10 seconds as configured

Actual Behavior

The request doesn't timeout under 10 seconds.

Version

0.4.11

LLM Provider

None

The current workaround is to wrap the client calls with a custom timeout handler, for instance asyncio for async calls:

results = await asyncio.wait_for(
    client.arecall(
        bank_id="alice",
        query="What does Alice like?",
        types=["world"],
    ),
    timeout=10.0,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions