> ## Documentation Index
> Fetch the complete documentation index at: https://agent-observability-docs.splunk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# export

## export\_records

```python theme={null}
def export_records(project_id: str,
                   root_type: RootType=RootType.TRACE,
                   filters: list[FilterType] | None=None,
                   sort: LogRecordsSortClause=LogRecordsSortClause(column_id='created_at', ascending=False),
                   export_format: LLMExportFormat=LLMExportFormat.JSONL,
                   agent_stream_id: str | None=None,
                   experiment_id: str | None=None,
                   column_ids: list[str] | None=None,
                   redact: bool=True,
                   include_code_metric_metadata: bool=False) -> Iterator[dict[str, Any]]
```

Exports records from a Splunk AO project.

Defaults to the first agent stream if `agent_stream_id` and `experiment_id` are not provided.

**Arguments**

* `project_id`: The unique identifier of the project.
* `root_type`: The type of records to export.
* `export_format`: The desired format for the exported data.
* `agent_stream_id`: Filter records by a specific agent stream ID.
* `experiment_id`: Filter records by a specific experiment ID.
* `filters`: A list of filters to apply to the export.
* `column_ids`: A list of column IDs to include in the export.
* `sort`: A sort clause to order the exported records.
* `redact`: Redact sensitive data from the response.
* `include_code_metric_metadata`: If True, include per-row scorer metadata (the dict returned alongside the score by
  code-based scorers via the (score, metadata) tuple-return contract) on each
  MetricSuccess in the export. Off by default to keep payloads small.

**Returns**

* `An iterator that yields each record as a dictionary.`:
