# construct_type

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_models/construct_type)

Loose coercion to the expected type with construction of nested values.

If the given value does not match the expected type then it is returned as-is.

## Signature

```python
construct_type(
    *,
    value: object,
    type_: object,
    metadata: Optional[List[Any]] = None,
) -> object
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-python/blob/15dd2a789f976bbbafd803b26d0f25c08b5ed527/src/langsmith/_models.py#L562)