Код: Выделить всё
CREATE TABLE IF NOT EXISTS vector_store (
id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata jsonb,
embedding vector(1024),
created_at timestamptz DEFAULT now()
);
Код: Выделить всё
@Entity
@Table(name = "vector_store")
public class Document {
@Id
@Column(columnDefinition = "uuid")
private UUID id;
@Column(columnDefinition = "text")
private String content;
@JdbcTypeCode(SqlTypes.JSON)
@Column(columnDefinition = "jsonb")
private LogMetadata metadata;
@JdbcTypeCode(SqlTypes.VECTOR)
@Column(columnDefinition = "vector(1024)")
@Array(length = 1024)
private double[] embedding;
// getters and setters
}
Код: Выделить всё
public List fetchAllDocuments() {
return documentRepository.findAll();
}
Код: Выделить всё
org.hibernate.type.SerializationException: could not deserialize
...
java.io.StreamCorruptedException: invalid stream header: 5B2D302E
Я также пробовал SqlTypes.VECTOR_FLOAT64, но безуспешно.
Есть идеи, что это может быть?
Подробнее здесь: https://stackoverflow.com/questions/798 ... ector-embe
Мобильная версия