Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions skyflow/generated/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
EntityTypes,
ErrorResponse,
ErrorResponseError,
ErrorString,
GooglerpcStatus,
ProtobufAny,
RedactionEnumRedaction,
ReidentifyFileResponse,
ReidentifyFileResponseOutput,
ReidentifyFileResponseOutputType,
ReidentifyFileResponseStatus,
ReidentifyStringResponse,
RequestActionType,
Expand All @@ -46,6 +46,7 @@
Transformations,
TransformationsShiftDates,
TransformationsShiftDatesEntityTypesItem,
UploadFileV2Response,
Uuid,
V1AuditAfterOptions,
V1AuditEventResponse,
Expand Down Expand Up @@ -175,7 +176,6 @@
"EntityTypes",
"ErrorResponse",
"ErrorResponseError",
"ErrorString",
"GooglerpcStatus",
"InternalServerError",
"NotFoundError",
Expand All @@ -189,6 +189,7 @@
"ReidentifyFileRequestFormat",
"ReidentifyFileResponse",
"ReidentifyFileResponseOutput",
"ReidentifyFileResponseOutputType",
"ReidentifyFileResponseStatus",
"ReidentifyStringRequestFormat",
"ReidentifyStringResponse",
Expand All @@ -205,6 +206,7 @@
"TransformationsShiftDates",
"TransformationsShiftDatesEntityTypesItem",
"UnauthorizedError",
"UploadFileV2Response",
"Uuid",
"V1AuditAfterOptions",
"V1AuditEventResponse",
Expand Down
2 changes: 1 addition & 1 deletion skyflow/generated/rest/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "skyflow_vault",
"X-Fern-SDK-Version": "0.0.252",
"X-Fern-SDK-Version": "0.0.323",
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = f"Bearer {self._get_token()}"
Expand Down
16 changes: 8 additions & 8 deletions skyflow/generated/rest/files/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def deidentify_pdf(
vault_id: VaultId,
file: DeidentifyPdfRequestFile,
configuration_id: typing.Optional[ConfigurationId] = OMIT,
density: typing.Optional[int] = OMIT,
max_resolution: typing.Optional[int] = OMIT,
density: typing.Optional[float] = OMIT,
max_resolution: typing.Optional[float] = OMIT,
entity_types: typing.Optional[EntityTypes] = OMIT,
token_type: typing.Optional[TokenTypeWithoutVault] = OMIT,
allow_regex: typing.Optional[AllowRegex] = OMIT,
Expand All @@ -221,10 +221,10 @@ def deidentify_pdf(

configuration_id : typing.Optional[ConfigurationId]

density : typing.Optional[int]
density : typing.Optional[float]
Pixel density at which to process the PDF file.

max_resolution : typing.Optional[int]
max_resolution : typing.Optional[float]
Max resolution at which to process the PDF file.

entity_types : typing.Optional[EntityTypes]
Expand Down Expand Up @@ -1020,8 +1020,8 @@ async def deidentify_pdf(
vault_id: VaultId,
file: DeidentifyPdfRequestFile,
configuration_id: typing.Optional[ConfigurationId] = OMIT,
density: typing.Optional[int] = OMIT,
max_resolution: typing.Optional[int] = OMIT,
density: typing.Optional[float] = OMIT,
max_resolution: typing.Optional[float] = OMIT,
entity_types: typing.Optional[EntityTypes] = OMIT,
token_type: typing.Optional[TokenTypeWithoutVault] = OMIT,
allow_regex: typing.Optional[AllowRegex] = OMIT,
Expand All @@ -1041,10 +1041,10 @@ async def deidentify_pdf(

configuration_id : typing.Optional[ConfigurationId]

density : typing.Optional[int]
density : typing.Optional[float]
Pixel density at which to process the PDF file.

max_resolution : typing.Optional[int]
max_resolution : typing.Optional[float]
Max resolution at which to process the PDF file.

entity_types : typing.Optional[EntityTypes]
Expand Down
16 changes: 8 additions & 8 deletions skyflow/generated/rest/files/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def deidentify_pdf(
vault_id: VaultId,
file: DeidentifyPdfRequestFile,
configuration_id: typing.Optional[ConfigurationId] = OMIT,
density: typing.Optional[int] = OMIT,
max_resolution: typing.Optional[int] = OMIT,
density: typing.Optional[float] = OMIT,
max_resolution: typing.Optional[float] = OMIT,
entity_types: typing.Optional[EntityTypes] = OMIT,
token_type: typing.Optional[TokenTypeWithoutVault] = OMIT,
allow_regex: typing.Optional[AllowRegex] = OMIT,
Expand All @@ -308,10 +308,10 @@ def deidentify_pdf(

configuration_id : typing.Optional[ConfigurationId]

density : typing.Optional[int]
density : typing.Optional[float]
Pixel density at which to process the PDF file.

max_resolution : typing.Optional[int]
max_resolution : typing.Optional[float]
Max resolution at which to process the PDF file.

entity_types : typing.Optional[EntityTypes]
Expand Down Expand Up @@ -1575,8 +1575,8 @@ async def deidentify_pdf(
vault_id: VaultId,
file: DeidentifyPdfRequestFile,
configuration_id: typing.Optional[ConfigurationId] = OMIT,
density: typing.Optional[int] = OMIT,
max_resolution: typing.Optional[int] = OMIT,
density: typing.Optional[float] = OMIT,
max_resolution: typing.Optional[float] = OMIT,
entity_types: typing.Optional[EntityTypes] = OMIT,
token_type: typing.Optional[TokenTypeWithoutVault] = OMIT,
allow_regex: typing.Optional[AllowRegex] = OMIT,
Expand All @@ -1596,10 +1596,10 @@ async def deidentify_pdf(

configuration_id : typing.Optional[ConfigurationId]

density : typing.Optional[int]
density : typing.Optional[float]
Pixel density at which to process the PDF file.

max_resolution : typing.Optional[int]
max_resolution : typing.Optional[float]
Max resolution at which to process the PDF file.

entity_types : typing.Optional[EntityTypes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

import typing

DeidentifyImageRequestMaskingMethod = typing.Union[typing.Literal["blackout", "blur"], typing.Any]
DeidentifyImageRequestMaskingMethod = typing.Union[typing.Literal["blackbox", "blur"], typing.Any]
12 changes: 4 additions & 8 deletions skyflow/generated/rest/guardrails/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ def check_guardrails(
token="YOUR_TOKEN",
)
client.guardrails.check_guardrails(
vault_id="VAULT_ID",
text="I love to play cricket.",
check_toxicity=True,
deny_topics=["sports"],
vault_id="vault_id",
text="text",
)
"""
_response = self._raw_client.check_guardrails(
Expand Down Expand Up @@ -145,10 +143,8 @@ async def check_guardrails(

async def main() -> None:
await client.guardrails.check_guardrails(
vault_id="VAULT_ID",
text="I love to play cricket.",
check_toxicity=True,
deny_topics=["sports"],
vault_id="vault_id",
text="text",
)


Expand Down
141 changes: 141 additions & 0 deletions skyflow/generated/rest/records/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.upload_file_v_2_response import UploadFileV2Response
from ..types.v_1_batch_operation_response import V1BatchOperationResponse
from ..types.v_1_batch_record import V1BatchRecord
from ..types.v_1_bulk_delete_record_response import V1BulkDeleteRecordResponse
Expand Down Expand Up @@ -700,6 +701,72 @@ def file_service_get_file_scan_status(
)
return _response.data

def upload_file_v_2(
self,
vault_id: str,
*,
table_name: str,
column_name: str,
file: core.File,
skyflow_id: typing.Optional[str] = OMIT,
return_file_metadata: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UploadFileV2Response:
"""
Uploads the specified file to a record. If an existing record isn't specified, creates a new record and uploads the file to that record.

Parameters
----------
vault_id : str
ID of the vault.

table_name : str
Name of the table to upload the file to.

column_name : str
Name of the column to upload the file to. The column must have a `file` data type.

file : core.File
See core.File for more documentation

skyflow_id : typing.Optional[str]
Skyflow ID of the record to upload the file to. If `skyflowID` isn't specified, a new record will be created.

return_file_metadata : typing.Optional[bool]
If `true`, returns metadata about the uploaded file.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
UploadFileV2Response
File uploaded successfully.

Examples
--------
from skyflow import Skyflow

client = Skyflow(
token="YOUR_TOKEN",
)
client.records.upload_file_v_2(
vault_id="d4410ea01d83473ca09a24c6b03096d4",
table_name="tableName",
column_name="columnName",
)
"""
_response = self._raw_client.upload_file_v_2(
vault_id,
table_name=table_name,
column_name=column_name,
file=file,
skyflow_id=skyflow_id,
return_file_metadata=return_file_metadata,
request_options=request_options,
)
return _response.data


class AsyncRecordsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
Expand Down Expand Up @@ -1455,3 +1522,77 @@ async def main() -> None:
vault_id, table_name, id, column_name, request_options=request_options
)
return _response.data

async def upload_file_v_2(
self,
vault_id: str,
*,
table_name: str,
column_name: str,
file: core.File,
skyflow_id: typing.Optional[str] = OMIT,
return_file_metadata: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UploadFileV2Response:
"""
Uploads the specified file to a record. If an existing record isn't specified, creates a new record and uploads the file to that record.

Parameters
----------
vault_id : str
ID of the vault.

table_name : str
Name of the table to upload the file to.

column_name : str
Name of the column to upload the file to. The column must have a `file` data type.

file : core.File
See core.File for more documentation

skyflow_id : typing.Optional[str]
Skyflow ID of the record to upload the file to. If `skyflowID` isn't specified, a new record will be created.

return_file_metadata : typing.Optional[bool]
If `true`, returns metadata about the uploaded file.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
UploadFileV2Response
File uploaded successfully.

Examples
--------
import asyncio

from skyflow import AsyncSkyflow

client = AsyncSkyflow(
token="YOUR_TOKEN",
)


async def main() -> None:
await client.records.upload_file_v_2(
vault_id="d4410ea01d83473ca09a24c6b03096d4",
table_name="tableName",
column_name="columnName",
)


asyncio.run(main())
"""
_response = await self._raw_client.upload_file_v_2(
vault_id,
table_name=table_name,
column_name=column_name,
file=file,
skyflow_id=skyflow_id,
return_file_metadata=return_file_metadata,
request_options=request_options,
)
return _response.data
Loading
Loading