langgraph_agent_toolkit.core.observability.langsmith module
- class langgraph_agent_toolkit.core.observability.langsmith.LangsmithObservability(remote_first=False)[source][source]
Bases:
BaseObservabilityPlatformLangSmith observability platform.
Initialize LangsmithObservability.
- Parameters:
remote_first (bool) – Prioritize remote prompts when True.
- __init__(remote_first=False)[source][source]
Initialize LangsmithObservability.
- Parameters:
remote_first (bool) – Prioritize remote prompts when True.
- 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.
- Parameters:
run_id (str)
key (str)
score (float)
- Return type:
None
- push_prompt(name, prompt_template, metadata=None, force_create_new_version=True)[source][source]
Push a prompt to LangSmith.
- Parameters:
name (str) – Name of the prompt
prompt_template (str | List[ChatMessageDict]) – The prompt template (string or list of message dicts)
metadata (Dict[str, Any] | None) – Optional metadata (can include ‘model’ to create a chain)
force_create_new_version (bool) – If True, always create a new version
- Return type:
None
- pull_prompt(name, template_format='f-string', **kwargs)[source][source]
Pull a prompt from LangSmith.
- Parameters:
name (str) – Name of the prompt
template_format (Literal['f-string', 'mustache', 'jinja2']) – Format for the template
**kwargs – Additional parameters (e.g., version, label)
- Returns:
ChatPromptTemplate
- Return type:
ChatPromptTemplate | str | dict | None