Send CSV file for use in Chat Completion?

Hello @oliver.drobnik
Yes you can, and it works very well. Here are the steps you can take.

  1. Parse the CSV file and for every row, modify the row to one line of key value sentence. For example
    Name, Product, Review
    Oliver, SD Card, I think this SD Card is great
    Nelson, SD Card, This SD Card is horrible
    will turn into multiple lines of the following…
    Name: Oliver, Product: SD Card, Review: I think this SD Card is great
    Name: Nelson, Product: SD Card, Review: This SD Card is horrible

  2. For every line, turn them into a separate embedding
    Encode(Name: Oliver, Product: SD Card, Review: I think this SD Card is great) => [223,231,132]
    Encode(Name: Nelson, Product: SD Card, Review: This SD Card is horrible) => [323,351,112]

  3. When a user ask a question, search for the most similar embedding and include them in the prompt.

Here is a screenshot of how it can work.
Reference Data


Chat Examples

If you like to see how it works in action before you implement it, you can try it at https://www.superinsight.ai

Hope that helps!

2 Likes