Handlers (Tools)
Csv Handler
The method leverages a query string provided by the user to generate a filter condition based on the columns of the CSV file. This condition is used to extract relevant data from the CSV and return it in a structured format. The filtering logic is generated by an external LLM (Large Language Model) client, which receives a prompt based on the CSV’s structure.
Example
This method is part of the CsvHandler class, which handles CSV file operations, and is specifically designed to search through the data in the CSV file based on a user-defined query.
To use OpenAI models, you’ll need to create an OpenAI account and get an API key. For more details refer here.
Set up a OpenAI API key as an environmental variable and run the following code.
csv_handler.py
Result
csv cli