Skip to content

Commit

Permalink
Merge pull request #302 from pactflow/feat/ai-beta-docs
Browse files Browse the repository at this point in the history
feat: ai open beta
  • Loading branch information
mefellows authored Sep 12, 2024
2 parents 230f46b + d339957 commit 1a595f6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 18 deletions.
80 changes: 63 additions & 17 deletions website/docs/docs/ai/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
---
title: PactFlow AI
sidebar_label: AI
sidebar_label: AI ⚡️
---

import { AiDownloadTable } from "../../../src/components/index";

:::note
The PactFlow AI feature is currently in closed beta and is available only to select customers who have joined the [waitlist](https://pactflow.io/ai/). If you’re interested in participating, please [register here](https://pactflow.io/ai/).
The PactFlow AI features are currently available through an open beta program. During this stage, all customers can explore the capabilities within fixed usage limits ([more info](#limits)).
:::

## Prerequisites
PactFlow's Test Generation feature is an AI-powered tool designed to help users quickly generate Pact tests. By providing access to source code, OpenAPI documents, or traffic capture data, it reduces the time and effort needed to create and maintain contract tests.

1. A PactFlow cloud account (you can create a [free account here](https://pactflow.io/try-for-free/))
2. AI feature enabled on your account by SmartBear
## Enabling the feature

This feature is disabled by default on all organisations. To enable the feature:

1. In the UI, navigate to "Settings" -> "Preferences" -> "System Preferences".
2. Check the "Test Generation" checkbox.
3. Save the settings.

:::note
This setting is only available in the new user interface.
:::

## Installation

Expand All @@ -26,44 +35,81 @@ Verify the installation by running `pactflow-ai` to ensure it executes successfu

### Manual installation

Alternatively, download the latest version for your operating system and architecture from the table below. Remember to add it to your environment's `PATH`:
Alternatively, download the latest version for your OS and architecture from the table below. Be sure to add it to your environment's `PATH`:

<AiDownloadTable />

## Usage

Running `pactflow-ai --help` will give you the detailed usage for any of the subcommands.
Running `pactflow-ai --help` will show detailed usage for any subcommands.

### Authentication

Authentication requires valid PactFlow API Tokens, which can be obtained from the `Settings > Tokens` [page](/docs/user-interface/settings/api-tokens) of your PactFlow account.
Authentication requires valid PactFlow API Tokens, which can be obtained from the `Settings > Tokens` [page](/docs/user-interface/settings/api-tokens) of your PactFlow organisation.

There are several ways to authenticate with the CLI:
You can authenticate with the CLI in several ways:

#### Environment Variables

Export the following environment variables, and the CLI will use these credentials to communicate with PactFlow:
Set the following environment variables, and the CLI will use them to communicate with PactFlow:

```
export PACT_BROKER_BASE_URL="https://YOUR_ACCOUNT.pactflow.io"
export PACT_BROKER_BASE_URL="https://YOUR_ORG.pactflow.io"
export PACT_BROKER_TOKEN="YOUR_TOKEN"
```

#### Local configuration file

You can also configure the CLI using the following commands:
Configure the CLI using the following commands:

```
pactflow-ai config set url https://YOUR_ACCOUNT.pactflow.io
pactflow-ai config set token YOUR_TOKEN
pactflow-ai config set broker.base-url https://YOUR_ORG.pactflow.io
pactflow-ai config set broker.auth.token YOUR_TOKEN
```

This will create a `.pactflow.toml` file, which should be added to your `.gitignore`.
This creates a `.pact.toml` file, which should be added to your `.gitignore`.

#### User configuration file

Alternatively, the user configuration file can be stored in a configuration directory for PactFlow. The paths are `~/.config/pactflow/config.toml` on Unix, and `%APPDATA%\pactflow\config.toml` on Windows.
Alternatively, store the user configuration file in `~/.config/pact/config.toml` (Unix and macOS), and `%APPDATA%\pact\config.toml` (Windows).

Pass the `--user` flag when running `pactflow-ai config set` to write to this file automatically.

## Usage Limits

Access to the feature is metered based on the number of tests generated in a 30-day rolling window. Credits are allocated as follows:

1. Starter Plans: 10 credits per month
2. All other plans: 10 credits per purchased user per month

Credits are allocated to the organisation, not individual users.

### Examples

1. **Starter Plan**

If you have a free plan (20 active users), you are only entitled to 10 tests per month.

**2. Team Plan**

If you are on a Team 10 Plan with 5 active users, you are eligible for 10 credits x 10 users = 100 credits total.

**2. Enterprise Plan**

If you are on an Enterprise Plan with 50 users (42 active), you are eligible for 10 credits x 50 users = 500 credits total.

### Consumption

Each successfully generated test consumes a credit. If your organisation reaches its limit, you will see the following error:

```
ERROR: Client error: 403 Forbidden AI credits are exhausted.
```

:::note
The limits and your usage against these limits are not currently visible on the subscription page. This will be added in due course.
:::

## Getting help and providing feedback

For feedback, feature requests, or assistance with the tool, please contact the email address provided when you were granted access. For support unrelated to the AI feature, please follow the [usual methods](https://support.smartbear.com/pactflow/message/).
For feedback, feature requests, or assistance with the tool, join our [slack channel](https://pact-foundation.slack.com/archives/C07K2FT0XKK) or speak directly with your Account Manager. For general support, please follow the [usual methods](https://support.smartbear.com/pactflow/message/).
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
themeConfig: {
announcementBar: {
id: 'announcement-bar',
content: '<div id="announcement-bar">🔥 Join the Waitlist for Early Access to PactFlow\'s AI-Augmented Contract Testing! <a target="_blank" href="https://pactflow.io/ai/?utm_source=docs.pactflow.io&utm_medium=web&utm_campaign=ai-beta&utm_content=banner">Sign Up Now >></a>.</div>',
content: '<div id="announcement-bar">🚀 AI Automation is Here! Simplify Contract Testing with PactFlow. <a target="_blank" href="https://pactflow.io/ai/?utm_source=docs.pactflow.io&utm_medium=web&utm_campaign=ai-beta&utm_content=banner">Sign Up Now >></a>.</div>',
backgroundColor: '#454CF0',
textColor: '#fff',
isCloseable: false,
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module.exports = {
type: 'category',
label: 'Features',
items: [
'docs/ai/index',
'docs/stubs',
{
type: 'category',
Expand Down

0 comments on commit 1a595f6

Please sign in to comment.