mirror of
https://github.com/nexus-stc/hyperboria
synced 2025-01-07 17:26:06 +01:00
dd23846059
- [nexus] Switch bot - [bot] Added extra receivers functionality GitOrigin-RevId: 68fc32d3e79ff411758f54f435fe8680fc42dead
17 lines
423 B
Python
17 lines
423 B
Python
import fire
|
|
from aiokit.utils import sync_fu
|
|
from nexus.meta_api.aioclient import MetaApiGrpcClient
|
|
|
|
|
|
async def search(endpoint, index_alias, query):
|
|
client = MetaApiGrpcClient(endpoint)
|
|
try:
|
|
await client.start()
|
|
print(await client.search(index_aliases=(index_alias,), query=query, language='ru'))
|
|
finally:
|
|
await client.stop()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
fire.Fire(sync_fu(search))
|