# build_task_spec

> **Function** in `langchain_parallel`

📖 [View in docs](https://reference.langchain.com/python/langchain-parallel/tasks/build_task_spec)

Build a ``TaskSpecParam`` dict from pydantic classes / schemas / text.

Mirrors the helper used in https://docs.parallel.ai/task-api/examples/task-enrichment.

## Signature

```python
build_task_spec(
    *,
    output_schema: Union[type[BaseModel], dict[str, Any], str],
    input_schema: Union[type[BaseModel], dict[str, Any], str, None] = None,
) -> dict[str, Any]
```

---

[View source on GitHub](https://github.com/parallel-web/langchain-parallel/blob/c1f8c1d657b86eaf948c363f84fed6ea6bd65754/langchain_parallel/tasks.py#L116)