Skip to content

Commit

Permalink
Add new fields for API 1.2 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Aug 1, 2023
1 parent d0ba79c commit 1a1feb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "fastapi_poe"
version = "0.0.15"
version = "0.0.16"
authors = [
{ name="Lida Li", email="[email protected]" },
]
Expand Down
10 changes: 10 additions & 0 deletions src/fastapi_poe/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class MessageFeedback(BaseModel):
reason: Optional[str]


class Attachment(BaseModel):
url: str
content_type: str
name: str


class ProtocolMessage(BaseModel):
"""A message as used in the Poe protocol."""

Expand All @@ -24,6 +30,7 @@ class ProtocolMessage(BaseModel):
timestamp: int = 0
message_id: str = ""
feedback: List[MessageFeedback] = Field(default_factory=list)
attachments: List[Attachment] = Field(default_factory=list)


class BaseRequest(BaseModel):
Expand All @@ -40,6 +47,7 @@ class QueryRequest(BaseRequest):
user_id: Identifier
conversation_id: Identifier
message_id: Identifier
metadata: Identifier = ""
api_key: str = "<missing>"
temperature: float = 0.7
skip_system_prompt: bool = False
Expand Down Expand Up @@ -70,3 +78,5 @@ class ReportErrorRequest(BaseRequest):
class SettingsResponse(BaseModel):
context_clear_window_secs: Optional[int] = None
allow_user_context_clear: bool = True
server_bot_dependencies: Dict[str, int] = Field(default_factory=dict)
allow_attachments: bool = False

0 comments on commit 1a1feb9

Please sign in to comment.