vibe.assistant.logging¶
Assistant interaction logging system.
This module provides logging functionality for assistant conversations, tracking requests, responses, and errors for debugging and monitoring.
AssistantLogManager ¶
Manages assistant interaction logs with structured logging.
__init__ ¶
__init__(log_directory: Path | None = None) -> None
Initialize the assistant log manager.
| Parameters: |
|
|---|
log_assistant_request ¶
log_assistant_request(endpoint_name: str, assistant_name: str, turn_id: str, provider_payload: object, session_id: str | None, sequence: int, **extra: object) -> str
Log an assistant request with provider-formatted payload.
| Parameters: |
|
|---|
| Returns: |
|
|---|
transform_chunks ¶
transform_chunks(chunks: list[StreamChunk]) -> str
Convert a sequence of StreamChunk items into a readable summary string.
The output includes tool calls (with progressively collected arguments) and the first contiguous text segment for quick inspection in logs.
log_assistant_response_chunk ¶
log_assistant_response_chunk(endpoint_name: str, assistant_name: str, turn_id: str, session_id: str | None, sequence: int, raw_chunk: object, chunk_index: int | None = None) -> None
Log a raw provider response chunk.
log_sse_event ¶
log_sse_event(turn_id: str, sse_content: str) -> None
Log an SSE event that's being sent to the client.
This logs the raw SSE events as they're sent to the browser, useful for debugging the streaming output and correlating with input chunks.
| Parameters: |
|
|---|
log_assistant_error ¶
log_assistant_error(endpoint_id: str, assistant_name: str, turn_id: str, error: Exception, metadata: dict[str, Any] | None = None, *, session_id: str | None = None, sequence: int | None = None) -> None
Log an assistant error.
| Parameters: |
|
|---|
set_log_directory ¶
set_log_directory(log_directory: Path) -> None
Set the log directory for assistant logs.
| Parameters: |
|
|---|
reinitialize_log_manager ¶
reinitialize_log_manager() -> None
Reinitialize the global log manager to use the unified data directory.
This should be called after the data directory manager is initialized.