Skip to main content

Ping the server

Test connectivity to the server — a lightweight health check that confirms the service is up.

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. An optional tracing ID may be passed for distributed tracing.

Behavior

  • The client sends a ping message and the server replies with a Pong.
  • Handy for readiness/liveness probes, monitoring, and debugging connections.

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
from ahnlich_client_py.grpc.db.server import Pong

async def Ping():

"""
Test ping
"""

# Initialize client

async with Channel(host="127.0.0.1", port=1369) as channel:

db_client = DbServiceStub(channel)

# Prepare tracing metadata

tracing_id = "00-80e1afed08e019fc1110464cfa66635c-7a085853722dc6d2-01"

metadata = {"ahnlich-trace-id": tracing_id}

# Make request with metadata

response = await db_client.ping(

db_query.Ping(),

metadata=metadata

)

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

Response

A Pong message confirming connectivity.