diff --git a/sdk/python/agent_protocol/agent.py b/sdk/python/agent_protocol/agent.py index 130c29b..8c894c5 100644 --- a/sdk/python/agent_protocol/agent.py +++ b/sdk/python/agent_protocol/agent.py @@ -2,11 +2,11 @@ import os import aiofiles -from fastapi import APIRouter, UploadFile +from fastapi import APIRouter, UploadFile, Form, File from fastapi.responses import FileResponse from hypercorn.asyncio import serve from hypercorn.config import Config -from typing import Awaitable, Callable, List, Optional +from typing import Awaitable, Callable, List, Optional, Annotated from .db import InMemoryTaskDB, TaskDB from .server import app @@ -135,7 +135,9 @@ async def list_agent_task_artifacts(task_id: str) -> List[Artifact]: tags=["agent"], ) async def upload_agent_task_artifacts( - task_id: str, file: UploadFile, relative_path: Optional[str] = None + task_id: str, + file: Annotated[UploadFile, File()], + relative_path: Annotated[Optional[str], Form()] = None, ) -> Artifact: """ Upload an artifact for the specified task. @@ -207,7 +209,9 @@ def get_artifact_path(task_id: str, artifact: Artifact) -> str: """ Get the artifact path for the specified task and artifact. """ - return os.path.join(Agent.get_artifact_folder(task_id, artifact), artifact.file_name) + return os.path.join( + Agent.get_artifact_folder(task_id, artifact), artifact.file_name + ) @staticmethod def start(port: int = 8000, router: APIRouter = base_router): diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index fb60021..45fc2c8 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "agent-protocol" -version = "0.2.3" +version = "0.2.4" description = "API for interacting with Agent" authors = ["e2b "] license = "MIT"