Skip to content

Commit

Permalink
fix: fixed get_bucket call
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed Dec 18, 2023
1 parent 5eaeaf7 commit be52644
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aidial_adapter_bedrock/dial_api/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand Down

0 comments on commit be52644

Please sign in to comment.