Skip to content

Commit

Permalink
Fix attribute location to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Aug 11, 2023
1 parent bf2bd6b commit eeaac6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions sdk/python/agent_protocol/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit eeaac6d

Please sign in to comment.