Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Conversation

@lc-arjun
Copy link
Contributor

@lc-arjun lc-arjun commented Jun 10, 2025

This PR does a few things:

  1. fixes the server to actually support the x-pagination-total header
  2. updates assistants search to return this header (already was included in threads search but not assistants)
  3. includes flag for if langsmith tracing is enabled

all these are supported in the python server

@lc-arjun lc-arjun changed the title feat: pagination and tracing fix: pagination and tracing Jun 10, 2025
];

// Return true unless explicitly disabled
return !tracingVars.some((val) => val === "false" || val === "False");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For in-mem server wouldn't it be opt-in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic is the same as how we do it in python server. tracing is only disabled if you explicitly set langsmith_tracing or any of the variants to false or if you dont have an api key defined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's opt-in:

TRACING = (
    env("LANGCHAIN_TRACING_V2", cast=bool, default=None)
    or env("LANGCHAIN_TRACING", cast=bool, default=None)
    or env("LANGSMITH_TRACING_V2", cast=bool, default=None)
    or env("LANGSMITH_TRACING", cast=bool, default=None)
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless i'm misreading (which happens a lot)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic is admittedly a bit hard to reason about but in the block above that we do:

if (
    LANGSMITH_API_KEY
    and not getenv("LANGCHAIN_TRACING_V2")
    and not getenv("LANGCHAIN_TRACING")
    and not getenv("LANGSMITH_TRACING_V2")
    and not getenv("LANGSMITH_TRACING")
):
    environ["LANGCHAIN_TRACING_V2"] = "true"

so if they have not set a value for langsmith_tracing but have an api key, it gets set to true

@lc-arjun lc-arjun merged commit 27c7a85 into main Jun 10, 2025
27 of 28 checks passed
@lc-arjun lc-arjun deleted the arjun/server_improvements branch June 10, 2025 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants