Checkout the documentation about steps for more information.

Create a step

step = await client.api.create_step(
    thread_id="<THREAD_UUID>",
    type="undefined",
)
thread_id
uuid
required
The id of the thread
type
string
The type of the step
start_time
string
Starting time in string format
end_time
string
Ending time in string format
input
dict
A dictionary symbolizing an input. Prefer using content key to store a message.
output
dict
A dictionary symbolizing an output. Prefer using content key to store a message.
metadata
dict
Metadata as a dict
parent_id
uuid
Parent ID in string format
name
string
Name in string format
tags
List[string]
List of tags in string format

Return type

step
Step
Return a Step

Update a step

step = await client.api.update_step(
  id="<STEP_UUID>",
  type="user_message",
)
id
uuid
required
Id as a string
type
StepType
Type of the step as StepType
input
string
Input in string format
output
string
Output in string format
metadata
Dict
Metadata in dictionary format
name
string
Name in string format
tags
List[string]
List of tags in string format
start_time
string
Start time as a string
end_time
string
End time as a string
parent_id
uuid
Parent identifier as a string

Return type

step
Step
Return a Step

Get a step

step = await client.api.get_step(
  id="<STEP_UUID>",
)
id
uuid
required
Id as a string

Return type

step
Step
Return a Step, can be None if the step is not found

Delete a step

step = await client.api.delete_step(
  id="<STEP_UUID>",
)
id
uuid
required
Id as a string

Send Steps

Useful to send multiple steps at the same time to the platform.
steps = [
    {
        "thread_id": "<THREAD_UUID>",
        "type": "llm",
    },
    {
        "thread_id": "<THREAD_UUID>",
        "type": "undefined",
    },
]

client.api.send_steps(steps=steps)

Return type

response
dict
GraphQL response in the format: {'data': {'step0': {'ok': True, 'message': None}}}