data_service.py 594 Bytes
import logging

from embedding_sever.db import DataDao

logger = logging.getLogger(__name__)


class DataService:

    def __init__(self, data_dao: DataDao):
        self.data_dao = data_dao

    async def upsert(self, tb_name, id, embedding, params):
        return await self.data_dao.upsert(tb_name, id, embedding, params)

    async def delete_by_pks(self, tb_name, ids):
        return await self.data_dao.delete_by_pks(tb_name, ids)

    async def search(self, tb_name, embedding, filters, from_, size):
        return await self.data_dao.search(tb_name, embedding, filters, from_, size)