Tracing
configure
Configures agent tracing using a Langfuse
backend. Once configured, all agent activities, code executions and model calls are automatically captured and exported to Langfuse.
Accepts all Langfuse configuration options.
Configuration options can be provided as parameters to configure()
or via environment variables.
Should be called at application startup.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Langfuse configuration parameters. |
{}
|
Source code in freeact/tracing/context.py
session
Context manager that creates a session scope for tracing operations.
All tracing operations within this context are associated with the specified session id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id
|
str | None
|
Identifier for the session. A random session id is generated if not specified. |
None
|
Source code in freeact/tracing/context.py
shutdown
Shuts down agent tracing and flushes pending traces to the backend.
shutdown()
is called automatically on application exit. For manual control, call this function explicitly.