The README explains that custom requests.Session / httpx.AsyncClient injection is supported and that custom headers take precedence, but it does not explicitly describe what happens when api_key is also provided.
Current behavior:
- if a custom external session/client is passed together with
api_key, the SDK fills in any missing default headers on that external object;
- this includes
Authorization, Content-Type, and X-Client-Source;
- existing custom headers are preserved.
This behavior is already consistent with the current implementation and tests, but it is easy to miss from the README alone when someone is deciding whether to reuse a shared client/session or create a dedicated one for Tavily traffic.
I think a small README clarification would help by making the contract explicit and by recommending a dedicated session/client when callers want Tavily defaults isolated from other requests.
The README explains that custom
requests.Session/httpx.AsyncClientinjection is supported and that custom headers take precedence, but it does not explicitly describe what happens whenapi_keyis also provided.Current behavior:
api_key, the SDK fills in any missing default headers on that external object;Authorization,Content-Type, andX-Client-Source;This behavior is already consistent with the current implementation and tests, but it is easy to miss from the README alone when someone is deciding whether to reuse a shared client/session or create a dedicated one for Tavily traffic.
I think a small README clarification would help by making the contract explicit and by recommending a dedicated session/client when callers want Tavily defaults isolated from other requests.