DSPy: The framework for programming—not prompting—language models
Python
Update pgvector_rm.py
arnavsinghvi110f0163072e8a
diff --git a/dspy/retrieve/pgvector_rm.py b/dspy/retrieve/pgvector_rm.pyindex ae8d54f1a..e6bf542ee 100644--- a/dspy/retrieve/pgvector_rm.py+++ b/dspy/retrieve/pgvector_rm.py@@ -75,7 +75,7 @@ class PgVectorRM(dspy.Retrieve):k: int = 20,embedding_field: str = "embedding",fields: Optional[list[str]] = None,- content_filed: str = "text",+ content_field: str = "text",embedding_model: str = "text-embedding-ada-002",include_similarity: bool = False,):@@ -92,7 +92,7 @@ class PgVectorRM(dspy.Retrieve):register_vector(self.conn)self.pg_table_name = pg_table_nameself.fields = fields or ["text"]- self.content_filed = content_filed+ self.content_field = content_fieldself.embedding_field = embedding_fieldself.embedding_model = embedding_modelself.include_similarity = include_similarity@@ -138,7 +138,7 @@ class PgVectorRM(dspy.Retrieve):columns = [descrip[0] for descrip in cur.description]for row in rows:data = dict(zip(columns, row))- data["long_text"] = data[self.content_filed]+ data["long_text"] = data[self.content_field]retrieved_docs.append(dspy.Example(**data))# Return Predictionreturn retrieved_docs