[Bug fix] Fix issue related to get_data_sources() method (#1295)

This commit is contained in:
Deshraj Yadav
2024-03-01 11:54:36 -08:00
committed by GitHub
parent c77a75dfb5
commit 91044ec591
2 changed files with 11 additions and 7 deletions

View File

@@ -10,9 +10,14 @@ import requests
import yaml import yaml
from tqdm import tqdm from tqdm import tqdm
from embedchain.cache import (Config, ExactMatchEvaluation, from embedchain.cache import (
SearchDistanceEvaluation, cache, Config,
gptcache_data_manager, gptcache_pre_function) ExactMatchEvaluation,
SearchDistanceEvaluation,
cache,
gptcache_data_manager,
gptcache_pre_function,
)
from embedchain.client import Client from embedchain.client import Client
from embedchain.config import AppConfig, CacheConfig, ChunkerConfig from embedchain.config import AppConfig, CacheConfig, ChunkerConfig
from embedchain.core.db.database import get_session, init_db, setup_engine from embedchain.core.db.database import get_session, init_db, setup_engine
@@ -21,8 +26,7 @@ from embedchain.embedchain import EmbedChain
from embedchain.embedder.base import BaseEmbedder from embedchain.embedder.base import BaseEmbedder
from embedchain.embedder.openai import OpenAIEmbedder from embedchain.embedder.openai import OpenAIEmbedder
from embedchain.evaluation.base import BaseMetric from embedchain.evaluation.base import BaseMetric
from embedchain.evaluation.metrics import (AnswerRelevance, ContextRelevance, from embedchain.evaluation.metrics import AnswerRelevance, ContextRelevance, Groundedness
Groundedness)
from embedchain.factory import EmbedderFactory, LlmFactory, VectorDBFactory from embedchain.factory import EmbedderFactory, LlmFactory, VectorDBFactory
from embedchain.helpers.json_serializable import register_deserializable from embedchain.helpers.json_serializable import register_deserializable
from embedchain.llm.base import BaseLlm from embedchain.llm.base import BaseLlm
@@ -295,7 +299,7 @@ class App(EmbedChain):
data_sources = self.db_session.query(DataSource).filter_by(app_id=self.local_id).all() data_sources = self.db_session.query(DataSource).filter_by(app_id=self.local_id).all()
results = [] results = []
for row in data_sources: for row in data_sources:
results.append({"data_type": row.data_type, "data_value": row.data_value, "metadata": row.metadata}) results.append({"data_type": row.type, "data_value": row.value, "metadata": row.meta_data})
return results return results
def deploy(self): def deploy(self):

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "embedchain" name = "embedchain"
version = "0.1.89" version = "0.1.90"
description = "Simplest open source retrieval(RAG) framework" description = "Simplest open source retrieval(RAG) framework"
authors = [ authors = [
"Taranjeet Singh <taranjeet@embedchain.ai>", "Taranjeet Singh <taranjeet@embedchain.ai>",