Skip to main content

Client SDK for Chaukas agent audit and explainability platform

Project description

Chaukas Client SDK

Client-side Python SDK for the Chaukas agent audit and explainability platform.

Installation

pip install chaukas-spec-client

Quick Start

Basic Client Usage

import grpc
from chaukas.spec.client.v1.client_pb2_grpc import ChaukasClientServiceStub
from chaukas.spec.client.v1.client_pb2 import IngestEventRequest, HealthzRequest
from chaukas.spec.common.v1.events_pb2 import Event, EventType

# Create gRPC channel and client
channel = grpc.insecure_channel('localhost:50051')
client = ChaukasClientServiceStub(channel)

# Health check
health_request = HealthzRequest()
health_response = client.Healthz(health_request)
print("Service is healthy!")

# Create and send an event
event = Event(
    event_id="evt_123",
    type=EventType.EVENT_TYPE_AGENT_START,
    session_id="session_abc",
    tenant_id="tenant_123",
    project_id="project_456"
)

request = IngestEventRequest(event=event)
response = client.IngestEvent(request)
print("Event ingested successfully!")

Available Event Types

from chaukas.spec.common.v1.events_pb2 import EventType

# Session lifecycle
EventType.EVENT_TYPE_SESSION_START
EventType.EVENT_TYPE_SESSION_END

# Agent spans  
EventType.EVENT_TYPE_AGENT_START
EventType.EVENT_TYPE_AGENT_END

# LLM/Tool spans
EventType.EVENT_TYPE_MODEL_INVOCATION_START
EventType.EVENT_TYPE_MODEL_INVOCATION_END
EventType.EVENT_TYPE_TOOL_CALL_START
EventType.EVENT_TYPE_TOOL_CALL_END

# I/O Events
EventType.EVENT_TYPE_INPUT_RECEIVED
EventType.EVENT_TYPE_OUTPUT_EMITTED

# Error handling
EventType.EVENT_TYPE_ERROR
EventType.EVENT_TYPE_RETRY

Batch Event Ingestion

from chaukas.spec.client.v1.client_pb2 import IngestEventBatchRequest
from chaukas.spec.common.v1.events_pb2 import EventBatch

# Create multiple events
events = [
    Event(event_id="evt_1", type=EventType.EVENT_TYPE_SESSION_START),
    Event(event_id="evt_2", type=EventType.EVENT_TYPE_AGENT_START),
]

batch = EventBatch(events=events)
request = IngestEventBatchRequest(event_batch=batch)
response = client.IngestEventBatch(request)
print("Event batch ingested!")

Querying Events

from chaukas.spec.client.v1.client_pb2 import QueryEventsRequest
from chaukas.spec.common.v1.query_pb2 import QueryRequest, SortOrder

# Query events
query = QueryRequest(
    tenant_id="tenant_123",
    project_id="project_456",
    limit=100,
    sort_order=SortOrder.SORT_ORDER_DESC
)

request = QueryEventsRequest(query=query)
response = client.QueryEvents(request)

print(f"Found {len(response.response.events)} events")
for event in response.response.events:
    print(f"- {event.event_id}: {event.type}")

Error Handling

import grpc

try:
    response = client.IngestEvent(request)
except grpc.RpcError as e:
    if e.code() == grpc.StatusCode.UNAVAILABLE:
        print("Service unavailable")
    elif e.code() == grpc.StatusCode.INVALID_ARGUMENT:
        print("Invalid request:", e.details())
    else:
        print(f"RPC failed: {e}")

Development

This package contains generated Protocol Buffer code. For development instructions and to contribute to the specification, see the main repository:

https://github.com/chaukasai/spec

License

Apache License 2.0 - see the main repository for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaukas_spec_client-1.0.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaukas_spec_client-1.0.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file chaukas_spec_client-1.0.1.tar.gz.

File metadata

  • Download URL: chaukas_spec_client-1.0.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for chaukas_spec_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9bebcedf38d832ea028fb9fc15d973f6cdc2b1b276233fa87d9015ed30e10029
MD5 63e43ecee57dd34071b0277d5822f25b
BLAKE2b-256 e9fa7b50b999cdb1cdea070ef1ceb6e298ea4d901fb419a343a46479b19cc2cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for chaukas_spec_client-1.0.1.tar.gz:

Publisher: release.yml on chaukasai/spec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chaukas_spec_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chaukas_spec_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5180aa0776e4940b7ae82e0dd07e4105b625975c6637451b045ead1ce701189a
MD5 ec365e82cee7a1ab5e4f8e70e49d979c
BLAKE2b-256 31e416b1802ebd9cdfc389512e64a91d6a922561bf1856723ec58c2806990248

See more details on using hashes here.

Provenance

The following attestation bundles were made for chaukas_spec_client-1.0.1-py3-none-any.whl:

Publisher: release.yml on chaukasai/spec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page