Skip to content

Commit

Permalink
Adding attachment URL to post_message_attachment response. (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
YushengAuggie authored Apr 23, 2024
1 parent c29520d commit f471849
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fastapi_poe/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,10 @@ async def _make_file_attachment_request(
f"{response.status_code} {response.reason_phrase}: {''.join(error_pieces)}"
)

response_data = response.json()
return AttachmentUploadResponse(
inline_ref=response.json().get("inline_ref")
inline_ref=response_data.get("inline_ref"),
attachment_url=response_data.get("attachment_url"),
)

except httpx.HTTPError:
Expand Down
1 change: 1 addition & 0 deletions src/fastapi_poe/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class SettingsResponse(BaseModel):

class AttachmentUploadResponse(BaseModel):
inline_ref: Optional[str]
attachment_url: Optional[str]


class PartialResponse(BaseModel):
Expand Down

0 comments on commit f471849

Please sign in to comment.