# 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/234dcb368dc21a0291eaf9e7f37c777b5e9a1fcc/langchain_parallel/tasks.py#L116)