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