You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
666 B
Python

import asyncio
import base
from sqlalchemy import select
from api.model.embedding_search.title_index import TitleIndexModel
import local
from service.database import DatabaseService
from service.embedding_search import EmbeddingSearchService
async def main():
dbs = await DatabaseService.create()
async with dbs.create_session() as session:
stmt = select(TitleIndexModel).where(TitleIndexModel.title == "代号:曙光的世界/黄昏的阿瓦隆")
res = await session.scalar(stmt)
print(res.__dict__)
await asyncio.sleep(0.5)
await local.noawait.end()
if __name__ == '__main__':
local.loop.run_until_complete(main())