Code
cookbook/knowledge/readers/csv_field_labeled_reader.py
Usage
1
Create a virtual environment
Open the
Terminal
and create a python virtual environment.2
Install libraries
3
Set environment variables
4
Run PgVector
5
Run Agent
Params
Parameter | Type | Default | Description |
---|---|---|---|
file | Union[Path, IO[Any]] | Required | Path to CSV file or file-like object |
chunk_title | Optional[Union[str, List[str]]] | None | Title to add at the top of each entry. Can be a single string or a list that rotates through entries |
field_names | Optional[List[str]] | [] | Custom labels for CSV fields. If not provided, column headers are used |
format_headers | bool | True | Whether to format column headers by replacing underscores with spaces and applying title case |
skip_empty_fields | bool | True | Whether to skip fields with empty values in the output |
delimiter | str | "," | Character used to separate fields in the CSV |
quotechar | str | '"' | Character used to quote fields in the CSV |
encoding | Optional[str] | "utf-8" | Character encoding for reading the file |