> ## Documentation Index
> Fetch the complete documentation index at: https://snowglobe.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating to 0.4.0

Get ready for a major upgrade with Guardrails 0.4.0! This release introduces a free ecosystem of powerful validator tools, distributed as standalone packages. This innovative approach allows you to access specialized functionality without bloating the core Guardrails package, keeping it lean and efficient.

To pave the way for this, some backwards compatibility adjustments have been made, primarily affecting validator usage.

## New Features

### New `validate` function on Guard

Guard 0.4.0 introduces validate, replacing parse for string validation. It's clearer and less likely to be misinterpreted. parse is deprecated, so switch to validate now for future compatibility.

Example:

```python theme={null}
guard.parse("some_string")  # Old
guard.validate("some_string")  # New (preferred)
```

### Unlock new tools with the Guardrails CLI:

Interact directly with the Guardrails CLI for expanded functionality.

Install: `pip install guardrails-ai`

Get started: `guardrails --help`

### New Approach to Guard Construction

We've introduced a novel way to define and combine guards, simplifying the overall process. The previous method required constructing guards from specific validation types (`from_pydantic`, `from_string`), but now you can leverage a validator-first approach with assumed string validation.

Single Validator Usage:

```python theme={null}
from guardrails_ai.validator_of_choice import ValidatorOfChoice

Guard().use(ValidatorOfChoice(args))(
    llm_api=...,
    model=...,
    prompt=...,
)
```

In this example:

* ValidatorOfChoice: Replace with the actual validator you want to use.
* args: Pass any necessary arguments to the validator constructor.
* llm\_api, model, prompt: Provide values for these parameters as usual.

#### Multiple Validator Usage:

Multiple validators can be combined in two ways:

**1. linking**`use`**:**

```python theme={null}
from guardrails_ai.validator_a import ValidatorA
from guardrails_ai.validator_b import ValidatorB
Guard() \
    .use(ValidatorA()) \
    .use(ValidatorB()) \
    .validate("Some text")
```

**2.**`use_many`**for Concise Composition:**

```python theme={null}
from guardrails_ai.validator_a import ValidatorA
from guardrails_ai.validator_b import ValidatorB

Guard().use_many(ValidatorA(), ValidatorB())(
    llm_api=...,
    model=...,
    prompt=...,
)
```

## Backwards-incompatible changes

We've moved validators into standalone PyPI packages, reducing the core package size for faster installations and smoother workflows.

Targeted validation: Install only the validators you need, streamlining your project and dependencies.

New naming: Some validator names changed for clarity and consistency. Install the ones you need with `pip install guardrails-ai-<name>`.
