Skip to content

Commit

Permalink
Update for fresh protobuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
vhaldemar committed Dec 10, 2024
1 parent 4cb6b15 commit 5b73634
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/yandex_cloud_ml_sdk/_search_indexes/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,12 @@

from dataclasses import dataclass
from datetime import datetime
from typing import TYPE_CHECKING, Any

from yandex.cloud.ai.assistants.v1.searchindex.search_index_file_pb2 import SearchIndexFile as ProtoSearchIndexFile

from yandex_cloud_ml_sdk._types.resource import BaseResource

from .chunking_strategy import BaseIndexChunkingStrategy

if TYPE_CHECKING:
from yandex_cloud_ml_sdk._sdk import BaseSDK


@dataclass(frozen=True)
class SearchIndexFile(BaseResource):
search_index_id: str
created_by: str
created_at: datetime
chunking_strategy: BaseIndexChunkingStrategy

@classmethod
def _kwargs_from_message(
cls,
proto: ProtoSearchIndexFile, # type: ignore[override]
sdk: BaseSDK
) -> dict[str, Any]:
kwargs = super()._kwargs_from_message(proto, sdk=sdk)
# pylint: disable=protected-access
kwargs['chunking_strategy'] = BaseIndexChunkingStrategy._from_upper_proto(
proto=proto.chunking_strategy, sdk=sdk
)
return kwargs

0 comments on commit 5b73634

Please sign in to comment.