# This file was auto-generated by Fern from our API Definition.

import typing
from json.decoder import JSONDecodeError

from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
from ..errors.unprocessable_entity_error import UnprocessableEntityError
from ..types.base64file_upload import Base64FileUpload
from ..types.success_response_dict import SuccessResponseDict
from ..types.success_response_processing_status_response import SuccessResponseProcessingStatusResponse
from ..types.success_response_vector_store_file_list_response import SuccessResponseVectorStoreFileListResponse
from ..types.success_response_vector_store_file_response import SuccessResponseVectorStoreFileResponse
from ..types.vector_store_base64upload_response import VectorStoreBase64UploadResponse

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class RawVectorStoreFilesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._client_wrapper = client_wrapper

    def list_files_in_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        status: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseVectorStoreFileListResponse]:
        """
        Get a list of all files attached to a vector store. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        page : typing.Optional[int]
            Page number for pagination

        page_size : typing.Optional[int]
            Number of items per page

        status : typing.Optional[str]
            Filter by processing status (comma-separated)

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

        Returns
        -------
        HttpResponse[SuccessResponseVectorStoreFileListResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files",
            method="GET",
            params={
                "page": page,
                "page_size": page_size,
                "status": status,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileListResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def add_file_to_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        file_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseVectorStoreFileResponse]:
        """
        Attach an uploaded file to a vector store for semantic search. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The ID of the file to add to the vector store

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

        Returns
        -------
        HttpResponse[SuccessResponseVectorStoreFileResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files",
            method="POST",
            json={
                "file_id": file_id,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def upload_base64files_to_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        files: typing.Sequence[Base64FileUpload],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[VectorStoreBase64UploadResponse]:
        """
        Upload one or more base64-encoded files directly to a vector store in a single request. Handles file upload, registration, and vector store attachment automatically.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        files : typing.Sequence[Base64FileUpload]
            List of base64-encoded files to upload

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

        Returns
        -------
        HttpResponse[VectorStoreBase64UploadResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/upload-base64",
            method="POST",
            json={
                "files": convert_and_respect_annotation_metadata(
                    object_=files, annotation=typing.Sequence[Base64FileUpload], direction="write"
                ),
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    VectorStoreBase64UploadResponse,
                    parse_obj_as(
                        type_=VectorStoreBase64UploadResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def get_processing_status(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseProcessingStatusResponse]:
        """
        Get the processing status of a file in a vector store.

        Parameters
        ----------
        organization_id : str
            Organization ID

        vector_store_id : str
            Vector Store ID

        file_id : str
            File ID

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

        Returns
        -------
        HttpResponse[SuccessResponseProcessingStatusResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/status",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseProcessingStatusResponse,
                    parse_obj_as(
                        type_=SuccessResponseProcessingStatusResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def retry_failed_processing(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        reset_error: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseProcessingStatusResponse]:
        """
        Retry processing for a file that failed.

        Parameters
        ----------
        organization_id : str
            Organization ID

        vector_store_id : str
            Vector Store ID

        file_id : str
            File ID

        reset_error : typing.Optional[bool]
            Clear previous error message

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

        Returns
        -------
        HttpResponse[SuccessResponseProcessingStatusResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/retry",
            method="POST",
            json={
                "reset_error": reset_error,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseProcessingStatusResponse,
                    parse_obj_as(
                        type_=SuccessResponseProcessingStatusResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def get_file_details(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseVectorStoreFileResponse]:
        """
        Get complete details about a specific file in a vector store, including processing status and metadata.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        HttpResponse[SuccessResponseVectorStoreFileResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def remove_file_from_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[None]:
        """
        Remove a file from a vector store, making it unavailable for semantic search. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        HttpResponse[None]
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}",
            method="DELETE",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return HttpResponse(response=_response, data=None)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def get_file_processing_logs(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[SuccessResponseDict]:
        """
        Get processing logs and history for a file, useful for debugging processing issues.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        HttpResponse[SuccessResponseDict]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/logs",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseDict,
                    parse_obj_as(
                        type_=SuccessResponseDict,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)


class AsyncRawVectorStoreFilesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._client_wrapper = client_wrapper

    async def list_files_in_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        status: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseVectorStoreFileListResponse]:
        """
        Get a list of all files attached to a vector store. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        page : typing.Optional[int]
            Page number for pagination

        page_size : typing.Optional[int]
            Number of items per page

        status : typing.Optional[str]
            Filter by processing status (comma-separated)

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseVectorStoreFileListResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files",
            method="GET",
            params={
                "page": page,
                "page_size": page_size,
                "status": status,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileListResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def add_file_to_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        file_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseVectorStoreFileResponse]:
        """
        Attach an uploaded file to a vector store for semantic search. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The ID of the file to add to the vector store

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseVectorStoreFileResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files",
            method="POST",
            json={
                "file_id": file_id,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def upload_base64files_to_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        *,
        files: typing.Sequence[Base64FileUpload],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[VectorStoreBase64UploadResponse]:
        """
        Upload one or more base64-encoded files directly to a vector store in a single request. Handles file upload, registration, and vector store attachment automatically.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        files : typing.Sequence[Base64FileUpload]
            List of base64-encoded files to upload

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

        Returns
        -------
        AsyncHttpResponse[VectorStoreBase64UploadResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/upload-base64",
            method="POST",
            json={
                "files": convert_and_respect_annotation_metadata(
                    object_=files, annotation=typing.Sequence[Base64FileUpload], direction="write"
                ),
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    VectorStoreBase64UploadResponse,
                    parse_obj_as(
                        type_=VectorStoreBase64UploadResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def get_processing_status(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseProcessingStatusResponse]:
        """
        Get the processing status of a file in a vector store.

        Parameters
        ----------
        organization_id : str
            Organization ID

        vector_store_id : str
            Vector Store ID

        file_id : str
            File ID

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseProcessingStatusResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/status",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseProcessingStatusResponse,
                    parse_obj_as(
                        type_=SuccessResponseProcessingStatusResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def retry_failed_processing(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        reset_error: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseProcessingStatusResponse]:
        """
        Retry processing for a file that failed.

        Parameters
        ----------
        organization_id : str
            Organization ID

        vector_store_id : str
            Vector Store ID

        file_id : str
            File ID

        reset_error : typing.Optional[bool]
            Clear previous error message

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseProcessingStatusResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/retry",
            method="POST",
            json={
                "reset_error": reset_error,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseProcessingStatusResponse,
                    parse_obj_as(
                        type_=SuccessResponseProcessingStatusResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def get_file_details(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseVectorStoreFileResponse]:
        """
        Get complete details about a specific file in a vector store, including processing status and metadata.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseVectorStoreFileResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseVectorStoreFileResponse,
                    parse_obj_as(
                        type_=SuccessResponseVectorStoreFileResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def remove_file_from_vector_store(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[None]:
        """
        Remove a file from a vector store, making it unavailable for semantic search. Supports both user and API key authentication.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        AsyncHttpResponse[None]
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}",
            method="DELETE",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return AsyncHttpResponse(response=_response, data=None)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def get_file_processing_logs(
        self,
        organization_id: str,
        vector_store_id: str,
        file_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[SuccessResponseDict]:
        """
        Get processing logs and history for a file, useful for debugging processing issues.

        Parameters
        ----------
        organization_id : str
            The unique identifier of the organization

        vector_store_id : str
            The unique identifier of the vector store

        file_id : str
            The unique identifier of the file

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

        Returns
        -------
        AsyncHttpResponse[SuccessResponseDict]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/organizations/{jsonable_encoder(organization_id)}/vector-stores/{jsonable_encoder(vector_store_id)}/files/{jsonable_encoder(file_id)}/logs",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    SuccessResponseDict,
                    parse_obj_as(
                        type_=SuccessResponseDict,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
