langchain + Weaviate如何一次访问多列

huangapple go评论81阅读模式
英文:

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):

{&#39;Table_Name&#39;: &#39;Cust&#39;, &#39;Column_Name&#39;: &#39;Amount&#39;, &#39;Data_Type&#39;: &#39;Number&#39;, &#39;Table_Description&#39;: &#39;customer table&#39;, &#39;Column_Description&#39;: &#39;total transaction amount&#39;}

How can langchain access multiple keys object (see example above) via the Weaviate() class?

 vectorstore = Weaviate(weaviate_client, INDEX_NAME, &lt;??&gt;)

when not passing the third argument to get all the objects, I get the following error:

Traceback (most recent call last):
  File &quot;/Users/main.py&quot;, line 43, in &lt;module&gt;
    vectorstore = populate_data(weaviate_client)
  File &quot;/Users/main.py&quot;, line 39, in populate_data
    return Weaviate(weaviate_client, INDEX_NAME)
TypeError: __init__() missing 1 required positional argument: &#39;text_key&#39;

答案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.

huangapple
  • 本文由 发表于 2023年6月12日 02:13:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76451891.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定