From d5b3cc89585b5aff2a60fe5b6d287fe39254b860 Mon Sep 17 00:00:00 2001 From: artemiyatcohere Date: Fri, 13 Dec 2024 14:30:12 +0000 Subject: [PATCH] Include changes from the reverted 3a5d494 commit --- cohere/compass/models/documents.py | 13 +++++++++++++ cohere/compass/models/search.py | 2 ++ pyproject.toml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cohere/compass/models/documents.py b/cohere/compass/models/documents.py index 148c50b..ecccc73 100644 --- a/cohere/compass/models/documents.py +++ b/cohere/compass/models/documents.py @@ -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 diff --git a/cohere/compass/models/search.py b/cohere/compass/models/search.py index 9cbd8b2..8a3af34 100644 --- a/cohere/compass/models/search.py +++ b/cohere/compass/models/search.py @@ -1,12 +1,14 @@ # Python imports from enum import Enum from typing import Any, Dict, List, Optional +from cohere.compass.models.documents import AssetType # 3rd party imports from pydantic import BaseModel class AssetInfo(BaseModel): + asset_type: AssetType content_type: str presigned_url: str diff --git a/pyproject.toml b/pyproject.toml index d10f63a..c441d69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "compass-sdk" -version = "0.9.4" +version = "0.10.0" authors = [] description = "Compass SDK" readme = "README.md"