- class langgraph_agent_toolkit.core.observability.langsmith.LangsmithObservability(remote_first=False)[source][source]
Bases:
BaseObservabilityPlatformLangsmith implementation of observability platform.
Initialize LangsmithObservability.
- Parameters:
remote_first (bool) – If True, prioritize remote prompts over local ones.
- __init__(remote_first=False)[source][source]
Initialize LangsmithObservability.
- Parameters:
remote_first (bool) – If True, prioritize remote prompts over local ones.
- get_callback_handler(**kwargs)[source][source]
Get the callback handler - LangSmith uses automatic tracing.
- Return type:
None
- record_feedback(run_id, key, score, **kwargs)[source][source]
Record feedback for a run to LangSmith.
- 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.
- delete_prompt(name)[source][source]
Delete a prompt from LangSmith.
- Parameters:
name (str) – Name of the prompt to delete
- Return type:
None
- async apull_prompt(name, template_format='f-string', **kwargs)[source]
Async version of pull_prompt. Runs synchronous version in thread pool.
- trace_context(run_id, **kwargs)[source]
Create a trace context for the execution.
Override in subclasses for platform-specific implementation.
- Parameters:
run_id (str) – The run ID to use as trace ID
**kwargs – Additional context parameters (user_id, input, etc.)
- Yields:
None (or platform-specific context object)
- update_trace(trace, **attributes)[source]
Set trace-level attributes (e.g. the final output) on a trace yielded by trace_context.
trace_contextis entered before the run’s output is known, so the caller invokes this afterwards to record the output on the trace. No-op for platforms without a trace object; override per platform.