Skip to content

docs: clarify custom session/client header defaults #164

Description

@shaun0927

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions