class langgraph_agent_toolkit.core.observability.empty.EmptyObservability(remote_first=False)[source][source]

Bases: BaseObservabilityPlatform

Empty implementation of observability platform with in-memory prompt storage.

This implementation stores prompts in memory, allowing the prompt template system to work without a remote observability backend like Langfuse or LangSmith.

Initialize EmptyObservability.

Parameters:

remote_first (bool) – Ignored in empty implementation.

__init__(remote_first=False)[source][source]

Initialize EmptyObservability.

Parameters:

remote_first (bool) – Ignored in empty implementation.

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 - silently ignored without a remote backend.

Parameters:
Return type:

None

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

Store a prompt in memory.

Parameters:
  • name (str) – Name of the prompt

  • prompt_template (str | List[ChatMessageDict]) – The prompt template to store

  • metadata (Dict[str, Any] | None) – Optional metadata for the prompt

  • force_create_new_version (bool) – If True, overwrite existing prompt

Return type:

None

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

Retrieve a prompt from memory.

Parameters:
  • name (str) – Name of the prompt to retrieve

  • template_format (Literal['f-string', 'mustache', 'jinja2']) – Format for the template (used for processing)

  • **kwargs – Additional arguments (ignored)

Returns:

The stored prompt template, processed into a ChatPromptTemplate

Raises:

ValueError – If prompt not found in memory

Return type:

ChatPromptTemplate | str | dict | None

delete_prompt(name)[source][source]

Delete a prompt from memory.

Parameters:

name (str) – Name of the prompt to delete

Return type:

None

property remote_first: bool
property required_vars: List[str]
static requires_env_vars(func)[source]

Validate environment variables before calling a method.

Parameters:

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

Return type:

Callable[[…], T]

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)

validate_environment()[source]

Validate that required environment variables are set.

Return type:

bool