Skip to main content

Official Python client library for 172.ai A2A (Agent-to-Agent) communication

Project description

a2a-client-172ai

Official Python client library for 172.ai A2A (Agent-to-Agent) communication system.

Installation

pip install a2a-client-172ai

Import as:

from a2a_client import A2AClient

Quick Start

from a2a_client import A2AClient

client = A2AClient(
    api_key='sk_your_api_key',
    agent_id='test-runner-v1',
    agent_type='testing'
)

# Setup test environment
test_container = client.create_container({
    'name': f'test-env-{int(time.time())}',
    'dockerfile': '''
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install
RUN npm install -g jest cypress
CMD ["npm", "run", "test:all"]
    ''',
    'tags': ['testing', 'e2e']
})

# Build and run tests
build_result = client.build_container(test_container['id'])
print(f'Test build initiated: {build_result["buildLogId"]}')

Configuration

Required Parameters

  • api_key: API key with A2A scope from 172.ai dashboard
  • agent_id: Unique identifier for your agent instance
  • agent_type: One of:
    • code-analysis - Code quality and security analysis
    • testing - Automated testing and QA
    • deployment - CI/CD and orchestration
    • monitoring - Observability and metrics
    • security - Vulnerability scanning
    • documentation - Technical documentation
    • integration - API management
    • generic - General purpose

Optional Parameters

  • base_url: API base URL (default: 'https://api.172.ai')
  • timeout: Request timeout in seconds (default: 30)

API Methods

Authentication

# Test authentication
client.authenticate()

# Get platform capabilities
capabilities = client.get_capabilities()

# Health check
health = client.health_check()

Container Operations

# List containers
containers = client.list_containers(limit=10)

# Get container
container = client.get_container(container_id)

# Create container
new_container = client.create_container({
    'name': 'my-container',
    'dockerfile': 'FROM alpine:latest',
    'tags': ['test'],
    'isPrivate': True
})

# Build container
build = client.build_container(container_id)

# Update container
client.update_container(container_id, {'name': 'new-name'})

# Delete container
client.delete_container(container_id)

Build Operations

# Get build status
status = client.get_build_status(container_id, build_log_id)

# Get build logs
logs = client.get_build_logs(container_id, build_log_id)

# List builds
builds = client.list_builds(container_id)

Container Execution

# Get cost estimate
estimate = client.get_execution_cost_estimate(container_id, 1)

# Start execution
execution = client.start_execution(container_id, duration_days=1)

# Get execution status
status = client.get_execution_status(container_id)

# Stop execution
client.stop_execution(container_id)

# Get execution history
history = client.get_execution_history(container_id)

# List all executions
executions = client.list_executions()

File Operations

import base64

# Upload file
client.upload_file(
    container_id,
    'config.yml',
    base64.b64encode(b'config: value').decode('utf-8'),
    'application/x-yaml'
)

# List files
files = client.list_files(container_id, '/app')

# Get file content
content = client.get_file(container_id, 'config.yml')

Examples

See the examples directory for complete SDLC workflow examples.

License

MIT

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

a2a_client_172ai-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

a2a_client_172ai-1.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file a2a_client_172ai-1.0.0.tar.gz.

File metadata

  • Download URL: a2a_client_172ai-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for a2a_client_172ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dbf644936ec38adac7441671c66197f0ac6d336407052951784193d76d676452
MD5 fb2d97406442a8252019495a3195e924
BLAKE2b-256 f94ac126f28cbb2ee367208076de4e2591827812ed7aaa13c7ead75412c14316

See more details on using hashes here.

File details

Details for the file a2a_client_172ai-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for a2a_client_172ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 912b109a102ed8cbe0b99519354d17d31f454f98fe872f74450a88305f09d041
MD5 82211e1c24ea53394fb60ae2f2938381
BLAKE2b-256 133dbb413c81c334390ab1caac0c7094da2d79dd2ac5dd2562657924c4137568

See more details on using hashes here.

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