Skip to content

Commit

Permalink
Add asset_type field to the assets structures
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiyatcohere committed Dec 10, 2024
1 parent 95dbd13 commit 7357fb9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cohere/compass/models/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@ class CompassDocumentMetadata(ValidatedModel):
parent_document_id: str = ""


class AssetType(str, Enum):
def __str__(self) -> str:
return self.value

# A page that has been rendered as an image
PAGE_IMAGE = "page_image"
# A Markdown representation of a page's content
PAGE_MARKDOWN = "page_markdown"
# A dump of the text extracted from a document
DOCUMENT_TEXT = "document_text"


class CompassDocumentChunkAsset(BaseModel):
asset_type: AssetType
content_type: str
asset_data: str

Expand Down
3 changes: 3 additions & 0 deletions cohere/compass/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
# 3rd party imports
from pydantic import BaseModel

from cohere.compass.models.documents import AssetType


class AssetInfo(BaseModel):
asset_type: AssetType
content_type: str
presigned_url: str

Expand Down

0 comments on commit 7357fb9

Please sign in to comment.