Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/api/routers/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async def delete_thread_and_checkpoints(
detail=f"Thread {thread_id} not found",
)

await agent.aclear_thread(thread_id)
if agent.checkpointer is not None:
await agent.checkpointer.adelete_thread(thread_id)


@router.get("/threads/{thread_id}/messages")
Expand Down
9 changes: 3 additions & 6 deletions tests/app/api/routers/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def send_feedback(self, feedback: Feedback, created: bool):


class MockReActAgent:
def __init__(self):
self.checkpointer = None

def invoke(self, input, config):
return {"messages": [AIMessage("Mock response")]}

Expand All @@ -46,12 +49,6 @@ async def astream(self, input, config, stream_mode):
yield "updates", chunk
yield "values", chunk

def clear_thread(self, thread_id):
return

async def aclear_thread(self, thread_id):
return


@pytest.fixture(autouse=True)
def disable_auth_dev_mode(monkeypatch: pytest.MonkeyPatch):
Expand Down