Skip to content

Commit

Permalink
Merge pull request #62 from VRSEN/main
Browse files Browse the repository at this point in the history
Resolve Coroutine Handling Error in Tool Output Submission
  • Loading branch information
liuooo authored May 7, 2024
2 parents f65730a + 1f26c5d commit 6735ba7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 10 additions & 11 deletions app/services/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6735ba7

Please sign in to comment.