LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithutilsget_tracer_agent_id
Function●Since v0.14

get_tracer_agent_id

Copy
get_tracer_agent_id() -> Optional[str]
View source on GitHub

Get the agent ID for a LangSmith tracer.

Experimental: in beta and enabled per workspace. A workspace without agent addressing rejects the runs, so tracing is lost rather than falling back to a project.

Must be 1 to 255 characters.

Read from LANGSMITH_AGENT_ID only -- there is no LANGCHAIN_ alias, so that the newer namespace is the only one to learn. This is an agent identifier, not a credential: the server resolves the agent by this ID and creates one if it doesn't exist yet. When unset the run is addressed by project instead.

Read once per process and cached; call .cache_clear() to re-read.