experimental: docstrings update (#18048)

Added missed docstrings. Formatted docsctrings to the consistent format.
This commit is contained in:
Leonid Ganeline
2024-02-23 18:24:16 -08:00
committed by GitHub
parent 56b955fc31
commit 3f6bf852ea
61 changed files with 316 additions and 102 deletions

View File

@@ -19,7 +19,8 @@ from langchain_experimental.sql.base import INTERMEDIATE_STEPS_KEY, SQLDatabaseC
class VectorSQLOutputParser(BaseOutputParser[str]):
"""Output Parser for Vector SQL
"""Output Parser for Vector SQL.
1. finds for `NeuralArray()` and replace it with the embedding
2. finds for `DISTANCE()` and replace it with the distance name in backend SQL
"""
@@ -61,8 +62,8 @@ class VectorSQLOutputParser(BaseOutputParser[str]):
class VectorSQLRetrieveAllOutputParser(VectorSQLOutputParser):
"""Based on VectorSQLOutputParser
It also modify the SQL to get all columns
"""Parser based on VectorSQLOutputParser.
It also modifies the SQL to get all columns.
"""
@property
@@ -79,6 +80,8 @@ class VectorSQLRetrieveAllOutputParser(VectorSQLOutputParser):
def get_result_from_sqldb(db: SQLDatabase, cmd: str) -> Sequence[Dict[str, Any]]:
"""Get result from SQL Database."""
result = db._execute(cmd, fetch="all")
assert isinstance(result, Sequence)
return result