mirror of
https://github.com/langgenius/dify.git
synced 2026-02-24 18:05:11 +00:00
fix: preserve MyScale text content on insert
This commit is contained in:
@@ -100,7 +100,7 @@ class MyScaleVector(BaseVector):
|
||||
rows.append(
|
||||
(
|
||||
doc_id,
|
||||
self.escape_str(doc.page_content),
|
||||
doc.page_content,
|
||||
embeddings[i],
|
||||
json.dumps(doc.metadata or {}),
|
||||
)
|
||||
@@ -110,10 +110,6 @@ class MyScaleVector(BaseVector):
|
||||
self._client.insert(self._qualified_table, rows, column_names=columns)
|
||||
return ids
|
||||
|
||||
@staticmethod
|
||||
def escape_str(value: Any) -> str:
|
||||
return "".join(" " if c in {"\\", "'"} else c for c in str(value))
|
||||
|
||||
def text_exists(self, id: str) -> bool:
|
||||
results = self._client.query(
|
||||
f"SELECT id FROM {self._qualified_table} WHERE id = %(id)s LIMIT 1",
|
||||
|
||||
Reference in New Issue
Block a user