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.9.tar.gz (379.5 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.9-py3-none-any.whl (107.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for valsai-0.3.9.tar.gz
Algorithm Hash digest
SHA256 3fdadf7b7db2caa2236f32b6d6c1ab3037f11f25d27ef4a418053f550bf8249a
MD5 a2e740b3bfed7c8fe0cbc4557ce735b1
BLAKE2b-256 4bd0eb49e666764ce7cd9b0162df0e3eca12d867605be9981445585111b8f335

See more details on using hashes here.

Provenance

The following attestation bundles were made for valsai-0.3.9.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.9-py3-none-any.whl.

File metadata

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

File hashes

Hashes for valsai-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 47305ae1dc96b106126597b330b1f1979b51e031b1f6b26c3658baad8b2ab3f7
MD5 d81a30c6d8478db37ec18938eff8d078
BLAKE2b-256 4ca18a42aa75c1163d460cf636fd6ab58ac4801cd7d09176ac0236957f47e37a

See more details on using hashes here.

Provenance

The following attestation bundles were made for valsai-0.3.9-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