英文:
langchain + Weaviate how to access multiple columns at once
问题
I have created a schema with multiple properties in Weaviate. using the following approach:
在Weaviate中,我使用了以下方法创建了一个包含多个属性的模式:
for row in tqdm(data, total=len(data)):
client.data_object.create(data_object=row, class_name=INDEX_NAME)
here is a sample of the data (1 row):
以下是数据的示例(1行):
{'Table_Name': 'Cust', 'Column_Name': 'Amount', 'Data_Type': 'Number', 'Table_Description': 'customer table', 'Column_Description': 'total transaction amount'}
How can langchain access multiple keys object (see example above) via the Weaviate() class?
通过Weaviate()类,langchain如何访问多个键的对象(请参见上面的示例)?
vectorstore = Weaviate(weaviate_client, INDEX_NAME, <??>)
when not passing the third argument to get all the objects, I get the following error:
当不传递第三个参数以获取所有对象时,我会收到以下错误信息:
Traceback (most recent call last):
File "/Users/main.py", line 43, in <module>
vectorstore = populate_data(weaviate_client)
File "/Users/main.py", line 39, in populate_data
return Weaviate(weaviate_client, INDEX_NAME)
TypeError: __init__() missing 1 required positional argument: 'text_key'
当不传递第三个参数时,会出现上述错误。
英文:
I have created a schema with multiple properties in Weaviate. using the following approach:
for row in tqdm(data, total=len(data)):
client.data_object.create(data_object=row, class_name=INDEX_NAME)
here is a sample of the data (1 row):
{'Table_Name': 'Cust', 'Column_Name': 'Amount', 'Data_Type': 'Number', 'Table_Description': 'customer table', 'Column_Description': 'total transaction amount'}
How can langchain access multiple keys object (see example above) via the Weaviate() class?
vectorstore = Weaviate(weaviate_client, INDEX_NAME, <??>)
when not passing the third argument to get all the objects, I get the following error:
Traceback (most recent call last):
File "/Users/main.py", line 43, in <module>
vectorstore = populate_data(weaviate_client)
File "/Users/main.py", line 39, in populate_data
return Weaviate(weaviate_client, INDEX_NAME)
TypeError: __init__() missing 1 required positional argument: 'text_key'
答案1
得分: 1
LangChain仅支持传递1个属性。此属性旨在表示将用于嵌入和搜索的文档文本内容。
英文:
LangChain only supports passing 1 property. This property is meant to represent the document's text content that will be used for embeding & search.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论