-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Ingestion Pipeline, ready for review
- Loading branch information
Showing
5 changed files
with
49 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
from enum import Enum | ||
|
||
from pydantic import BaseModel | ||
from typing import List, Optional | ||
from .pyris_image import PyrisImage | ||
|
||
|
||
class IrisMessageRole(str, Enum): | ||
USER = "user" | ||
ASSISTANT = "assistant" | ||
SYSTEM = "system" | ||
|
||
|
||
class IrisMessage(BaseModel): | ||
text: str = "" | ||
role: IrisMessageRole | ||
images: list[PyrisImage] | None | ||
|
||
def __init__( | ||
self, role: IrisMessageRole, text: str, images: list[PyrisImage] | None = None | ||
): | ||
super().__init__(role=role, text=text) | ||
self.images = images | ||
images: Optional[List[PyrisImage]] = None | ||
|
||
def __str__(self): | ||
return f"{self.role.lower()}: {self.text}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
from pydantic import BaseModel | ||
from datetime import datetime | ||
|
||
from pydantic import BaseModel | ||
from typing import Optional | ||
|
||
class PyrisImage(BaseModel): | ||
prompt: str | ||
base64: str | ||
timestamp: datetime | ||
mime_type: str = "jpeg" | ||
prompt: Optional[str] = None | ||
mime_type: Optional[str] = "jpeg" | ||
|
||
class Config: | ||
schema_extra = { | ||
"example": { | ||
"prompt": "Example prompt", | ||
"base64": "base64EncodedString==", | ||
"timestamp": "2023-01-01T12:00:00Z", | ||
"mime_type": "jpeg", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters