diff --git a/aidial_adapter_bedrock/dial_api/storage.py b/aidial_adapter_bedrock/dial_api/storage.py index db753fe..7bc08a6 100644 --- a/aidial_adapter_bedrock/dial_api/storage.py +++ b/aidial_adapter_bedrock/dial_api/storage.py @@ -38,7 +38,8 @@ async def _get_bucket(dial_url: str, auth: Auth) -> str: f"{dial_url}/v1/bucket", headers=auth.headers ) as response: response.raise_for_status() - return await response.text() + body = await response.json() + return body["bucket"] @staticmethod def to_form_data( @@ -58,8 +59,8 @@ async def upload( ) -> FileMetadata: async with aiohttp.ClientSession() as session: data = FileStorage.to_form_data(filename, content_type, content) - async with session.post( - self.base_url, + async with session.put( + f"{self.base_url}/{filename}", data=data, headers=self.auth.headers, ) as response: