Skip to main content

A Python SDK for using Aymara to test your AI alignment.

Project description

Aymara Python SDK

Hi! 👋 We're Aymara.

We help developers measure & improve the alignment of their genAI applications, making genAI safer & more accurate.

So we built this library for you.

Our Python SDK provides convenient access to the Aymara REST API from Python 3.9+. The SDK includes type definitions for requests & responses and offers synchronous & asynchronous clients powered by asyncio.

Access our API with a free trial or upgrade for access to full funcionality.

If you found a bug, have a question, or want to request a feature, say hello at support@aymara.ai or open an issue on our GitHub repo.

Documentation

docs.aymara.ai/sdk_reference has our full library API.

Features

Now

  • Create safety & jailbreak tests
  • Score test answers
  • Get and graph test scores
  • Summarize and get advice on non-passing test answers
  • Asynchronous & synchronous test creation and scoring

Upcoming

  • Hallucination tests
  • Text-to-image tests
  • AI regulation tests

Installation

You will need the Aymara GitHub personal access token from your company. Treat the token like a password and never share it or include it in your code. Instead, add it to your env variables:

export GITHUB_PAT=[GITHUB_PAT]

Then, create a virtual environment and install the SDK from GitHub:

pip install aymara-ai

Configuration

The SDK needs to know who you are. Create an env variable with your Aymara API key:

export AYMARA_API_KEY=[AYMARA_API_KEY]

Or supply your key directly to the client:

client = AymaraAI(api_key="your_api_key")

Usage

Refer to this notebook for a walkthrough of how to use the SDK.

Versioning

This package generally follows SemVer conventions. Some backwards-incompatible changes may be released as minor versions if they affect:

  1. Static types without breaking runtime behavior.
  2. Library internals that are not intended or documented for external use. (Please open an issue if you are relying on internals).
  3. Virtually no users in practice.

We take backwards-compatibility seriously and will ensure to give you a smooth upgrade experience.

Requirements

Python 3.9 or higher.

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

aymara_ai-0.4.0.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

aymara_ai-0.4.0-py3-none-any.whl (123.0 kB view details)

Uploaded Python 3

File details

Details for the file aymara_ai-0.4.0.tar.gz.

File metadata

  • Download URL: aymara_ai-0.4.0.tar.gz
  • Upload date:
  • Size: 76.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.17

File hashes

Hashes for aymara_ai-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b5c44e2e7149926ea633c802ffc1867f1f5a8c099d060b2f60b6bb3ebd6c62e5
MD5 d2256e61fec5fc71b7b0e2a587d47b73
BLAKE2b-256 135d38a10c3df786d148124319e5cfa6efc191aea9d88e1616d825b4c56ca145

See more details on using hashes here.

File details

Details for the file aymara_ai-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aymara_ai-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79abed39a5748fd7fe7a62e30ce63fb07eddeeca2c0d57036ba2b9c62a9d15b7
MD5 692f9be5c1453d223e84674680ec66a0
BLAKE2b-256 627c3a8c0a4ac7f52f659e214302fadac4f60e612774714cb5b4a6a237657fa2

See more details on using hashes here.

Supported by

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