init
__all__ = ['AbstractAssistantRunRepository', 'AbstractAssistantRunUOW', 'AssistantRunID', 'create', 'new_assistant_run', 'resume_assistant_run']
module-attribute
AbstractAssistantRunRepository
Bases: RepositoryBase[AssistantRunSchema, AssistantRunID], ABC
update_conversation_with_run(conv_uow, conversation_id, assistant_run)
async
AbstractAssistantRunUOW
Bases: AbstractDatabaseUnitOfWork, ABC
repository
instance-attribute
AssistantRunID
Bases: UniqueIDBase[AssistantRunSchema]
thread_uid
instance-attribute
equal_excluding_version_and_deletion(other)
from_schema(schema, exact_version=False)
classmethod
create(uow, schema)
async
new_assistant_run(assistant_run_uow, conv_uow, read_only_uow, message_search_uow, lg_client, updatable, conversation_id, user_input, interrupt_before=None, interrupt_after=None)
async
Run an assistant from scratch (i.e. not a continuation of partially completed run).
This starts a new thread in langgraph. The thread can be resumed later if interrupted.
- Initializes (creating new pending run on conversation)
- Runs the assistant
| PARAMETER | DESCRIPTION |
|---|---|
assistant_run_uow
|
UOW for AssistantRun
TYPE:
|
conv_uow
|
UOW for conversation services (for creating a new assistant_run, and updating conversation at the end) |
read_only_uow
|
UOW for read-only services |
message_search_uow
|
UOW for message search services
TYPE:
|
lg_client
|
LangGraphClient
TYPE:
|
updatable
|
Any updatable that will receive updates during the run
TYPE:
|
conversation_id
|
Database ID of the conversation
TYPE:
|
user_input
|
User input for the assistant_run
TYPE:
|
interrupt_before
|
Nodes to interrupt before
TYPE:
|
interrupt_after
|
Nodes to interrupt
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AssistantRunSchema
|
The new assistant_run schema
TYPE:
|
resume_assistant_run(assistant_run_uow, conv_uow, read_only_uow, message_search_uow, lg_client, updatable, conversation_id, thread_uid, additional_inputs, interrupt_before=None, interrupt_after=None)
async
Resumes a previously interrupted assistant_run.
Effectively resumes the thread in langgraph.
| PARAMETER | DESCRIPTION |
|---|---|
assistant_run_uow
|
UOW for AssistantRun
TYPE:
|
conv_uow
|
UOW for conversation services (for updating conversation at the end) |
read_only_uow
|
UOW for read-only services |
message_search_uow
|
UOW for message search services
TYPE:
|
lg_client
|
LangGraphClient
TYPE:
|
updatable
|
Any updatable that will receive updates during the run
TYPE:
|
conversation_id
|
Database ID of the conversation
TYPE:
|
thread_uid
|
The thread ID of the assistant_run to resume
TYPE:
|
additional_inputs
|
Any additional inputs to resume graph with (i.e. updates to state on resume)
TYPE:
|
interrupt_before
|
Nodes to interrupt before
TYPE:
|
interrupt_after
|
Nodes to interrupt
TYPE:
|