- class langgraph_agent_toolkit.core.observability.base.BaseObservabilityPlatform(remote_first=False)[source][source]
Bases:
ABCBase class for observability platforms.
This is a lightweight base class that provides common utilities for observability platforms. It does NOT perform any disk I/O operations to avoid blocking in async contexts.
Initialize the observability platform.
- Parameters:
remote_first (bool) – If True, prioritize remote prompts over local cache.
- __init__(remote_first=False)[source][source]
Initialize the observability platform.
- Parameters:
remote_first (bool) – If True, prioritize remote prompts over local cache.
- validate_environment()[source][source]
Validate that required environment variables are set.
- Return type:
- static requires_env_vars(func)[source][source]
Validate environment variables before calling a method.
- abstractmethod get_callback_handler(**kwargs)[source][source]
Get the callback handler for the observability platform.
- Return type:
- abstractmethod before_shutdown()[source][source]
Perform any necessary cleanup before shutdown.
- Return type:
None
- abstractmethod record_feedback(run_id, key, score, **kwargs)[source][source]
Record feedback for a run.
- abstractmethod push_prompt(name, prompt_template, metadata=None, force_create_new_version=True)[source][source]
Push a prompt to the observability platform.
- abstractmethod pull_prompt(name, template_format='f-string', **kwargs)[source][source]
Pull a prompt from the observability platform.
- abstractmethod delete_prompt(name)[source][source]
Delete a prompt from the observability platform.
- Parameters:
name (str)
- Return type:
None
- trace_context(run_id, **kwargs)[source][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)