Jac Cloud Client

0.2.11 · active · verified Thu Apr 16

Jac Cloud (version 0.2.11) provides a high-level Python API to interact with Jaseci services on the cloud, built upon the `jac-sdk`. It simplifies the deployment and management of AI agents and workflows within the Jaseci ecosystem. The library is actively developed, with releases typically following updates to the underlying `jac-sdk` and a strict requirement for Python 3.12 or newer.

Common errors

Warnings

Install

Imports

Quickstart

Initializes a `JacClient` using environment variables for authentication, checks the Jaseci service health, creates and retrieves a simple agent, and then cleans up by deleting it. Requires a running Jaseci service with `JAC_API_KEY` and `JAC_API_URL` configured.

import os
from jac_cloud.jac_client import JacClient

# Ensure JAC_API_KEY and JAC_API_URL are set as environment variables
# e.g., export JAC_API_URL="http://localhost:8000" and export JAC_API_KEY="your_key"

# Initialize JacClient (it picks up env vars by default)
client = JacClient()

try:
    # Check the health of the connected Jaseci service
    health_status = client.get_health()
    print(f"Jaseci Cloud Health Status: {health_status}")

    # Example: Create a simple agent
    agent_name = "quickstart_example_agent"
    print(f"\nAttempting to create agent: {agent_name}")
    agent = client.create_agent(name=agent_name)
    print(f"Agent '{agent.name}' created with UUID: {agent.uuid}")

    # Example: Retrieve agent details
    retrieved_agent = client.get_agent(uuid=agent.uuid)
    print(f"Retrieved agent name: {retrieved_agent.name}")

    # Clean up: Delete the created agent
    print(f"Deleting agent: {agent.uuid}")
    delete_result = client.delete_agent(uuid=agent.uuid)
    print(f"Agent deletion result: {delete_result}")

except Exception as e:
    print(f"An error occurred: {e}")
    print("\nHint: Please ensure JAC_API_KEY and JAC_API_URL environment variables are set and point to a running Jaseci service.")

view raw JSON →