> ## Documentation Index
> Fetch the complete documentation index at: https://chainlit-5-wd-prompt.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Step

> Create Read Update and Delete methods for Step

Checkout the documentation about [steps](/concepts/step) for more information.

## Create a step

```python
step = await client.api.create_step(
    thread_id="<THREAD_UUID>",
    type="undefined",
)
```

<ParamField path="thread_id" type="uuid" required>
  The id of the thread
</ParamField>

<ParamField path="type" type="string">
  The type of the step

  <Expandable title="properties">
    <ResponseField name="run" />

    <ResponseField name="tool" />

    <ResponseField name="llm" />

    <ResponseField name="embedding" />

    <ResponseField name="retrieval" />

    <ResponseField name="rerank" />

    <ResponseField name="undefined" />
  </Expandable>
</ParamField>

<ParamField path="start_time" type="string">
  Starting time in string format
</ParamField>

<ParamField path="end_time" type="string">
  Ending time in string format
</ParamField>

<ParamField path="input" type="dict">
  A dictionary symbolizing an input.
  Prefer using `content` key to store a message.
</ParamField>

<ParamField path="output" type="dict">
  A dictionary symbolizing an output.
  Prefer using `content` key to store a message.
</ParamField>

<ParamField path="metadata" type="dict">
  Metadata as a dict
</ParamField>

<ParamField path="parent_id" type="uuid">
  Parent ID in string format
</ParamField>

<ParamField path="name" type="string">
  Name in string format
</ParamField>

<ParamField path="tags" type="List[string]">
  List of tags in string format
</ParamField>

### Return type

<ResponseField name="step" type="Step">
  Return a Step
</ResponseField>

## Update a step

```python
step = await client.api.update_step(
  id="<STEP_UUID>",
  type="user_message",
)
```

<ParamField path="id" type="uuid" required>
  Id as a string
</ParamField>

<ParamField path="type" type="StepType">
  Type of the step as StepType
</ParamField>

<ParamField path="input" type="string">
  Input in string format
</ParamField>

<ParamField path="output" type="string">
  Output in string format
</ParamField>

<ParamField path="metadata" type="Dict">
  Metadata in dictionary format
</ParamField>

<ParamField path="name" type="string">
  Name in string format
</ParamField>

<ParamField path="tags" type="List[string]">
  List of tags in string format
</ParamField>

<ParamField path="start_time" type="string">
  Start time as a string
</ParamField>

<ParamField path="end_time" type="string">
  End time as a string
</ParamField>

<ParamField path="parent_id" type="uuid">
  Parent identifier as a string
</ParamField>

### Return type

<ResponseField name="step" type="Step">
  Return a Step
</ResponseField>

## Get a step

```python
step = await client.api.get_step(
  id="<STEP_UUID>",
)
```

<ParamField path="id" type="uuid" required>
  Id as a string
</ParamField>

### Return type

<ResponseField name="step" type="Step">
  Return a Step, can be None if the step is not found
</ResponseField>

## Delete a step

```python
step = await client.api.delete_step(
  id="<STEP_UUID>",
)
```

<ParamField path="id" type="uuid" required>
  Id as a string
</ParamField>

## Send Steps

Useful to send multiple steps at the same time to the platform.

```python
steps = [
    {
        "thread_id": "<THREAD_UUID>",
        "type": "llm",
    },
    {
        "thread_id": "<THREAD_UUID>",
        "type": "undefined",
    },
]

client.api.send_steps(steps=steps)
```

### Return type

<ResponseField name="response" type="dict">
  GraphQL response in the format: `{'data': {'step0': {'ok': True, 'message': None}}}`
</ResponseField>
