# validate_scope_with_model_id

> **Function** in `langchain_ibm`

📖 [View in docs](https://reference.langchain.com/python/langchain-ibm/utils/validate_scope_with_model_id)

Validate that scope (project_id or space_id) is provided when using model_id.

## Signature

```python
validate_scope_with_model_id(
    model_id: str | None,
    project_id: str | None,
    space_id: str | None,
    class_name: str,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `model_id` | `str \| None` | Yes | The model ID being used |
| `project_id` | `str \| None` | Yes | The project ID |
| `space_id` | `str \| None` | Yes | The space ID |
| `class_name` | `str` | Yes | Name of the class for error message (e.g., 'ChatWatsonx') |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-ibm/blob/9c14bbf81d1c7654824b315925778e4fa81426d7/libs/ibm/langchain_ibm/utils.py#L355)