Skip to content

Commit 2132c67

Browse files
update testing links
1 parent b533241 commit 2132c67

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

docs/testing/examples/langgraph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pip install langgraph
1919

2020
## Agent code
2121

22-
You can view the agent code [here](https://github.com/invariantlabs-ai/invariant/blob/main/testing/sample_tests/langgraph/weather_agent/weather_agent.py).
22+
You can view the agent code [here](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/sample_tests/langgraph/weather_agent/weather_agent.py).
2323

2424
This can be invoked as:
2525

docs/testing/examples/swarm.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ To get started quickly with testing your Swarm agent, you can use the following
1919
from swarm import Agent, Swarm
2020

2121
# for assertions
22-
from invariant.testing import assert_true
23-
from invariant.testing import functional as F
22+
from invariant_testing.testing import assert_true
23+
from invariant_testing.testing import functional as F
2424

2525
# for swarm testing support
26-
from invariant.testing.wrappers.swarm_wrapper import SwarmWrapper
26+
from invariant_testing.testing.wrappers.swarm_wrapper import SwarmWrapper
2727

2828

2929
def get_capital(country_name: str) -> str:
@@ -88,7 +88,7 @@ pip install openai-swarm
8888

8989
## Agent code
9090

91-
You can view the full code example of the example agent [here](https://github.com/invariantlabs-ai/invariant/blob/main/invariant/testing/sample_tests/swarm/capital_finder_agent/capital_finder_agent.py)
91+
You can view the full code example of the example agent [here](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/sample_tests/swarm/capital_finder_agent/capital_finder_agent.py)
9292

9393
The agent can be invoked as follows.
9494

docs/testing/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Overview
44

55
# Invariant `testing`: helps you build better AI agents through debuggable unit testing
66

7-
Invariant `testing` is a lightweight library to write and run AI agent tests. It provides helpers and assertions that enable you to write robust tests for your agentic applications.
7+
Invariant [`testing`](https://github.com/invariantlabs-ai/testing) is a lightweight library to write and run AI agent tests. It provides helpers and assertions that enable you to write robust tests for your agentic applications.
88

99
Using [**localized assertions**](writing/traces.ipynb), `testing` always points you to the exact part of the agent's behavior that caused a test to fail, making it easy to debug and resolve issues (_think: stacktraces for agents_).
1010

@@ -15,7 +15,7 @@ Using [**localized assertions**](writing/traces.ipynb), `testing` always points
1515
## Installation
1616

1717
```
18-
pip install invariant-ai
18+
pip install git+https://github.com/invariantlabs-ai/testing.git
1919
```
2020

2121
## A quick example
@@ -30,8 +30,8 @@ export OPENAI_API_KEY=<your-key>
3030

3131
```python
3232
# content of tests/test_weather.py
33-
import invariant.testing.functional as F
34-
from invariant.testing import Trace, assert_equals
33+
import invariant_testing.testing.functional as F
34+
from invariant_testing.testing import Trace, assert_equals
3535

3636
def test_weather():
3737
# create a Trace object from your agent trajectory

docs/testing/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To get started, first create a `tests/` folder in your project root. This folder
2323
Next, create a new file in `tests/` and name it `test_example.py` as shown below:
2424

2525
```python
26-
from invariant.testing import Trace, assert_true
26+
from invariant_testing.testing import Trace, assert_true
2727

2828
def test_weather():
2929
# create a Trace object from your agent trajectory

docs/testing/writing/matchers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ To accommodate this, `testing` includes several different `Matcher` implementati
1313

1414
Beyond that, `Matcher` is also a simple base class that allows you to write your own custom matchers, if the provided ones are not sufficient for your needs (e.g. custom properties).
1515

16-
## [`IsSimilar`](https://github.com/invariantlabs-ai/invariant/blob/main/testing/invariant/custom_types/matchers.py#L53)
16+
## [`IsSimilar`](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/custom_types/matchers.py#L53)
1717

1818
Checks if a string is similar to an expected string by checking if the similary score reaches a given threshold.
1919

20-
## [`LambdaMatcher`](https://github.com/invariantlabs-ai/invariant/blob/main/testing/invariant/custom_types/matchers.py#L18)
20+
## [`LambdaMatcher`](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/custom_types/matchers.py#L18)
2121

2222
Matcher for checking if a lambda function returns True on the underlying value. This can be useful to check for custom properties of outputs, while maintaining [addresses to localize failing](./tests.md) assertions.
2323

24-
## [`IsFactuallyEqual`](https://github.com/invariantlabs-ai/invariant/blob/main/testing/invariant/custom_types/matchers.py#L86)
24+
## [`IsFactuallyEqual`](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/custom_types/matchers.py#L86)
2525

2626
Checks for factual equality / entailment of two sentences or words. This can be used to check if two sentences are factually equivalent, or subset/superset of each other.
2727

28-
## [`ContainsImage`](https://github.com/invariantlabs-ai/invariant/blob/main/testing/invariant/custom_types/matchers.py#L153)
28+
## [`ContainsImage`](https://github.com/invariantlabs-ai/testing/blob/main/invariant_testing/testing/custom_types/matchers.py#L155)
2929

3030
Checks if the input contains an image in base64 encoding.

docs/testing/writing/parameterized-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In some cases, a certain agent functionality should generalize to multiple scena
1212
In `testing`, instead of writing a separate test for each city, you can use parameterized tests to test multiple scenarios. This ensures robustness and generalization of your agent's behavior.
1313

1414
```python
15-
from invariant.testing import Trace, assert_equals, parameterized
15+
from invariant_testing.testing import Trace, assert_equals, parameterized
1616
import pytest
1717

1818
@pytest.mark.parametrize(

docs/testing/writing/tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This chapter first discusses how _localized assertions_ work and then provides e
1515
A test case in `testing` looks a lot like a regular unit test, except that it always makes use of a `Trace` object and the corresponding `.as_context()` method. This is required to enable _localized assertions_, that maps assertions to specific ranges in the provided trace:
1616

1717
```python
18-
from invariant.testing import assert_true, Trace
18+
from invariant_testing.testing import assert_true, Trace
1919

2020
def test_assert():
2121
# obtain some trace
@@ -44,7 +44,7 @@ def test_assert():
4444
To make hard (leading to test failure) assertions, you can use the `assert_true`, `assert_that`, and `assert_equals` functions. These functions are similar to the ones you might know from unit testing frameworks like `unittest` or `pytest`, but they add support for localization.
4545

4646
```python
47-
from invariant.testing import assert_true, assert_equals, assert_that, Trace, IsSimilar
47+
from invariant_testing.testing import assert_true, assert_equals, assert_that, Trace, IsSimilar
4848

4949
def test_hard_assert():
5050
# obtain some trace
@@ -126,7 +126,7 @@ Next to hard assertions, `testing` also supports _soft assertions_ that do not l
126126
Instead, they are logged as warnings only and can be used to check (non-functional) agent properties that may not be critical to ensure functional correctness (e.g. number of tool calls, runtime, etc.), but are still important to monitor.
127127

128128
```python
129-
from invariant.testing import expect_equals, Trace, IsSimilar
129+
from invariant_testing.testing import expect_equals, Trace, IsSimilar
130130

131131
def test_soft_assert():
132132
# obtain some trace

docs/testing/writing/traces.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"metadata": {},
2525
"outputs": [],
2626
"source": [
27-
"from invariant.testing import Trace\n",
27+
"from invariant_testing.testing import Trace\n",
2828
"\n",
2929
"trace = Trace(trace=[\n",
3030
" {\"role\": \"user\", \"content\": \"Hello there\"},\n",

0 commit comments

Comments
 (0)