小编Rij*_*nto的帖子

postgresql 上不存在“向量”类型 - langchain

我试图在pgvector扩展和langchain的帮助下在 postgresql 上嵌入一些文档。不幸的是我遇到了以下错误:

(psycopg2.errors.UndefinedObject) type "vector" does not exist
LINE 4:  embedding VECTOR(1536), 
                   ^

[SQL: 
CREATE TABLE langchain_pg_embedding (
    collection_id UUID, 
    embedding VECTOR(1536), 
    document VARCHAR, 
    cmetadata JSON, 
    custom_id VARCHAR, 
    uuid UUID NOT NULL, 
    PRIMARY KEY (uuid), 
    FOREIGN KEY(collection_id) REFERENCES langchain_pg_collection (uuid) ON DELETE CASCADE
)
]
Run Code Online (Sandbox Code Playgroud)

我的环境信息:

  • pgvector泊坞窗图像ankane/pgvector:v0.4.1
  • 蟒蛇3.10.6, psycopg2 2.9.6, pgvector 0.1.6

postgres 上已安装的扩展列表

  Name   | Version |   Schema   |                Description                 
---------+---------+------------+--------------------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural …
Run Code Online (Sandbox Code Playgroud)

python postgresql vectorization langchain

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

langchain ×1

postgresql ×1

python ×1

vectorization ×1