# Constraints API

Apply constraints to any SDV synthesizer.

## Constraints API

### add\_constraints

Use this function to add constraints to your synthesizer.

**Parameters**

* (required) `constraints`: A list of constraint objects or an auto-detected `ConstraintList` object to add to your synthesizer. You can supply [**auto-detected constraints**](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/auto-detect-constraints), [**predefined constraints**](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/predefined-constraints) or [**program your own constraints**](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/program-your-own-constraint).

**Output** (None)

```python
synthesizer.add_constraints(
    constraints=[my_constraint]
)
```

### get\_constraints

Use this function to inspect all of the constraints your synthesizer contains.

**Parameters** None

**Output** A list of the constraint objects that you have supplied to your synthesizer

```python
synthesizer.get_constraints()
```

### get\_metadata

Adding constraints to your synthesizer may internally modify the metadata. Use this function to get the modified metadata after the constraints have been added.

**Parameters**

* `version`: The version of metadata to get. Supply `'modified'` to get the modified version of the metadata (after applying the constraints).

**Output** A Metadata object with the modified metadata

```python
modified_metadata = synthesizer.get_metadata(version='modified')
```
