Skip to main content

List connected clients

List every client currently connected to the server.

Every operation works on both Vector DB stores (you supply raw vectors) and AI stores (you supply text or images and Ahnlich AI generates the embeddings for you). Use the Vector DB / AI switch in the sample below.

Parameters

This request takes no arguments.

Behavior

  • The server returns information about all active client connections, including their addresses.

Sample query

Python
import asyncio
from grpclib.client import Channel
from ahnlich_client_py.grpc.services.db_service import DbServiceStub
from ahnlich_client_py.grpc.db import query as db_query

async def list_connected_clients():
async with Channel(host="127.0.0.1", port=1369) as channel:
client = DbServiceStub(channel)

response = await client.list_clients(db_query.ListClients())

# response.clients contains information about connected clients
for client_info in response.clients:
print(f"Connected client: {client_info.address}")

if __name__ == "__main__":
asyncio.run(list_connected_clients())

Response

A list of connected client information (e.g. client addresses).