Skip to main content

SDK for the Vals AI Platform

Project description

Vals AI CLI and SDK Tool

Install

pip install valsai

Overview

This Python package contains two items - a CLI tool to use Vals from the command line, and an SDK to use Vals from Python code.

All code is contained within vals/, separated by CLI and SDK. Note that many of the CLI functions are just thin wrappers around the SDK.

Examples

We've provided a set of examples in examples/. They are organized as follows:

  • suites/ - These are example JSON files, of the sort that you may use for vals suite create <example.json>.
  • scripts/ - These are example Python scripts that leverage the sdk.

Authentication

Make an account at platform.vals.ai and confirm your email.

Then, go to platform.vals.ai/project/default-project/settings/api-keys and create an API key. If using a different project, navigate to that project's settings instead.

If you are using the command line, you should set the following:

export VALS_API_KEY=<YOUR API KEY>

If you're using the EU instance of vals, you should also set export VALS_REGION=europe. Include these in your .zshrc / .bashrc to make them permanent.

See the documentation for passing in your API key directly via Python code for SDK usage.

CLI Usage

The CLI is run as follows:

$ vals

Use the --help flag at the top and subcommand level for guidance.

Commands must be run from the pip environment the cli was installed in. Commands are split up into subcommands. Currently there are three main subcommands:

  • vals suite --help: relating to creating / updating tests and suites
  • vals run --help: relating to creating and querying runs and run results
  • vals project --help: relating to listing and managing projects

Full documentation of the CLI usage can be found in our documentation at docs.vals.ai/cli/cli

SDK Usage

All of the functionality that is in the CLI can also be accessed via Python functions, as well as features only available in the SDK.

See usage documentation in our docs: docs.vals.ai/sdk

Development

Local installation

The sdk uses uv for dependency management. A Makefile is provided to help with development.

To install dependencies, run:

make install

Run the following command to install it locally. The -e flag is optional, but recommended, as it allows you to make changes to the code without reinstalling. The dev flag is required for dev-only depedencies.

pip install -e ".[dev]"

If using the sdk in a project, to install the sdk in editable mode (apply local sdk changes without reinstalling), in your project directory run:

uv pip install -e /path/to/vals-sdk

or

pip install -e /path/to/vals-sdk

Additional Makefile commmands

make install        Install dependencies for development
make test           Run tests
make style          Lint & Format
make typecheck      Typecheck
make codegen        Generate GraphQL client

Running Codegen

Add additional .graphql files to vals/graphql, then run the following command:

make codegen

or

ariadne-codegen --config codegen-config.toml

NOTE: This will overwrite anything in the vals/graphql_client directory.

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

valsai-0.3.10.tar.gz (381.0 kB view details)

Uploaded Source

Built Distribution

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

valsai-0.3.10-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

Details for the file valsai-0.3.10.tar.gz.

File metadata

  • Download URL: valsai-0.3.10.tar.gz
  • Upload date:
  • Size: 381.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for valsai-0.3.10.tar.gz
Algorithm Hash digest
SHA256 80bd309f00beb9e990205e0f63d7e1782ec63b0ad4140aee767790cca741131b
MD5 c07bb00fc3bbd0b0f3c20dfa83e62fab
BLAKE2b-256 d313374273d6855ca5b2c003644eb77e1608aabbc315b547d1acf704c3a73793

See more details on using hashes here.

Provenance

The following attestation bundles were made for valsai-0.3.10.tar.gz:

Publisher: sdk-publish.yml on vals-ai/platform

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

File details

Details for the file valsai-0.3.10-py3-none-any.whl.

File metadata

  • Download URL: valsai-0.3.10-py3-none-any.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for valsai-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 29d8b0c55585b88eae21454977e578f11cfcaca36db6c6b9985659a9bb967022
MD5 d016b8effaf01750632af2e1f1074431
BLAKE2b-256 2a910984a969fc737a72a7117f168d8b40608c282f34d8367a61ba360e4a4733

See more details on using hashes here.

Provenance

The following attestation bundles were made for valsai-0.3.10-py3-none-any.whl:

Publisher: sdk-publish.yml on vals-ai/platform

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