Open ujikol opened 2 weeks ago
@ujikol It might be better for your use case to use CSVTools
. Please refer to this example here: https://docs.phidata.com/tools/csv
Are you saying that this is the intended behavior? I do not get the point to have a list of documents and then just considering the last one.
I do not want to read or write CSVs. The example was just the minimal demonstration that the assistant ignores all files except the last one.
My use case is just to analysis of data from multiple tables. So the code to be generated needs to join these tables appropriately. The subset of which tables to be joined depends on the requested analysis. IMO the LLM just needs to be provided the description and columns of all files instead of just the last one.
@ujikol No, that is definitely not the intended behavior, and I have raised this issue. Thank you for bringing this to our attention.
`from phi.assistant.python import PythonAssistant from phi.file.local.csv import CsvFile from pathlib import Path import pandas as pd
FILES = ['f1', 'f2']
for f in FILES: df = pd.DataFrame({f+'c1':[1,2], f+'c2':[3,4]}) df.to_csv(str(Path.cwd().joinpath(f))+'.csv') python_assistant = PythonAssistant( files=[ CsvFile(path=str(Path.cwd().joinpath(f))+'.csv') for f in FILES], )
python_assistant.print_response("Print the name of each column in each file perfixed by the corresponding file name.", markdown=True)`