Spaces:
Build error
Build error
Commit ·
bda63f0
1
Parent(s): cc27c6f
Update weaviate_utils.py
Browse files145 unmodified lines146147148149150151152145 unmodified linesdef retrieve_relevant_table(client, selected_class, question_embedding):# Query Weaviate to get the most relevant tableresults = client.query.get(selected_class, ["embeddedTable"]).with_near_text(question_embedding).do()# Extract the table from the resultstable = results.get('data', {}).get('Get', {}).get('Things', [])[0].get('embeddedTable')return table145 unmodified lines146147148149150151152153154155156157145 unmodified linesdef retrieve_relevant_table(client, selected_class, question_embedding):# Query Weaviate to get the most relevant tableresults = client.query.get(selected_class, ["content"]).with_near_text(question_embedding).do()# Extract the table content from the resultstable_content = results.get('data', {}).get('Get', {}).get('Things', [])[0].get('content')# Convert the table content to a DataFrametable = pd.read_csv(StringIO(table_content))return table
weaviate_utils.py+8-3