Skip to content

Run util

logger = logging.getLogger(__name__) module-attribute

InterruptReasons

Bases: StrEnum

INTERRUPT_REQUESTED = 'Interrupt requested' class-attribute instance-attribute

MAX_STEPS_REACHED = 'Max steps reached' class-attribute instance-attribute

InvalidGraphStateError

Bases: BackendError

check_initial_status_not_started_or_partial(status, user_input)

complete_run(conv_uow, message_search_uow, read_only_uow, updatable, assistant_run, sub_assistant_state_datas) async

Complete the assistant run.

  • Update the conversation with completed run (move from pending to complete and add new messages to message history)
  • Add new messages to vectorstore

log_debug_info(graph_state)

make_sdk_run_values(read_only_uow, assistant_run, user_input, sub_assistant_run_info, resuming, interrupt_before, interrupt_after) async

Create collection of inputs that are used when calling a langgraph_sdk run.

update_assistant_run_from_graph_state(assistant_run, graph_state)

Use values from the graph state to update assistant run.

  • Update current response messages
    • Note: If resuming from partial, not all messages will be new.

update_from_thread_state(lg_client, thread_uid, run, interrupt_before) async