class langgraph_agent_toolkit.core.observability.langsmith.LangsmithObservability(prompts_dir=None)[source][source]

Bases: BaseObservabilityPlatform

Langsmith implementation of observability platform.

Initialize LangsmithObservability.

Parameters:

prompts_dir (str | None) – Optional directory to store prompts locally. If None, a system temp directory is used.

__init__(prompts_dir=None)[source][source]

Initialize LangsmithObservability.

Parameters:

prompts_dir (str | None) – Optional directory to store prompts locally. If None, a system temp directory is used.

property required_vars: List[str]
get_callback_handler(**kwargs)[source][source]

Get the callback handler for the observability platform.

Return type:

None

before_shutdown()[source][source]

Perform any necessary cleanup before shutdown.

Return type:

None

record_feedback(run_id, key, score, **kwargs)[source][source]

Record feedback for a run to LangSmith.

Parameters:
Return type:

None

push_prompt(name, prompt_template, metadata=None, force_create_new_version=True)[source][source]

Push a prompt to LangSmith.

Parameters:
Return type:

None

pull_prompt(name, template_format='f-string', **kwargs)[source][source]

Pull a prompt from LangSmith.

Parameters:
  • name (str)

  • template_format (Literal['f-string', 'mustache', 'jinja2'])

Return type:

ChatPromptTemplate | str | dict | None

delete_prompt(name)[source][source]

Delete a prompt from LangSmith.

Parameters:

name (str) – Name of the prompt to delete

Return type:

None

get_template(name)[source]
Parameters:

name (str)

Return type:

str

property prompts_dir: Path
render_prompt(prompt_name, **variables)[source]
Parameters:

prompt_name (str)

Return type:

str

static requires_env_vars(func)[source]
Parameters:

func (Callable[[...], T])

Return type:

Callable[[…], T]

validate_environment()[source]
Return type:

bool