From 1d99dbbf2b8973dd2a07efc01897e275700b9584 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Sun, 5 May 2024 08:45:44 +0400 Subject: [PATCH 1/2] Update Docker poetry install commands to resolve deprecation and lock file issues --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 50db068..45a17a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN pip install --no-cache-dir poetry \ COPY poetry.lock /env/poetry.lock COPY pyproject.toml /env/pyproject.toml -RUN cd /env && poetry install --no-dev +RUN cd /env && poetry lock --no-update && poetry install --only main EXPOSE 8086 From 1f26c5d2c032c09579b08c526f71180f5cdb3fd0 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Sun, 5 May 2024 08:46:38 +0400 Subject: [PATCH 2/2] Fix coroutine handling error in tool output submission --- app/services/run/run.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/services/run/run.py b/app/services/run/run.py index d960870..beb5cfb 100644 --- a/app/services/run/run.py +++ b/app/services/run/run.py @@ -193,20 +193,19 @@ async def submit_tool_outputs_to_run( return db_run @staticmethod - def get_in_progress_run_step(*, run_id, session: Session) -> RunStep: - run_step = ( - session.execute( - select(RunStep) - .where(RunStep.run_id == run_id) - .where(RunStep.type == "tool_calls") - .where(RunStep.status == "in_progress") - .order_by(desc(RunStep.created_at)) - ) - .scalars() - .one_or_none() + async def get_in_progress_run_step(*, run_id: str, session: AsyncSession): + result = await session.execute( + select(RunStep) + .where(RunStep.run_id == run_id) + .where(RunStep.type == "tool_calls") + .where(RunStep.status == "in_progress") + .order_by(desc(RunStep.created_at)) ) + run_step = result.scalars().one_or_none() + if not run_step: raise ResourceNotFoundError("run_step not found or not in progress") + return run_step @staticmethod