Skip to content

briefcase.exporters

Terminal window
pip install briefcase-ai

Stock exporters ship in the base package. The fastest way to wire one up is briefcase.observe(...); construct them directly when you need full control.

ConsoleExporter, JSONLFileExporter, MemoryExporter

import briefcase
from briefcase.exporters import ConsoleExporter, JSONLFileExporter, MemoryExporter
console = ConsoleExporter() # JSON lines to stderr (default)
jsonl = JSONLFileExporter("runs.jsonl") # append-only, thread-safe
memory = MemoryExporter() # collect records in .records
briefcase.setup(exporter=memory) # or briefcase.observe(memory)
@briefcase.capture(async_capture=False)
def classify_ticket(text: str) -> str:
return "account_access"
classify_ticket("reset my password")
print(memory.records[0]["function_name"]) # "classify_ticket"
memory.clear()
ConsoleExporter(stream=None, *, pretty=False) # default stream: sys.stderr
JSONLFileExporter(path)
MemoryExporter()
.records # list of captured decision records
.clear()

BaseExporter

from briefcase.exporters import BaseExporter
class LoggingExporter(BaseExporter):
async def export(self, decision) -> bool:
print(decision)
return True
async def flush(self) -> None:
pass
async def close(self) -> None:
pass
BaseExporter()
async export(decision) -> bool
async flush()
async close()

OTelExporter, GCPCloudLoggingExporter

OTelExporter(...)
GCPCloudLoggingExporter(
project,
log_name="briefcase-ai-decisions",
credentials_path=None,
batch_size=100,
)

Install the otel or gcp-logging extra. The GCP exporter buffers structured entries and flushes the final batch during close().