I am trying to attach a csv file to API to ask question based on data present in the csv file. I am wondering how to do that. Currently I am converting the csv file to string using csv_text = df.to_string(index=False) and then passing to chatmessage
# Convert the DataFrame into a text format that can be used in prompts
csv_text = df.to_string(index=False) # Converts to string without row indices
# Prepare a message to pass to the model
user_message = ChatMessage(
role="user",
content=f"Here is the data from my CSV:\n{csv_text}\n Who nominated Best Sound in the 1972 Academy Awards? Don't give me program instead analyze the data and give me result",
)
# Use the LLM to process the message
response = llm.chat([user_message])
Is there a way to attach the csv file itself to API? Also is there a way to get the plotting done by a particular LLM?, like in chatgpt we can ask it to analyse the data and then plot.