# create_temp_artifact

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/auto_mode/AutoModeHITLMiddleware/__init__/create_temp_artifact)

Create a private OS-temp text file for this request.

Use this instead of `write_file` when a command needs a temporary input
file, such as a pull-request body passed with `--body-file`. Dcode chooses
and exclusively allocates the path; callers cannot select or overwrite one.

## Signature

```python
create_temp_artifact(
    content: Annotated[str, Field(description='UTF-8 text to write once to the scratch file.')],
    runtime: ToolRuntime[Any, AutoModeState],
    suffix: Annotated[str, Field(description='Optional short extension such as `.md`.')] = '',
) -> Command[Any]
```

## Returns

`Command[Any]`

A tool message containing the allocated absolute path.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/auto_mode.py#L2494)