Add rest-api example (#889)

This commit is contained in:
Sidharth Mohanty
2023-11-03 13:02:51 +05:30
committed by GitHub
parent a054f7be9c
commit 8dd5cb9602
44 changed files with 1217 additions and 118 deletions

View File

@@ -313,6 +313,15 @@ class Pipeline(EmbedChain):
)
self.connection.commit()
def get_data_sources(self):
db_data = self.cursor.execute("SELECT * FROM data_sources WHERE pipeline_id = ?", (self.local_id,)).fetchall()
data_sources = []
for data in db_data:
data_sources.append({"data_type": data[2], "data_value": data[3], "metadata": data[4]})
return data_sources
def deploy(self):
if self.client is None:
self._init_client()
@@ -348,7 +357,7 @@ class Pipeline(EmbedChain):
with open(yaml_path, "r") as file:
config_data = yaml.safe_load(file)
pipeline_config_data = config_data.get("pipeline", {}).get("config", {})
pipeline_config_data = config_data.get("app", {}).get("config", {})
db_config_data = config_data.get("vectordb", {})
embedding_model_config_data = config_data.get("embedding_model", {})
llm_config_data = config_data.get("llm", {})