-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
108 additions
and
81 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,13 @@ | ||
# pylint: disable=no-name-in-module | ||
from __future__ import annotations | ||
|
||
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 |
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
Oops, something went wrong.