Skip to main content

Python client library for the AgentLab evaluation platform using Connect RPC

Reason this release was yanked:

Broken package

Project description

AgentLab Python Client

PyPI version Python 3.10+ License: MIT

A Python client library for the AgentLab evaluation platform using Connect RPC. This library provides a simple and intuitive interface for running AI agent evaluations, managing evaluators, and accessing evaluation results.

🚀 Quick Start

pip install agentlab-py

Set your API token as an environment variable:

export AGENTLAB_API_TOKEN=your-api-token-here
from agentlab import AgentLabClient, CreateEvaluationOptions

client = AgentLabClient()

evaluation = client.run_evaluation(CreateEvaluationOptions(
    agent_name='my-agent',
    agent_version='1.0.0',
    evaluator_names=['correctness-v1'],
    user_question='What is the capital of France?',
    agent_answer='The capital of France is Paris.',
    ground_truth='Paris is the capital of France',
    metadata={'confidence': 0.95}
))

print(f"Evaluation completed: {evaluation.name}")

Retrieving Results

evaluation_run = client.get_evaluation_run('evaluation-run-id')

result_data = client.get_evaluation_result('evaluation-run-id')
print(result_data['results'])  # Parsed evaluator outputs

for evaluator_name, result in evaluation_run.evaluator_results.items():
    print(f"{evaluator_name}: {result.output}")

Listing Evaluation Runs

runs_response = client.list_evaluation_runs('project-123')
for run in runs_response.evaluation_runs:
    print(f"Run: {run.name} - Question: {run.user_question}")

Managing Agent Prompts

from agentlab import CreateAgentVersionOptions

# Publish agent version with prompts (idempotent)
result = client.publish_agent_version(CreateAgentVersionOptions(
    agent_name='my-assistant',
    version='1.0.0',
    prompts={
        'system': 'You are a helpful AI assistant...',
        'guidelines': 'Always be polite and professional.'
    }
))

print(f"Published version: {result.create_time}")
for name, content in result.prompts.items():
    print(f"  {name}: {content[:50]}...")

Analyzing Agent Performance

from agentlab import AnalysisParameters

# Create analysis for the last 30 days
params = AnalysisParameters(min_evaluation_runs=5, time_range_days=30)
session = client.analyze_agent('my-agent', '1.0.0', params)

# Get results
session = client.get_analysis_session(session.id)
if session.status.value == "ANALYSIS_STATUS_COMPLETED":
    stats = session.analysis_data.statistical_summary
    print(f"Success rate: {stats.success_rate:.1%}")
    print(f"Average score: {stats.average_score:.3f}")

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Issues and Feature Requests

🔗 Links

🏢 About VectorLabs

AgentLab is developed by VectorLabs, a company focused on advancing AI agent evaluation and development tools.


Made with ❤️ by the VectorLabs team

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

agentlab_py-0.5.2.tar.gz (79.3 kB view details)

Uploaded Source

Built Distribution

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

agentlab_py-0.5.2-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file agentlab_py-0.5.2.tar.gz.

File metadata

  • Download URL: agentlab_py-0.5.2.tar.gz
  • Upload date:
  • Size: 79.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentlab_py-0.5.2.tar.gz
Algorithm Hash digest
SHA256 fa387ecba3159293ab57c24bcf3cde5b08f015f76c7fdc9545dd5c3862529494
MD5 4e8692f023f9280ffc3c187064ac3a57
BLAKE2b-256 3e5523a987f0e0e2996c6407eaa7865d39e2721a200e6b8db1bc458e2a99d318

See more details on using hashes here.

File details

Details for the file agentlab_py-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: agentlab_py-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentlab_py-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3a713e3c013973b06062fa7e4597dd0a308a8da0d3a7edfa0c36fb3185372b0
MD5 287cf6c65ca0ea07681852559d86e3ae
BLAKE2b-256 ba173ce31163d3b556fdaaf032acee426ba71ab680cee4fc4135fca19c0194b0

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