From 5d75cef06b4532fb397c6e48c2882e0f67f92ba0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:37:37 +0000 Subject: [PATCH 01/15] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 50632ba4..c9fd9032 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1 -config_hash: 22524d9aa927566851636768f6a861cd +config_hash: fef0ea78daf11093ff503919baae5ec0 From 90fe5a9b7626b6fefeb720058ce08eee191687eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 03:18:14 +0000 Subject: [PATCH 02/15] chore(internal): update pydantic dependency --- requirements-dev.lock | 7 +++++-- requirements.lock | 7 +++++-- src/mixedbread/_models.py | 14 ++++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 9c562dc9..f24d36ed 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -88,9 +88,9 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via mixedbread -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -126,6 +126,9 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index 93fffc81..57e00706 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via mixedbread -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/mixedbread/_models.py +++ b/src/mixedbread/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, From 402891b4bc2a09b774827338509bd730747d210c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 03:41:14 +0000 Subject: [PATCH 03/15] chore(types): change optional parameter type from NotGiven to Omit --- src/mixedbread/__init__.py | 4 +- src/mixedbread/_base_client.py | 18 +-- src/mixedbread/_client.py | 71 ++++----- src/mixedbread/_qs.py | 14 +- src/mixedbread/_types.py | 29 ++-- src/mixedbread/_utils/_transform.py | 4 +- src/mixedbread/_utils/_utils.py | 8 +- src/mixedbread/resources/api_keys.py | 42 +++--- src/mixedbread/resources/chat.py | 6 +- .../resources/data_sources/connectors.py | 70 ++++----- .../resources/data_sources/data_sources.py | 126 ++++++++-------- src/mixedbread/resources/embeddings.py | 22 +-- .../resources/extractions/content.py | 10 +- src/mixedbread/resources/extractions/jobs.py | 10 +- .../resources/extractions/schema.py | 14 +- src/mixedbread/resources/files.py | 46 +++--- src/mixedbread/resources/parsing/jobs.py | 62 ++++---- .../resources/vector_stores/files.py | 74 +++++----- .../resources/vector_stores/vector_stores.py | 138 +++++++++--------- tests/test_transform.py | 11 +- 20 files changed, 398 insertions(+), 381 deletions(-) diff --git a/src/mixedbread/__init__.py b/src/mixedbread/__init__.py index df2a2fb2..82ae8048 100644 --- a/src/mixedbread/__init__.py +++ b/src/mixedbread/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import ( ENVIRONMENTS, @@ -49,7 +49,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "MixedbreadError", "APIError", "APIStatusError", diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py index 60c1612a..69fd970e 100644 --- a/src/mixedbread/_base_client.py +++ b/src/mixedbread/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -57,6 +56,7 @@ RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump @@ -145,9 +145,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # we internally support defining a temporary header to override the # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` # see _response.py for implementation details - override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given) if is_given(override_cast_to): options.headers = headers return cast(Type[ResponseT], override_cast_to) @@ -825,7 +825,7 @@ def __init__( version: str, base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1356,7 +1356,7 @@ def __init__( base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1818,8 +1818,8 @@ def make_request_options( extra_query: Query | None = None, extra_body: Body | None = None, idempotency_key: str | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - post_parser: PostParser | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + post_parser: PostParser | NotGiven = not_given, ) -> RequestOptions: """Create a dict of type RequestOptions without keys of NotGiven values.""" options: RequestOptions = {} diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py index c4f54779..31462225 100644 --- a/src/mixedbread/_client.py +++ b/src/mixedbread/_client.py @@ -12,7 +12,6 @@ from ._qs import Querystring from .types import client_embed_params, client_rerank_params from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -23,6 +22,8 @@ ProxiesTypes, RequestOptions, SequenceNotStr, + omit, + not_given, ) from ._utils import ( is_given, @@ -95,9 +96,9 @@ def __init__( self, *, api_key: str | None = None, - environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN, - base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + environment: Literal["production", "development", "local"] | NotGiven = not_given, + base_url: str | httpx.URL | None | NotGiven = not_given, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -201,9 +202,9 @@ def copy( api_key: str | None = None, environment: Literal["production", "development", "local"] | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -253,16 +254,16 @@ def embed( *, model: str, input: Union[str, SequenceNotStr[str]], - dimensions: Optional[int] | NotGiven = NOT_GIVEN, - prompt: Optional[str] | NotGiven = NOT_GIVEN, - normalized: bool | NotGiven = NOT_GIVEN, - encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN, + dimensions: Optional[int] | Omit = omit, + prompt: Optional[str] | Omit = omit, + normalized: bool | Omit = omit, + encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingCreateResponse: """ Create embeddings for text or images using the specified model, encoding format, @@ -321,7 +322,7 @@ def info( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InfoResponse: """ Returns service information, including name and version. @@ -339,19 +340,19 @@ def info( def rerank( self, *, - model: str | NotGiven = NOT_GIVEN, + model: str | Omit = omit, query: str, input: SequenceNotStr[Union[str, Iterable[object], object]], - rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - return_input: bool | NotGiven = NOT_GIVEN, - rewrite_query: bool | NotGiven = NOT_GIVEN, + rank_fields: Optional[SequenceNotStr[str]] | Omit = omit, + top_k: int | Omit = omit, + return_input: bool | Omit = omit, + rewrite_query: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RerankResponse: """ Rerank different kind of documents for a given query. @@ -458,9 +459,9 @@ def __init__( self, *, api_key: str | None = None, - environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN, - base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + environment: Literal["production", "development", "local"] | NotGiven = not_given, + base_url: str | httpx.URL | None | NotGiven = not_given, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -564,9 +565,9 @@ def copy( api_key: str | None = None, environment: Literal["production", "development", "local"] | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -616,16 +617,16 @@ async def embed( *, model: str, input: Union[str, SequenceNotStr[str]], - dimensions: Optional[int] | NotGiven = NOT_GIVEN, - prompt: Optional[str] | NotGiven = NOT_GIVEN, - normalized: bool | NotGiven = NOT_GIVEN, - encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN, + dimensions: Optional[int] | Omit = omit, + prompt: Optional[str] | Omit = omit, + normalized: bool | Omit = omit, + encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingCreateResponse: """ Create embeddings for text or images using the specified model, encoding format, @@ -684,7 +685,7 @@ async def info( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InfoResponse: """ Returns service information, including name and version. @@ -702,19 +703,19 @@ async def info( async def rerank( self, *, - model: str | NotGiven = NOT_GIVEN, + model: str | Omit = omit, query: str, input: SequenceNotStr[Union[str, Iterable[object], object]], - rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - return_input: bool | NotGiven = NOT_GIVEN, - rewrite_query: bool | NotGiven = NOT_GIVEN, + rank_fields: Optional[SequenceNotStr[str]] | Omit = omit, + top_k: int | Omit = omit, + return_input: bool | Omit = omit, + rewrite_query: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RerankResponse: """ Rerank different kind of documents for a given query. diff --git a/src/mixedbread/_qs.py b/src/mixedbread/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/mixedbread/_qs.py +++ b/src/mixedbread/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py index baa4a78b..97471b6c 100644 --- a/src/mixedbread/_types.py +++ b/src/mixedbread/_types.py @@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False): # Sentinel class used until PEP 0661 is accepted class NotGiven: """ - A sentinel singleton class used to distinguish omitted keyword arguments - from those passed in with the value None (which may have different behavior). + For parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -140,13 +143,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: NOT_GIVEN = NotGiven() class Omit: - """In certain situations you need to be able to represent a case where a default value has - to be explicitly removed and `None` is not an appropriate substitute, for example: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -156,8 +160,8 @@ class Omit: # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' client.post(..., headers={"Content-Type": "multipart/form-data"}) - # instead you can remove the default `application/json` header by passing Omit - client.post(..., headers={"Content-Type": Omit()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -165,6 +169,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/mixedbread/_utils/_transform.py +++ b/src/mixedbread/_utils/_transform.py @@ -268,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -434,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/mixedbread/_utils/_utils.py +++ b/src/mixedbread/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -63,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -126,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/mixedbread/resources/api_keys.py b/src/mixedbread/resources/api_keys.py index 9de4c7fe..f304929e 100644 --- a/src/mixedbread/resources/api_keys.py +++ b/src/mixedbread/resources/api_keys.py @@ -8,7 +8,7 @@ import httpx from ..types import api_key_list_params, api_key_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def with_streaming_response(self) -> APIKeysResourceWithStreamingResponse: def create( self, *, - name: str | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyCreated: """ Create a new API key. @@ -104,7 +104,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKey: """ Retrieve details of a specific API key by its ID. @@ -137,14 +137,14 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncLimitOffset[APIKey]: """ List all API keys for the authenticated user. @@ -194,7 +194,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyDeleteResponse: """ Delete a specific API key by its ID. @@ -234,7 +234,7 @@ def reroll( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyCreated: """ Reroll the secret for a specific API key by its ID. @@ -276,7 +276,7 @@ def revoke( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKey: """ Revoke a specific API key by its ID. @@ -330,14 +330,14 @@ def with_streaming_response(self) -> AsyncAPIKeysResourceWithStreamingResponse: async def create( self, *, - name: str | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyCreated: """ Create a new API key. @@ -384,7 +384,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKey: """ Retrieve details of a specific API key by its ID. @@ -417,14 +417,14 @@ async def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[APIKey, AsyncLimitOffset[APIKey]]: """ List all API keys for the authenticated user. @@ -474,7 +474,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyDeleteResponse: """ Delete a specific API key by its ID. @@ -514,7 +514,7 @@ async def reroll( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyCreated: """ Reroll the secret for a specific API key by its ID. @@ -556,7 +556,7 @@ async def revoke( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKey: """ Revoke a specific API key by its ID. diff --git a/src/mixedbread/resources/chat.py b/src/mixedbread/resources/chat.py index f9b1b0ce..a5788f8f 100644 --- a/src/mixedbread/resources/chat.py +++ b/src/mixedbread/resources/chat.py @@ -4,7 +4,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Query, Headers, NotGiven, not_given from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -46,7 +46,7 @@ def create_completion( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Create a chat completion using the provided parameters. @@ -101,7 +101,7 @@ async def create_completion( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Create a chat completion using the provided parameters. diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py index 30c2ed30..9ab5bee1 100644 --- a/src/mixedbread/resources/data_sources/connectors.py +++ b/src/mixedbread/resources/data_sources/connectors.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -50,16 +50,16 @@ def create( data_source_id: str, *, vector_store_id: str, - name: str | NotGiven = NOT_GIVEN, - trigger_sync: bool | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + trigger_sync: bool | Omit = omit, + metadata: object | Omit = omit, + polling_interval: Union[int, str, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Create a new connector. @@ -125,7 +125,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Get a connector by ID. @@ -165,16 +165,16 @@ def update( connector_id: str, *, data_source_id: str, - name: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN, - trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN, - polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, object]] | Omit = omit, + trigger_sync: Optional[bool] | Omit = omit, + polling_interval: Union[int, str, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Update a connector. @@ -236,16 +236,16 @@ def list( self, data_source_id: str, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[DataSourceConnector]: """ Get all connectors for a data source. @@ -309,7 +309,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorDeleteResponse: """ Delete a connector. @@ -370,16 +370,16 @@ async def create( data_source_id: str, *, vector_store_id: str, - name: str | NotGiven = NOT_GIVEN, - trigger_sync: bool | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + trigger_sync: bool | Omit = omit, + metadata: object | Omit = omit, + polling_interval: Union[int, str, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Create a new connector. @@ -445,7 +445,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Get a connector by ID. @@ -485,16 +485,16 @@ async def update( connector_id: str, *, data_source_id: str, - name: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN, - trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN, - polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, object]] | Omit = omit, + trigger_sync: Optional[bool] | Omit = omit, + polling_interval: Union[int, str, None] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceConnector: """ Update a connector. @@ -556,16 +556,16 @@ def list( self, data_source_id: str, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DataSourceConnector, AsyncCursor[DataSourceConnector]]: """ Get all connectors for a data source. @@ -629,7 +629,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorDeleteResponse: """ Delete a connector. diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py index 3579b305..185eaedb 100644 --- a/src/mixedbread/resources/data_sources/data_sources.py +++ b/src/mixedbread/resources/data_sources/data_sources.py @@ -8,7 +8,7 @@ import httpx from ...types import Oauth2Params, data_source_list_params, data_source_create_params, data_source_update_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from .connectors import ( @@ -63,16 +63,16 @@ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse: def create( self, *, - type: Literal["notion"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Create a new data source. @@ -105,16 +105,16 @@ def create( def create( self, *, - type: Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[Oauth2Params] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Create a new data source. @@ -146,18 +146,18 @@ def create( def create( self, *, - type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Optional[Oauth2Params] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: return self._post( "/v1/data_sources/", @@ -185,7 +185,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Get a data source by ID. @@ -220,16 +220,16 @@ def update( self, data_source_id: str, *, - type: Literal["notion"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """Update a data source. @@ -267,16 +267,16 @@ def update( self, data_source_id: str, *, - type: Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[Oauth2Params] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """Update a data source. @@ -313,18 +313,18 @@ def update( self, data_source_id: str, *, - type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Optional[Oauth2Params] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: if not data_source_id: raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}") @@ -348,16 +348,16 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[DataSource]: """ Get all data sources. @@ -413,7 +413,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceDeleteResponse: """ Delete a data source. @@ -470,16 +470,16 @@ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingRespon async def create( self, *, - type: Literal["notion"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Create a new data source. @@ -512,16 +512,16 @@ async def create( async def create( self, *, - type: Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[Oauth2Params] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Create a new data source. @@ -553,18 +553,18 @@ async def create( async def create( self, *, - type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Optional[Oauth2Params] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: return await self._post( "/v1/data_sources/", @@ -592,7 +592,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """ Get a data source by ID. @@ -627,16 +627,16 @@ async def update( self, data_source_id: str, *, - type: Literal["notion"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """Update a data source. @@ -674,16 +674,16 @@ async def update( self, data_source_id: str, *, - type: Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, - auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + auth_params: Optional[Oauth2Params] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: """Update a data source. @@ -720,18 +720,18 @@ async def update( self, data_source_id: str, *, - type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN, + type: Literal["notion"] | Literal["linear"] | Omit = omit, name: str, - metadata: object | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Optional[Oauth2Params] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSource: if not data_source_id: raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}") @@ -755,16 +755,16 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DataSource, AsyncCursor[DataSource]]: """ Get all data sources. @@ -820,7 +820,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceDeleteResponse: """ Delete a data source. diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py index 17bee234..d2c74634 100644 --- a/src/mixedbread/resources/embeddings.py +++ b/src/mixedbread/resources/embeddings.py @@ -7,7 +7,7 @@ import httpx from ..types import embedding_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -49,16 +49,16 @@ def create( *, model: str, input: Union[str, SequenceNotStr[str]], - dimensions: Optional[int] | NotGiven = NOT_GIVEN, - prompt: Optional[str] | NotGiven = NOT_GIVEN, - normalized: bool | NotGiven = NOT_GIVEN, - encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN, + dimensions: Optional[int] | Omit = omit, + prompt: Optional[str] | Omit = omit, + normalized: bool | Omit = omit, + encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingCreateResponse: """ Create embeddings for text or images using the specified model, encoding format, @@ -135,16 +135,16 @@ async def create( *, model: str, input: Union[str, SequenceNotStr[str]], - dimensions: Optional[int] | NotGiven = NOT_GIVEN, - prompt: Optional[str] | NotGiven = NOT_GIVEN, - normalized: bool | NotGiven = NOT_GIVEN, - encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN, + dimensions: Optional[int] | Omit = omit, + prompt: Optional[str] | Omit = omit, + normalized: bool | Omit = omit, + encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingCreateResponse: """ Create embeddings for text or images using the specified model, encoding format, diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py index a74a9b13..b2111bb3 100644 --- a/src/mixedbread/resources/extractions/content.py +++ b/src/mixedbread/resources/extractions/content.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -48,13 +48,13 @@ def create( *, content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]], json_schema: Dict[str, object], - instructions: Optional[str] | NotGiven = NOT_GIVEN, + instructions: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionResult: """ Extract content from a string using the provided schema. @@ -120,13 +120,13 @@ async def create( *, content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]], json_schema: Dict[str, object], - instructions: Optional[str] | NotGiven = NOT_GIVEN, + instructions: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionResult: """ Extract content from a string using the provided schema. diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py index 29b77911..ae48bbf3 100644 --- a/src/mixedbread/resources/extractions/jobs.py +++ b/src/mixedbread/resources/extractions/jobs.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -53,7 +53,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionJob: """ Start an extraction job for the provided file and schema. @@ -99,7 +99,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionJob: """ Get detailed information about a specific extraction job. @@ -160,7 +160,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionJob: """ Start an extraction job for the provided file and schema. @@ -206,7 +206,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExtractionJob: """ Get detailed information about a specific extraction job. diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py index 651723f6..6eabe54e 100644 --- a/src/mixedbread/resources/extractions/schema.py +++ b/src/mixedbread/resources/extractions/schema.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreatedJsonSchema: """ Create a schema with the provided parameters. @@ -92,7 +92,7 @@ def enhance( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnhancedJsonSchema: """ Enhance a schema by enriching the descriptions to aid extraction. @@ -130,7 +130,7 @@ def validate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ValidatedJsonSchema: """ Validate a schema. @@ -189,7 +189,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreatedJsonSchema: """ Create a schema with the provided parameters. @@ -227,7 +227,7 @@ async def enhance( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnhancedJsonSchema: """ Enhance a schema by enriching the descriptions to aid extraction. @@ -265,7 +265,7 @@ async def validate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ValidatedJsonSchema: """ Validate a schema. diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py index 5d00457d..d1e74a27 100644 --- a/src/mixedbread/resources/files.py +++ b/src/mixedbread/resources/files.py @@ -7,7 +7,7 @@ import httpx from ..types import file_list_params, file_create_params, file_update_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -62,7 +62,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Upload a new file. @@ -107,7 +107,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Retrieve details of a specific file by its ID. @@ -147,7 +147,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Update the details of a specific file. @@ -190,17 +190,17 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[FileObject]: """ List all files for the authenticated user. @@ -261,7 +261,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ Delete a specific file by its ID. @@ -300,7 +300,7 @@ def content( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Download a specific file by its ID. @@ -361,7 +361,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Upload a new file. @@ -406,7 +406,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Retrieve details of a specific file by its ID. @@ -446,7 +446,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileObject: """ Update the details of a specific file. @@ -489,17 +489,17 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FileObject, AsyncCursor[FileObject]]: """ List all files for the authenticated user. @@ -560,7 +560,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ Delete a specific file by its ID. @@ -599,7 +599,7 @@ async def content( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Download a specific file by its ID. diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py index f329dd7c..d1d7b51f 100644 --- a/src/mixedbread/resources/parsing/jobs.py +++ b/src/mixedbread/resources/parsing/jobs.py @@ -9,7 +9,7 @@ import httpx from ...lib import polling -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -57,16 +57,16 @@ def create( self, *, file_id: str, - element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN, - chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN, - return_format: ReturnFormat | NotGiven = NOT_GIVEN, - mode: Literal["fast", "high_quality"] | NotGiven = NOT_GIVEN, + element_types: Optional[List[ElementType]] | Omit = omit, + chunking_strategy: ChunkingStrategy | Omit = omit, + return_format: ReturnFormat | Omit = omit, + mode: Literal["fast", "high_quality"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Start a parse job for the provided file. @@ -121,7 +121,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Get detailed information about a specific parse job. @@ -154,18 +154,18 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + statuses: Optional[List[ParsingJobStatus]] | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[JobListResponse]: """List parsing jobs with pagination. @@ -230,7 +230,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobDeleteResponse: """ Delete a specific parse job. @@ -269,7 +269,7 @@ def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Cancel a specific parse job. @@ -481,16 +481,16 @@ async def create( self, *, file_id: str, - element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN, - chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN, - return_format: ReturnFormat | NotGiven = NOT_GIVEN, - mode: Literal["fast", "high_quality"] | NotGiven = NOT_GIVEN, + element_types: Optional[List[ElementType]] | Omit = omit, + chunking_strategy: ChunkingStrategy | Omit = omit, + return_format: ReturnFormat | Omit = omit, + mode: Literal["fast", "high_quality"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Start a parse job for the provided file. @@ -545,7 +545,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Get detailed information about a specific parse job. @@ -578,18 +578,18 @@ async def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + statuses: Optional[List[ParsingJobStatus]] | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[JobListResponse, AsyncCursor[JobListResponse]]: """List parsing jobs with pagination. @@ -654,7 +654,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobDeleteResponse: """ Delete a specific parse job. @@ -693,7 +693,7 @@ async def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ParsingJob: """ Cancel a specific parse job. diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py index c1fcc105..1ff0c88f 100644 --- a/src/mixedbread/resources/vector_stores/files.py +++ b/src/mixedbread/resources/vector_stores/files.py @@ -8,7 +8,7 @@ import httpx from ...lib import polling -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -53,15 +53,15 @@ def create( self, vector_store_identifier: str, *, - metadata: object | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + experimental: file_create_params.Experimental | Omit = omit, file_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ Add an already uploaded file to a vector store. @@ -113,13 +113,13 @@ def retrieve( file_id: str, *, vector_store_identifier: str, - return_chunks: bool | NotGiven = NOT_GIVEN, + return_chunks: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ Get details of a specific file in a vector store. @@ -166,18 +166,18 @@ def list( self, vector_store_identifier: str, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN, - metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit, + metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileListResponse: """ List files indexed in a vector store with pagination and metadata filter. @@ -245,7 +245,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ Delete a file from a vector store. @@ -287,16 +287,16 @@ def search( *, query: str, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[file_search_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: file_search_params.SearchOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileSearchResponse: """ Perform semantic search across complete vector store files. @@ -487,15 +487,15 @@ async def create( self, vector_store_identifier: str, *, - metadata: object | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, + metadata: object | Omit = omit, + experimental: file_create_params.Experimental | Omit = omit, file_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ Add an already uploaded file to a vector store. @@ -547,13 +547,13 @@ async def retrieve( file_id: str, *, vector_store_identifier: str, - return_chunks: bool | NotGiven = NOT_GIVEN, + return_chunks: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ Get details of a specific file in a vector store. @@ -602,18 +602,18 @@ async def list( self, vector_store_identifier: str, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN, - metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit, + metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileListResponse: """ List files indexed in a vector store with pagination and metadata filter. @@ -681,7 +681,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ Delete a file from a vector store. @@ -723,16 +723,16 @@ async def search( *, query: str, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[file_search_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: file_search_params.SearchOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileSearchResponse: """ Perform semantic search across complete vector store files. diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py index 0dd32b0f..75d11b1c 100644 --- a/src/mixedbread/resources/vector_stores/vector_stores.py +++ b/src/mixedbread/resources/vector_stores/vector_stores.py @@ -21,7 +21,7 @@ vector_store_update_params, vector_store_question_answering_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -70,18 +70,18 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse: def create( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - is_public: bool | NotGiven = NOT_GIVEN, - expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - file_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + is_public: bool | Omit = omit, + expires_after: Optional[ExpiresAfterParam] | Omit = omit, + metadata: object | Omit = omit, + file_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Create a new vector store. @@ -140,7 +140,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Get a vector store by ID or name. @@ -176,17 +176,17 @@ def update( self, vector_store_identifier: str, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - is_public: Optional[bool] | NotGiven = NOT_GIVEN, - expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + is_public: Optional[bool] | Omit = omit, + expires_after: Optional[ExpiresAfterParam] | Omit = omit, + metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Update a vector store by ID or name. @@ -243,17 +243,17 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[VectorStore]: """ List all vector stores with optional search. @@ -315,7 +315,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreDeleteResponse: """ Delete a vector store by ID or name. @@ -350,20 +350,20 @@ def delete( def question_answering( self, *, - query: str | NotGiven = NOT_GIVEN, + query: str | Omit = omit, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: VectorStoreChunkSearchOptionsParam | Omit = omit, + stream: bool | Omit = omit, + qa_options: vector_store_question_answering_params.QaOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreQuestionAnsweringResponse: """Question answering @@ -421,16 +421,16 @@ def search( *, query: str, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[vector_store_search_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: VectorStoreChunkSearchOptionsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreSearchResponse: """ Perform semantic search across vector store chunks. @@ -519,18 +519,18 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo async def create( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - is_public: bool | NotGiven = NOT_GIVEN, - expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - file_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + is_public: bool | Omit = omit, + expires_after: Optional[ExpiresAfterParam] | Omit = omit, + metadata: object | Omit = omit, + file_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Create a new vector store. @@ -589,7 +589,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Get a vector store by ID or name. @@ -625,17 +625,17 @@ async def update( self, vector_store_identifier: str, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - is_public: Optional[bool] | NotGiven = NOT_GIVEN, - expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + is_public: Optional[bool] | Omit = omit, + expires_after: Optional[ExpiresAfterParam] | Omit = omit, + metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ Update a vector store by ID or name. @@ -692,17 +692,17 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - after: Optional[str] | NotGiven = NOT_GIVEN, - before: Optional[str] | NotGiven = NOT_GIVEN, - include_total: bool | NotGiven = NOT_GIVEN, - q: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + after: Optional[str] | Omit = omit, + before: Optional[str] | Omit = omit, + include_total: bool | Omit = omit, + q: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]: """ List all vector stores with optional search. @@ -764,7 +764,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreDeleteResponse: """ Delete a vector store by ID or name. @@ -799,20 +799,20 @@ async def delete( async def question_answering( self, *, - query: str | NotGiven = NOT_GIVEN, + query: str | Omit = omit, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: VectorStoreChunkSearchOptionsParam | Omit = omit, + stream: bool | Omit = omit, + qa_options: vector_store_question_answering_params.QaOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreQuestionAnsweringResponse: """Question answering @@ -870,16 +870,16 @@ async def search( *, query: str, vector_store_identifiers: SequenceNotStr[str], - top_k: int | NotGiven = NOT_GIVEN, - filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN, - file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN, + top_k: int | Omit = omit, + filters: Optional[vector_store_search_params.Filters] | Omit = omit, + file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit, + search_options: VectorStoreChunkSearchOptionsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreSearchResponse: """ Perform semantic search across vector store chunks. diff --git a/tests/test_transform.py b/tests/test_transform.py index 0bad8ee8..1337f4f6 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from mixedbread._types import NOT_GIVEN, Base64FileInput +from mixedbread._types import Base64FileInput, omit, not_given from mixedbread._utils import ( PropertyInfo, transform as _transform, @@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None: @pytest.mark.asyncio async def test_strips_notgiven(use_async: bool) -> None: assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} - assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} + assert await transform({"foo_bar": not_given}, Foo1, use_async) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_strips_omit(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": omit}, Foo1, use_async) == {} From 3dab10eca037653e15743682f304859d491202aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 03:46:19 +0000 Subject: [PATCH 04/15] chore: do not install brew dependencies in ./scripts/bootstrap by default --- scripts/bootstrap | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c..b430fee3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi From 3edbd387ef7fa62afc255a80b9ac0a385f2cef29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 03:11:00 +0000 Subject: [PATCH 05/15] chore(internal): improve examples --- tests/api_resources/test_vector_stores.py | 132 ++++++++++++++++-- .../api_resources/vector_stores/test_files.py | 132 ++++++++++++++++-- 2 files changed, 240 insertions(+), 24 deletions(-) diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index fa109005..6157396e 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -248,9 +248,36 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ @@ -307,9 +334,36 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ @@ -579,9 +633,36 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ @@ -638,9 +719,36 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py index 6d7726a2..24ccbdc7 100644 --- a/tests/api_resources/vector_stores/test_files.py +++ b/tests/api_resources/vector_stores/test_files.py @@ -155,9 +155,36 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None: include_total=False, statuses=["pending"], metadata_filter={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, ) assert_matches_type(FileListResponse, file, path=["response"]) @@ -260,9 +287,36 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ @@ -442,9 +496,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) include_total=False, statuses=["pending"], metadata_filter={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, ) assert_matches_type(FileListResponse, file, path=["response"]) @@ -547,9 +628,36 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread vector_store_identifiers=["string"], top_k=1, filters={ - "all": [], - "any": [], - "none": [], + "all": [ + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + { + "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + }, + ], + "any": [ + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], + "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], + "none": [ + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + { + "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + }, + ], }, file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], search_options={ From 7566937f6cc6e0d777294adb70963f06023d4358 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 04:03:41 +0000 Subject: [PATCH 06/15] chore(internal): use some smaller example values --- tests/api_resources/test_vector_stores.py | 120 +++++++++++------- .../api_resources/vector_stores/test_files.py | 120 +++++++++++------- 2 files changed, 144 insertions(+), 96 deletions(-) diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index 6157396e..61cbf6c2 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -250,32 +250,38 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -336,32 +342,38 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -635,32 +647,38 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -721,32 +739,38 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py index 24ccbdc7..eb15c4b6 100644 --- a/tests/api_resources/vector_stores/test_files.py +++ b/tests/api_resources/vector_stores/test_files.py @@ -157,32 +157,38 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None: metadata_filter={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -289,32 +295,38 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -498,32 +510,38 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) metadata_filter={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, @@ -630,32 +648,38 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread filters={ "all": [ { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "any": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"any": [{}, {}]}, {"any": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "any": [ { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"none": [{}, {}]}, {"none": [{}, {}]}], - "none": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], "none": [ { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "price", + "value": "100", + "operator": "gt", }, { - "all": [{"any": [{}, {}]}, {"any": [{}, {}]}], - "any": [{"all": [{}, {}]}, {"all": [{}, {}]}], + "key": "color", + "value": "red", + "operator": "eq", }, ], }, From cea83993a41231f4351dba325e798122660dabc3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 10:27:57 +0000 Subject: [PATCH 07/15] feat(api): api update --- .stats.yml | 4 +- .../resources/vector_stores/vector_stores.py | 12 +- .../types/scored_audio_url_input_chunk.py | 173 ++++- .../types/scored_image_url_input_chunk.py | 173 ++++- .../types/scored_text_input_chunk.py | 172 ++++- .../types/scored_video_url_input_chunk.py | 173 ++++- .../types/vector_stores/vector_store_file.py | 664 +++++++++++++++++- 7 files changed, 1342 insertions(+), 29 deletions(-) diff --git a/.stats.yml b/.stats.yml index c9fd9032..e9cacf73 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml -openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6eceba7c701064aa752ff55cf7539a15258dea54c151fec7e56a20c72bc2920a.yml +openapi_spec_hash: 46b9ea8cf4a72ab36be2f5d8fb45de54 config_hash: fef0ea78daf11093ff503919baae5ec0 diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py index 75d11b1c..fdc8c15a 100644 --- a/src/mixedbread/resources/vector_stores/vector_stores.py +++ b/src/mixedbread/resources/vector_stores/vector_stores.py @@ -258,10 +258,10 @@ def list( """ List all vector stores with optional search. - Args: pagination: The pagination options. q: Optional search query to filter - vector stores. + Args: options: The pagination options including limit, cursor, and optional + search query (q) - Returns: VectorStoreListResponse: The list of vector stores. + Returns: VectorStoreListResponse: The list of vector stores Args: limit: Maximum number of items to return per page (1-100) @@ -707,10 +707,10 @@ def list( """ List all vector stores with optional search. - Args: pagination: The pagination options. q: Optional search query to filter - vector stores. + Args: options: The pagination options including limit, cursor, and optional + search query (q) - Returns: VectorStoreListResponse: The list of vector stores. + Returns: VectorStoreListResponse: The list of vector stores Args: limit: Maximum number of items to return per page (1-100) diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py index 59d6423f..8c59a3d1 100644 --- a/src/mixedbread/types/scored_audio_url_input_chunk.py +++ b/src/mixedbread/types/scored_audio_url_input_chunk.py @@ -1,11 +1,176 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo from .._models import BaseModel -__all__ = ["ScoredAudioURLInputChunk", "AudioURL"] +__all__ = [ + "ScoredAudioURLInputChunk", + "GeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "GeneratedMetadataTextChunkGeneratedMetadata", + "GeneratedMetadataPdfChunkGeneratedMetadata", + "GeneratedMetadataCodeChunkGeneratedMetadata", + "GeneratedMetadataAudioChunkGeneratedMetadata", + "AudioURL", +] + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None + + heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +GeneratedMetadata: TypeAlias = Annotated[ + Union[ + GeneratedMetadataMarkdownChunkGeneratedMetadata, + GeneratedMetadataTextChunkGeneratedMetadata, + GeneratedMetadataPdfChunkGeneratedMetadata, + GeneratedMetadataCodeChunkGeneratedMetadata, + GeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] class AudioURL(BaseModel): @@ -20,7 +185,7 @@ class ScoredAudioURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[GeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py index 9bd0deb2..f3cd2fe8 100644 --- a/src/mixedbread/types/scored_image_url_input_chunk.py +++ b/src/mixedbread/types/scored_image_url_input_chunk.py @@ -1,11 +1,176 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo from .._models import BaseModel -__all__ = ["ScoredImageURLInputChunk", "ImageURL"] +__all__ = [ + "ScoredImageURLInputChunk", + "GeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "GeneratedMetadataTextChunkGeneratedMetadata", + "GeneratedMetadataPdfChunkGeneratedMetadata", + "GeneratedMetadataCodeChunkGeneratedMetadata", + "GeneratedMetadataAudioChunkGeneratedMetadata", + "ImageURL", +] + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None + + heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +GeneratedMetadata: TypeAlias = Annotated[ + Union[ + GeneratedMetadataMarkdownChunkGeneratedMetadata, + GeneratedMetadataTextChunkGeneratedMetadata, + GeneratedMetadataPdfChunkGeneratedMetadata, + GeneratedMetadataCodeChunkGeneratedMetadata, + GeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] class ImageURL(BaseModel): @@ -23,7 +188,7 @@ class ScoredImageURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[GeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py index 35f20c06..b299e211 100644 --- a/src/mixedbread/types/scored_text_input_chunk.py +++ b/src/mixedbread/types/scored_text_input_chunk.py @@ -1,11 +1,175 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo from .._models import BaseModel -__all__ = ["ScoredTextInputChunk"] +__all__ = [ + "ScoredTextInputChunk", + "GeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "GeneratedMetadataTextChunkGeneratedMetadata", + "GeneratedMetadataPdfChunkGeneratedMetadata", + "GeneratedMetadataCodeChunkGeneratedMetadata", + "GeneratedMetadataAudioChunkGeneratedMetadata", +] + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None + + heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +GeneratedMetadata: TypeAlias = Annotated[ + Union[ + GeneratedMetadataMarkdownChunkGeneratedMetadata, + GeneratedMetadataTextChunkGeneratedMetadata, + GeneratedMetadataPdfChunkGeneratedMetadata, + GeneratedMetadataCodeChunkGeneratedMetadata, + GeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] class ScoredTextInputChunk(BaseModel): @@ -15,7 +179,7 @@ class ScoredTextInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[GeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py index 78d77359..a6b9b316 100644 --- a/src/mixedbread/types/scored_video_url_input_chunk.py +++ b/src/mixedbread/types/scored_video_url_input_chunk.py @@ -1,11 +1,176 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo from .._models import BaseModel -__all__ = ["ScoredVideoURLInputChunk", "VideoURL"] +__all__ = [ + "ScoredVideoURLInputChunk", + "GeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadata", + "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "GeneratedMetadataTextChunkGeneratedMetadata", + "GeneratedMetadataPdfChunkGeneratedMetadata", + "GeneratedMetadataCodeChunkGeneratedMetadata", + "GeneratedMetadataAudioChunkGeneratedMetadata", + "VideoURL", +] + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None + + heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +GeneratedMetadata: TypeAlias = Annotated[ + Union[ + GeneratedMetadataMarkdownChunkGeneratedMetadata, + GeneratedMetadataTextChunkGeneratedMetadata, + GeneratedMetadataPdfChunkGeneratedMetadata, + GeneratedMetadataCodeChunkGeneratedMetadata, + GeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] class VideoURL(BaseModel): @@ -20,7 +185,7 @@ class ScoredVideoURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[GeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py index e9c535d4..318fb208 100644 --- a/src/mixedbread/types/vector_stores/vector_store_file.py +++ b/src/mixedbread/types/vector_stores/vector_store_file.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import TYPE_CHECKING, Dict, List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from ..._utils import PropertyInfo from ..._models import BaseModel from .vector_store_file_status import VectorStoreFileStatus @@ -12,15 +14,202 @@ "VectorStoreFile", "Chunk", "ChunkTextInputChunk", + "ChunkTextInputChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkImageURLInputChunk", + "ChunkImageURLInputChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkImageURLInputChunkImageURL", "ChunkAudioURLInputChunk", + "ChunkAudioURLInputChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkAudioURLInputChunkAudioURL", "ChunkVideoURLInputChunk", + "ChunkVideoURLInputChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", + "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", + "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkVideoURLInputChunkVideoURL", ] +class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = ( + None + ) + + heading_context: Optional[ + List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] + ] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[ + Union[ + ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, + ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata, + ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, + ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, + ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] + + class ChunkTextInputChunk(BaseModel): chunk_index: int """position of the chunk in a file""" @@ -28,7 +217,7 @@ class ChunkTextInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None @@ -44,6 +233,161 @@ class ChunkTextInputChunk(BaseModel): """Text content to process""" +class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[ + List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] + ] = None + + heading_context: Optional[ + List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] + ] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ + Union[ + ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, + ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, + ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, + ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, + ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] + + class ChunkImageURLInputChunkImageURL(BaseModel): url: str """The image URL. Can be either a URL or a Data URI.""" @@ -59,7 +403,7 @@ class ChunkImageURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None @@ -78,6 +422,161 @@ class ChunkImageURLInputChunk(BaseModel): """The image input specification.""" +class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[ + List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] + ] = None + + heading_context: Optional[ + List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] + ] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ + Union[ + ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, + ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, + ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, + ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, + ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] + + class ChunkAudioURLInputChunkAudioURL(BaseModel): url: str """The audio URL. Can be either a URL or a Data URI.""" @@ -90,7 +589,7 @@ class ChunkAudioURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None @@ -112,6 +611,161 @@ class ChunkAudioURLInputChunk(BaseModel): """The sampling rate of the audio.""" +class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): + level: int + + text: str + + +class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): + level: int + + text: str + + +class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["markdown"]] = None + + file_type: Optional[Literal["text/markdown"]] = None + + language: str + + word_count: int + + file_size: int + + chunk_headings: Optional[ + List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] + ] = None + + heading_context: Optional[ + List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] + ] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["text"]] = None + + file_type: Optional[Literal["text/plain"]] = None + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["pdf"]] = None + + file_type: Optional[Literal["application/pdf"]] = None + + total_pages: int + + total_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["code"]] = None + + file_type: str + + language: str + + word_count: int + + file_size: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["audio"]] = None + + file_type: str + + file_size: int + + total_duration_seconds: float + + sample_rate: int + + channels: int + + audio_format: int + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ + Union[ + ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, + ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, + ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, + ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, + ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, + None, + ], + PropertyInfo(discriminator="type"), +] + + class ChunkVideoURLInputChunkVideoURL(BaseModel): url: str """The video URL. Can be either a URL or a Data URI.""" @@ -124,7 +778,7 @@ class ChunkVideoURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[Dict[str, object]] = None + generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None """metadata of the chunk""" model: Optional[str] = None From 91f4c77e0679065d375bb70b6f4618683aa7d77d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 28 Sep 2025 11:27:56 +0000 Subject: [PATCH 08/15] feat(api): api update --- .stats.yml | 4 +- .../resources/vector_stores/vector_stores.py | 12 +- .../types/scored_audio_url_input_chunk.py | 173 +---- .../types/scored_image_url_input_chunk.py | 173 +---- .../types/scored_text_input_chunk.py | 172 +---- .../types/scored_video_url_input_chunk.py | 173 +---- .../types/vector_stores/vector_store_file.py | 664 +----------------- 7 files changed, 29 insertions(+), 1342 deletions(-) diff --git a/.stats.yml b/.stats.yml index e9cacf73..fb5eaf61 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6eceba7c701064aa752ff55cf7539a15258dea54c151fec7e56a20c72bc2920a.yml -openapi_spec_hash: 46b9ea8cf4a72ab36be2f5d8fb45de54 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7e1c9e69f48d60426e9495fa864cacb60b1df2462a89dd0dc6f8faa29b85537d.yml +openapi_spec_hash: c6ac1b5e4ee5db8723cc223695d296f5 config_hash: fef0ea78daf11093ff503919baae5ec0 diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py index fdc8c15a..75d11b1c 100644 --- a/src/mixedbread/resources/vector_stores/vector_stores.py +++ b/src/mixedbread/resources/vector_stores/vector_stores.py @@ -258,10 +258,10 @@ def list( """ List all vector stores with optional search. - Args: options: The pagination options including limit, cursor, and optional - search query (q) + Args: pagination: The pagination options. q: Optional search query to filter + vector stores. - Returns: VectorStoreListResponse: The list of vector stores + Returns: VectorStoreListResponse: The list of vector stores. Args: limit: Maximum number of items to return per page (1-100) @@ -707,10 +707,10 @@ def list( """ List all vector stores with optional search. - Args: options: The pagination options including limit, cursor, and optional - search query (q) + Args: pagination: The pagination options. q: Optional search query to filter + vector stores. - Returns: VectorStoreListResponse: The list of vector stores + Returns: VectorStoreListResponse: The list of vector stores. Args: limit: Maximum number of items to return per page (1-100) diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py index 8c59a3d1..59d6423f 100644 --- a/src/mixedbread/types/scored_audio_url_input_chunk.py +++ b/src/mixedbread/types/scored_audio_url_input_chunk.py @@ -1,176 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing import Dict, Optional +from typing_extensions import Literal -from pydantic import Field as FieldInfo - -from .._utils import PropertyInfo from .._models import BaseModel -__all__ = [ - "ScoredAudioURLInputChunk", - "GeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "GeneratedMetadataTextChunkGeneratedMetadata", - "GeneratedMetadataPdfChunkGeneratedMetadata", - "GeneratedMetadataCodeChunkGeneratedMetadata", - "GeneratedMetadataAudioChunkGeneratedMetadata", - "AudioURL", -] - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None - - heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -GeneratedMetadata: TypeAlias = Annotated[ - Union[ - GeneratedMetadataMarkdownChunkGeneratedMetadata, - GeneratedMetadataTextChunkGeneratedMetadata, - GeneratedMetadataPdfChunkGeneratedMetadata, - GeneratedMetadataCodeChunkGeneratedMetadata, - GeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] +__all__ = ["ScoredAudioURLInputChunk", "AudioURL"] class AudioURL(BaseModel): @@ -185,7 +20,7 @@ class ScoredAudioURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[GeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py index f3cd2fe8..9bd0deb2 100644 --- a/src/mixedbread/types/scored_image_url_input_chunk.py +++ b/src/mixedbread/types/scored_image_url_input_chunk.py @@ -1,176 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing import Dict, Optional +from typing_extensions import Literal -from pydantic import Field as FieldInfo - -from .._utils import PropertyInfo from .._models import BaseModel -__all__ = [ - "ScoredImageURLInputChunk", - "GeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "GeneratedMetadataTextChunkGeneratedMetadata", - "GeneratedMetadataPdfChunkGeneratedMetadata", - "GeneratedMetadataCodeChunkGeneratedMetadata", - "GeneratedMetadataAudioChunkGeneratedMetadata", - "ImageURL", -] - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None - - heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -GeneratedMetadata: TypeAlias = Annotated[ - Union[ - GeneratedMetadataMarkdownChunkGeneratedMetadata, - GeneratedMetadataTextChunkGeneratedMetadata, - GeneratedMetadataPdfChunkGeneratedMetadata, - GeneratedMetadataCodeChunkGeneratedMetadata, - GeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] +__all__ = ["ScoredImageURLInputChunk", "ImageURL"] class ImageURL(BaseModel): @@ -188,7 +23,7 @@ class ScoredImageURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[GeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py index b299e211..35f20c06 100644 --- a/src/mixedbread/types/scored_text_input_chunk.py +++ b/src/mixedbread/types/scored_text_input_chunk.py @@ -1,175 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing import Dict, Optional +from typing_extensions import Literal -from pydantic import Field as FieldInfo - -from .._utils import PropertyInfo from .._models import BaseModel -__all__ = [ - "ScoredTextInputChunk", - "GeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "GeneratedMetadataTextChunkGeneratedMetadata", - "GeneratedMetadataPdfChunkGeneratedMetadata", - "GeneratedMetadataCodeChunkGeneratedMetadata", - "GeneratedMetadataAudioChunkGeneratedMetadata", -] - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None - - heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -GeneratedMetadata: TypeAlias = Annotated[ - Union[ - GeneratedMetadataMarkdownChunkGeneratedMetadata, - GeneratedMetadataTextChunkGeneratedMetadata, - GeneratedMetadataPdfChunkGeneratedMetadata, - GeneratedMetadataCodeChunkGeneratedMetadata, - GeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] +__all__ = ["ScoredTextInputChunk"] class ScoredTextInputChunk(BaseModel): @@ -179,7 +15,7 @@ class ScoredTextInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[GeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py index a6b9b316..78d77359 100644 --- a/src/mixedbread/types/scored_video_url_input_chunk.py +++ b/src/mixedbread/types/scored_video_url_input_chunk.py @@ -1,176 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing import Dict, Optional +from typing_extensions import Literal -from pydantic import Field as FieldInfo - -from .._utils import PropertyInfo from .._models import BaseModel -__all__ = [ - "ScoredVideoURLInputChunk", - "GeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadata", - "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "GeneratedMetadataTextChunkGeneratedMetadata", - "GeneratedMetadataPdfChunkGeneratedMetadata", - "GeneratedMetadataCodeChunkGeneratedMetadata", - "GeneratedMetadataAudioChunkGeneratedMetadata", - "VideoURL", -] - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None - - heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -GeneratedMetadata: TypeAlias = Annotated[ - Union[ - GeneratedMetadataMarkdownChunkGeneratedMetadata, - GeneratedMetadataTextChunkGeneratedMetadata, - GeneratedMetadataPdfChunkGeneratedMetadata, - GeneratedMetadataCodeChunkGeneratedMetadata, - GeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] +__all__ = ["ScoredVideoURLInputChunk", "VideoURL"] class VideoURL(BaseModel): @@ -185,7 +20,7 @@ class ScoredVideoURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[GeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py index 318fb208..e9c535d4 100644 --- a/src/mixedbread/types/vector_stores/vector_store_file.py +++ b/src/mixedbread/types/vector_stores/vector_store_file.py @@ -1,11 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing import Dict, List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias -from pydantic import Field as FieldInfo - from ..._utils import PropertyInfo from ..._models import BaseModel from .vector_store_file_status import VectorStoreFileStatus @@ -14,202 +12,15 @@ "VectorStoreFile", "Chunk", "ChunkTextInputChunk", - "ChunkTextInputChunkGeneratedMetadata", - "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", - "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata", - "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", - "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", - "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkImageURLInputChunk", - "ChunkImageURLInputChunkGeneratedMetadata", - "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", - "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", - "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", - "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", - "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkImageURLInputChunkImageURL", "ChunkAudioURLInputChunk", - "ChunkAudioURLInputChunkGeneratedMetadata", - "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", - "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", - "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", - "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", - "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkAudioURLInputChunkAudioURL", "ChunkVideoURLInputChunk", - "ChunkVideoURLInputChunkGeneratedMetadata", - "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", - "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading", - "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext", - "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata", - "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata", - "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", - "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkVideoURLInputChunkVideoURL", ] -class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = ( - None - ) - - heading_context: Optional[ - List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] - ] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[ - Union[ - ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, - ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata, - ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, - ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, - ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] - - class ChunkTextInputChunk(BaseModel): chunk_index: int """position of the chunk in a file""" @@ -217,7 +28,7 @@ class ChunkTextInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None @@ -233,161 +44,6 @@ class ChunkTextInputChunk(BaseModel): """Text content to process""" -class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[ - List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] - ] = None - - heading_context: Optional[ - List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] - ] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ - Union[ - ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, - ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, - ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, - ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, - ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] - - class ChunkImageURLInputChunkImageURL(BaseModel): url: str """The image URL. Can be either a URL or a Data URI.""" @@ -403,7 +59,7 @@ class ChunkImageURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None @@ -422,161 +78,6 @@ class ChunkImageURLInputChunk(BaseModel): """The image input specification.""" -class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[ - List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] - ] = None - - heading_context: Optional[ - List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] - ] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ - Union[ - ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, - ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, - ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, - ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, - ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] - - class ChunkAudioURLInputChunkAudioURL(BaseModel): url: str """The audio URL. Can be either a URL or a Data URI.""" @@ -589,7 +90,7 @@ class ChunkAudioURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None @@ -611,161 +112,6 @@ class ChunkAudioURLInputChunk(BaseModel): """The sampling rate of the audio.""" -class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel): - level: int - - text: str - - -class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel): - level: int - - text: str - - -class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["markdown"]] = None - - file_type: Optional[Literal["text/markdown"]] = None - - language: str - - word_count: int - - file_size: int - - chunk_headings: Optional[ - List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading] - ] = None - - heading_context: Optional[ - List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext] - ] = None - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["text"]] = None - - file_type: Optional[Literal["text/plain"]] = None - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["pdf"]] = None - - file_type: Optional[Literal["application/pdf"]] = None - - total_pages: int - - total_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["code"]] = None - - file_type: str - - language: str - - word_count: int - - file_size: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -class ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): - type: Optional[Literal["audio"]] = None - - file_type: str - - file_size: int - - total_duration_seconds: float - - sample_rate: int - - channels: int - - audio_format: int - - if TYPE_CHECKING: - # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a - # value to this field, so for compatibility we avoid doing it at runtime. - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - else: - __pydantic_extra__: Dict[str, object] - - -ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[ - Union[ - ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata, - ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata, - ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata, - ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, - ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, - None, - ], - PropertyInfo(discriminator="type"), -] - - class ChunkVideoURLInputChunkVideoURL(BaseModel): url: str """The video URL. Can be either a URL or a Data URI.""" @@ -778,7 +124,7 @@ class ChunkVideoURLInputChunk(BaseModel): mime_type: Optional[str] = None """mime type of the chunk""" - generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None + generated_metadata: Optional[Dict[str, object]] = None """metadata of the chunk""" model: Optional[str] = None From 26ce1c1583f2eef287cdf5383398326d755428c4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 17:28:03 +0000 Subject: [PATCH 09/15] feat(api): api update --- .stats.yml | 4 +- api.md | 4 - .../resources/data_sources/connectors.py | 12 +- .../resources/vector_stores/files.py | 235 ++-- .../resources/vector_stores/vector_stores.py | 313 +++-- src/mixedbread/types/__init__.py | 4 - .../data_sources/connector_create_params.py | 4 +- .../data_sources/data_source_connector.py | 4 +- src/mixedbread/types/expires_after.py | 2 +- src/mixedbread/types/expires_after_param.py | 2 +- .../types/scored_audio_url_input_chunk.py | 57 - .../types/scored_image_url_input_chunk.py | 57 - .../types/scored_text_input_chunk.py | 46 - .../types/scored_video_url_input_chunk.py | 54 - src/mixedbread/types/vector_store.py | 2 +- .../types/vector_store_create_params.py | 2 +- ...ector_store_question_answering_response.py | 210 +++- .../types/vector_store_search_response.py | 208 +++- .../types/vector_store_update_params.py | 4 +- .../types/vector_stores/file_list_params.py | 5 +- .../vector_stores/scored_vector_store_file.py | 215 +++- .../types/vector_stores/vector_store_file.py | 7 +- .../data_sources/test_connectors.py | 20 +- tests/api_resources/test_vector_stores.py | 1030 +++++++++-------- .../api_resources/vector_stores/test_files.py | 980 ++++++++-------- 25 files changed, 1979 insertions(+), 1502 deletions(-) delete mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py delete mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py delete mode 100644 src/mixedbread/types/scored_text_input_chunk.py delete mode 100644 src/mixedbread/types/scored_video_url_input_chunk.py diff --git a/.stats.yml b/.stats.yml index fb5eaf61..bc469a36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7e1c9e69f48d60426e9495fa864cacb60b1df2462a89dd0dc6f8faa29b85537d.yml -openapi_spec_hash: c6ac1b5e4ee5db8723cc223695d296f5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-badb544207d1a5cbf542ecf662d4d4f085dd7d402c367620eeda31c2949c2f79.yml +openapi_spec_hash: 27c151b834d6c5a5dc72e8f10c861840 config_hash: fef0ea78daf11093ff503919baae5ec0 diff --git a/api.md b/api.md index 2a054ea2..1f6ce1dd 100644 --- a/api.md +++ b/api.md @@ -31,10 +31,6 @@ Types: ```python from mixedbread.types import ( ExpiresAfter, - ScoredAudioURLInputChunk, - ScoredImageURLInputChunk, - ScoredTextInputChunk, - ScoredVideoURLInputChunk, VectorStore, VectorStoreChunkSearchOptions, VectorStoreDeleteResponse, diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py index 9ab5bee1..bd913e76 100644 --- a/src/mixedbread/resources/data_sources/connectors.py +++ b/src/mixedbread/resources/data_sources/connectors.py @@ -49,7 +49,7 @@ def create( self, data_source_id: str, *, - vector_store_id: str, + store_id: str, name: str | Omit = omit, trigger_sync: bool | Omit = omit, metadata: object | Omit = omit, @@ -72,7 +72,7 @@ def create( Args: data_source_id: The ID of the data source to create a connector for - vector_store_id: The ID of the vector store + store_id: The ID of the store name: The name of the connector @@ -101,7 +101,7 @@ def create( f"/v1/data_sources/{data_source_id}/connectors", body=maybe_transform( { - "vector_store_id": vector_store_id, + "store_id": store_id, "name": name, "trigger_sync": trigger_sync, "metadata": metadata, @@ -369,7 +369,7 @@ async def create( self, data_source_id: str, *, - vector_store_id: str, + store_id: str, name: str | Omit = omit, trigger_sync: bool | Omit = omit, metadata: object | Omit = omit, @@ -392,7 +392,7 @@ async def create( Args: data_source_id: The ID of the data source to create a connector for - vector_store_id: The ID of the vector store + store_id: The ID of the store name: The name of the connector @@ -421,7 +421,7 @@ async def create( f"/v1/data_sources/{data_source_id}/connectors", body=await async_maybe_transform( { - "vector_store_id": vector_store_id, + "store_id": store_id, "name": name, "trigger_sync": trigger_sync, "metadata": metadata, diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py index 1ff0c88f..fc2cd73f 100644 --- a/src/mixedbread/resources/vector_stores/files.py +++ b/src/mixedbread/resources/vector_stores/files.py @@ -3,7 +3,9 @@ from __future__ import annotations import functools +import typing_extensions from typing import Any, List, Union, Iterable, Optional +from typing_extensions import Literal import httpx @@ -24,7 +26,6 @@ from ...types.vector_stores.file_list_response import FileListResponse from ...types.vector_stores.file_delete_response import FileDeleteResponse from ...types.vector_stores.file_search_response import FileSearchResponse -from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus __all__ = ["FilesResource", "AsyncFilesResource"] @@ -49,6 +50,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse: """ return FilesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, vector_store_identifier: str, @@ -64,12 +66,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ - Add an already uploaded file to a vector store. - - Args: vector_store_identifier: The ID or name of the vector store to add the - file to file: The file to add and index - - Returns: VectorStoreFile: Details of the added and indexed file + DEPRECATED: Use POST /stores/{store_identifier}/files instead Args: vector_store_identifier: The ID or name of the vector store @@ -108,6 +105,7 @@ def create( cast_to=VectorStoreFile, ) + @typing_extensions.deprecated("deprecated") def retrieve( self, file_id: str, @@ -122,17 +120,12 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ - Get details of a specific file in a vector store. - - Args: vector_store_identifier: The ID or name of the vector store file_id: The - ID of the file - - Returns: VectorStoreFile: Details of the vector store file + DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead Args: vector_store_identifier: The ID or name of the vector store - file_id: The ID of the file + file_id: The ID or name of the file return_chunks: Whether to return the chunks for the file @@ -162,6 +155,7 @@ def retrieve( cast_to=VectorStoreFile, ) + @typing_extensions.deprecated("deprecated") def list( self, vector_store_identifier: str, @@ -170,7 +164,7 @@ def list( after: Optional[str] | Omit = omit, before: Optional[str] | Omit = omit, include_total: bool | Omit = omit, - statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit, + statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit, metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -180,12 +174,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileListResponse: """ - List files indexed in a vector store with pagination and metadata filter. - - Args: vector_store_identifier: The ID or name of the vector store pagination: - Pagination parameters and metadata filter - - Returns: VectorStoreFileListResponse: Paginated list of vector store files + DEPRECATED: Use POST /stores/{store_identifier}/files/list instead Args: vector_store_identifier: The ID or name of the vector store @@ -235,6 +224,7 @@ def list( cast_to=FileListResponse, ) + @typing_extensions.deprecated("deprecated") def delete( self, file_id: str, @@ -248,17 +238,12 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ - Delete a file from a vector store. - - Args: vector_store_identifier: The ID or name of the vector store file_id: The - ID of the file to delete - - Returns: VectorStoreFileDeleted: The deleted file + DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead Args: vector_store_identifier: The ID or name of the vector store - file_id: The ID of the file to delete + file_id: The ID or name of the file to delete extra_headers: Send extra headers @@ -282,6 +267,7 @@ def delete( cast_to=FileDeleteResponse, ) + @typing_extensions.deprecated("deprecated") def search( self, *, @@ -299,22 +285,7 @@ def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileSearchResponse: """ - Perform semantic search across complete vector store files. - - This endpoint searches through vector store files using semantic similarity - matching. Unlike chunk search, it returns complete matching files rather than - individual chunks. Supports complex search queries with filters and returns - relevance-scored results. - - Args: search_params: Search configuration including: - query text or - embeddings - metadata filters - pagination parameters - sorting preferences - \\__state: API state dependency \\__ctx: Service context dependency - - Returns: VectorStoreSearchFileResponse containing: - List of matched files with - relevance scores - Pagination details including total result count - - Raises: HTTPException (400): If search parameters are invalid HTTPException - (404): If no vector stores are found to search + DEPRECATED: Use POST /stores/{store_identifier}/files/search instead Args: query: Search query text @@ -483,6 +454,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse: """ return AsyncFilesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, vector_store_identifier: str, @@ -498,12 +470,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ - Add an already uploaded file to a vector store. - - Args: vector_store_identifier: The ID or name of the vector store to add the - file to file: The file to add and index - - Returns: VectorStoreFile: Details of the added and indexed file + DEPRECATED: Use POST /stores/{store_identifier}/files instead Args: vector_store_identifier: The ID or name of the vector store @@ -542,6 +509,7 @@ async def create( cast_to=VectorStoreFile, ) + @typing_extensions.deprecated("deprecated") async def retrieve( self, file_id: str, @@ -556,17 +524,12 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreFile: """ - Get details of a specific file in a vector store. - - Args: vector_store_identifier: The ID or name of the vector store file_id: The - ID of the file - - Returns: VectorStoreFile: Details of the vector store file + DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead Args: vector_store_identifier: The ID or name of the vector store - file_id: The ID of the file + file_id: The ID or name of the file return_chunks: Whether to return the chunks for the file @@ -598,6 +561,7 @@ async def retrieve( cast_to=VectorStoreFile, ) + @typing_extensions.deprecated("deprecated") async def list( self, vector_store_identifier: str, @@ -606,7 +570,7 @@ async def list( after: Optional[str] | Omit = omit, before: Optional[str] | Omit = omit, include_total: bool | Omit = omit, - statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit, + statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit, metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -616,12 +580,7 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileListResponse: """ - List files indexed in a vector store with pagination and metadata filter. - - Args: vector_store_identifier: The ID or name of the vector store pagination: - Pagination parameters and metadata filter - - Returns: VectorStoreFileListResponse: Paginated list of vector store files + DEPRECATED: Use POST /stores/{store_identifier}/files/list instead Args: vector_store_identifier: The ID or name of the vector store @@ -671,6 +630,7 @@ async def list( cast_to=FileListResponse, ) + @typing_extensions.deprecated("deprecated") async def delete( self, file_id: str, @@ -684,17 +644,12 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileDeleteResponse: """ - Delete a file from a vector store. - - Args: vector_store_identifier: The ID or name of the vector store file_id: The - ID of the file to delete - - Returns: VectorStoreFileDeleted: The deleted file + DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead Args: vector_store_identifier: The ID or name of the vector store - file_id: The ID of the file to delete + file_id: The ID or name of the file to delete extra_headers: Send extra headers @@ -718,6 +673,7 @@ async def delete( cast_to=FileDeleteResponse, ) + @typing_extensions.deprecated("deprecated") async def search( self, *, @@ -735,22 +691,7 @@ async def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FileSearchResponse: """ - Perform semantic search across complete vector store files. - - This endpoint searches through vector store files using semantic similarity - matching. Unlike chunk search, it returns complete matching files rather than - individual chunks. Supports complex search queries with filters and returns - relevance-scored results. - - Args: search_params: Search configuration including: - query text or - embeddings - metadata filters - pagination parameters - sorting preferences - \\__state: API state dependency \\__ctx: Service context dependency - - Returns: VectorStoreSearchFileResponse containing: - List of matched files with - relevance scores - Pagination details including total result count - - Raises: HTTPException (400): If search parameters are invalid HTTPException - (404): If no vector stores are found to search + DEPRECATED: Use POST /stores/{store_identifier}/files/search instead Args: query: Search query text @@ -907,20 +848,30 @@ class FilesResourceWithRawResponse: def __init__(self, files: FilesResource) -> None: self._files = files - self.create = to_raw_response_wrapper( - files.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + files.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = to_raw_response_wrapper( - files.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + files.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - files.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + files.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - files.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + files.delete, # pyright: ignore[reportDeprecated], + ) ) - self.search = to_raw_response_wrapper( - files.search, + self.search = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + files.search, # pyright: ignore[reportDeprecated], + ) ) @@ -928,20 +879,30 @@ class AsyncFilesResourceWithRawResponse: def __init__(self, files: AsyncFilesResource) -> None: self._files = files - self.create = async_to_raw_response_wrapper( - files.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + files.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = async_to_raw_response_wrapper( - files.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + files.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - files.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + files.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - files.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + files.delete, # pyright: ignore[reportDeprecated], + ) ) - self.search = async_to_raw_response_wrapper( - files.search, + self.search = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + files.search, # pyright: ignore[reportDeprecated], + ) ) @@ -949,20 +910,30 @@ class FilesResourceWithStreamingResponse: def __init__(self, files: FilesResource) -> None: self._files = files - self.create = to_streamed_response_wrapper( - files.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + files.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = to_streamed_response_wrapper( - files.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + files.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - files.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + files.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - files.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + files.delete, # pyright: ignore[reportDeprecated], + ) ) - self.search = to_streamed_response_wrapper( - files.search, + self.search = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + files.search, # pyright: ignore[reportDeprecated], + ) ) @@ -970,18 +941,28 @@ class AsyncFilesResourceWithStreamingResponse: def __init__(self, files: AsyncFilesResource) -> None: self._files = files - self.create = async_to_streamed_response_wrapper( - files.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + files.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = async_to_streamed_response_wrapper( - files.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + files.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - files.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + files.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - files.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + files.delete, # pyright: ignore[reportDeprecated], + ) ) - self.search = async_to_streamed_response_wrapper( - files.search, + self.search = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + files.search, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py index 75d11b1c..548ffe13 100644 --- a/src/mixedbread/resources/vector_stores/vector_stores.py +++ b/src/mixedbread/resources/vector_stores/vector_stores.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Union, Iterable, Optional import httpx @@ -67,6 +68,7 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse: """ return VectorStoresResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, *, @@ -84,12 +86,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Create a new vector store. - - Args: vector_store_create: VectorStoreCreate object containing the name, - description, and metadata. - - Returns: VectorStore: The response containing the created vector store details. + DEPRECATED: Use POST /stores instead Args: name: Name for the new vector store @@ -98,7 +95,7 @@ def create( is_public: Whether the vector store can be accessed by anyone with valid login credentials - expires_after: Represents an expiration policy for a vector store. + expires_after: Represents an expiration policy for a store. metadata: Optional metadata key-value pairs @@ -131,6 +128,7 @@ def create( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") def retrieve( self, vector_store_identifier: str, @@ -143,11 +141,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Get a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to retrieve. - - Returns: VectorStore: The response containing the vector store details. + DEPRECATED: Use GET /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store @@ -172,6 +166,7 @@ def retrieve( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") def update( self, vector_store_identifier: str, @@ -189,24 +184,18 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Update a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to update. - vector_store_update: VectorStoreCreate object containing the name, description, - and metadata. - - Returns: VectorStore: The response containing the updated vector store details. + DEPRECATED: Use PUT /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store - name: New name for the vector store + name: New name for the store description: New description is_public: Whether the vector store can be accessed by anyone with valid login credentials - expires_after: Represents an expiration policy for a vector store. + expires_after: Represents an expiration policy for a store. metadata: Optional metadata key-value pairs @@ -240,6 +229,7 @@ def update( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -256,12 +246,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursor[VectorStore]: """ - List all vector stores with optional search. - - Args: pagination: The pagination options. q: Optional search query to filter - vector stores. - - Returns: VectorStoreListResponse: The list of vector stores. + DEPRECATED: Use GET /stores instead Args: limit: Maximum number of items to return per page (1-100) @@ -306,6 +291,7 @@ def list( model=VectorStore, ) + @typing_extensions.deprecated("deprecated") def delete( self, vector_store_identifier: str, @@ -318,11 +304,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreDeleteResponse: """ - Delete a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to delete. - - Returns: VectorStore: The response containing the deleted vector store details. + DEPRECATED: Use DELETE /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store to delete @@ -347,6 +329,7 @@ def delete( cast_to=VectorStoreDeleteResponse, ) + @typing_extensions.deprecated("deprecated") def question_answering( self, *, @@ -365,12 +348,11 @@ def question_answering( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreQuestionAnsweringResponse: - """Question answering + """ + DEPRECATED: Use POST /stores/question-answering instead Args: - query: Question to answer. - - If not provided, the question will be extracted from the + query: Question to answer. If not provided, the question will be extracted from the passed messages. vector_store_identifiers: IDs or names of vector stores to search @@ -416,6 +398,7 @@ def question_answering( cast_to=VectorStoreQuestionAnsweringResponse, ) + @typing_extensions.deprecated("deprecated") def search( self, *, @@ -433,23 +416,7 @@ def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreSearchResponse: """ - Perform semantic search across vector store chunks. - - This endpoint searches through vector store chunks using semantic similarity - matching. It supports complex search queries with filters and returns - relevance-scored results. - - Args: search_params: Search configuration including: - query text or - embeddings - vector_store_ids: List of vector stores to search - file_ids: - Optional list of file IDs to filter chunks by (or tuple of list and condition - operator) - metadata filters - pagination parameters - sorting preferences - \\__state: API state dependency \\__ctx: Service context dependency - - Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks - with relevance scores - Pagination details including total result count - - Raises: HTTPException (400): If search parameters are invalid HTTPException - (404): If no vector stores are found to search + DEPRECATED: Use POST /stores/search instead Args: query: Search query text @@ -516,6 +483,7 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo """ return AsyncVectorStoresResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, *, @@ -533,12 +501,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Create a new vector store. - - Args: vector_store_create: VectorStoreCreate object containing the name, - description, and metadata. - - Returns: VectorStore: The response containing the created vector store details. + DEPRECATED: Use POST /stores instead Args: name: Name for the new vector store @@ -547,7 +510,7 @@ async def create( is_public: Whether the vector store can be accessed by anyone with valid login credentials - expires_after: Represents an expiration policy for a vector store. + expires_after: Represents an expiration policy for a store. metadata: Optional metadata key-value pairs @@ -580,6 +543,7 @@ async def create( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") async def retrieve( self, vector_store_identifier: str, @@ -592,11 +556,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Get a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to retrieve. - - Returns: VectorStore: The response containing the vector store details. + DEPRECATED: Use GET /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store @@ -621,6 +581,7 @@ async def retrieve( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") async def update( self, vector_store_identifier: str, @@ -638,24 +599,18 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStore: """ - Update a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to update. - vector_store_update: VectorStoreCreate object containing the name, description, - and metadata. - - Returns: VectorStore: The response containing the updated vector store details. + DEPRECATED: Use PUT /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store - name: New name for the vector store + name: New name for the store description: New description is_public: Whether the vector store can be accessed by anyone with valid login credentials - expires_after: Represents an expiration policy for a vector store. + expires_after: Represents an expiration policy for a store. metadata: Optional metadata key-value pairs @@ -689,6 +644,7 @@ async def update( cast_to=VectorStore, ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -705,12 +661,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]: """ - List all vector stores with optional search. - - Args: pagination: The pagination options. q: Optional search query to filter - vector stores. - - Returns: VectorStoreListResponse: The list of vector stores. + DEPRECATED: Use GET /stores instead Args: limit: Maximum number of items to return per page (1-100) @@ -755,6 +706,7 @@ def list( model=VectorStore, ) + @typing_extensions.deprecated("deprecated") async def delete( self, vector_store_identifier: str, @@ -767,11 +719,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreDeleteResponse: """ - Delete a vector store by ID or name. - - Args: vector_store_identifier: The ID or name of the vector store to delete. - - Returns: VectorStore: The response containing the deleted vector store details. + DEPRECATED: Use DELETE /stores/{store_identifier} instead Args: vector_store_identifier: The ID or name of the vector store to delete @@ -796,6 +744,7 @@ async def delete( cast_to=VectorStoreDeleteResponse, ) + @typing_extensions.deprecated("deprecated") async def question_answering( self, *, @@ -814,12 +763,11 @@ async def question_answering( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreQuestionAnsweringResponse: - """Question answering + """ + DEPRECATED: Use POST /stores/question-answering instead Args: - query: Question to answer. - - If not provided, the question will be extracted from the + query: Question to answer. If not provided, the question will be extracted from the passed messages. vector_store_identifiers: IDs or names of vector stores to search @@ -865,6 +813,7 @@ async def question_answering( cast_to=VectorStoreQuestionAnsweringResponse, ) + @typing_extensions.deprecated("deprecated") async def search( self, *, @@ -882,23 +831,7 @@ async def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VectorStoreSearchResponse: """ - Perform semantic search across vector store chunks. - - This endpoint searches through vector store chunks using semantic similarity - matching. It supports complex search queries with filters and returns - relevance-scored results. - - Args: search_params: Search configuration including: - query text or - embeddings - vector_store_ids: List of vector stores to search - file_ids: - Optional list of file IDs to filter chunks by (or tuple of list and condition - operator) - metadata filters - pagination parameters - sorting preferences - \\__state: API state dependency \\__ctx: Service context dependency - - Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks - with relevance scores - Pagination details including total result count - - Raises: HTTPException (400): If search parameters are invalid HTTPException - (404): If no vector stores are found to search + DEPRECATED: Use POST /stores/search instead Args: query: Search query text @@ -945,26 +878,40 @@ class VectorStoresResourceWithRawResponse: def __init__(self, vector_stores: VectorStoresResource) -> None: self._vector_stores = vector_stores - self.create = to_raw_response_wrapper( - vector_stores.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = to_raw_response_wrapper( - vector_stores.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.update = to_raw_response_wrapper( - vector_stores.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - vector_stores.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - vector_stores.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.delete, # pyright: ignore[reportDeprecated], + ) ) - self.question_answering = to_raw_response_wrapper( - vector_stores.question_answering, + self.question_answering = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.question_answering, # pyright: ignore[reportDeprecated], + ) ) - self.search = to_raw_response_wrapper( - vector_stores.search, + self.search = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + vector_stores.search, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -976,26 +923,40 @@ class AsyncVectorStoresResourceWithRawResponse: def __init__(self, vector_stores: AsyncVectorStoresResource) -> None: self._vector_stores = vector_stores - self.create = async_to_raw_response_wrapper( - vector_stores.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = async_to_raw_response_wrapper( - vector_stores.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_raw_response_wrapper( - vector_stores.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - vector_stores.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - vector_stores.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.delete, # pyright: ignore[reportDeprecated], + ) ) - self.question_answering = async_to_raw_response_wrapper( - vector_stores.question_answering, + self.question_answering = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.question_answering, # pyright: ignore[reportDeprecated], + ) ) - self.search = async_to_raw_response_wrapper( - vector_stores.search, + self.search = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + vector_stores.search, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1007,26 +968,40 @@ class VectorStoresResourceWithStreamingResponse: def __init__(self, vector_stores: VectorStoresResource) -> None: self._vector_stores = vector_stores - self.create = to_streamed_response_wrapper( - vector_stores.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = to_streamed_response_wrapper( - vector_stores.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.update = to_streamed_response_wrapper( - vector_stores.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - vector_stores.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - vector_stores.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.delete, # pyright: ignore[reportDeprecated], + ) ) - self.question_answering = to_streamed_response_wrapper( - vector_stores.question_answering, + self.question_answering = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.question_answering, # pyright: ignore[reportDeprecated], + ) ) - self.search = to_streamed_response_wrapper( - vector_stores.search, + self.search = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + vector_stores.search, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1038,26 +1013,40 @@ class AsyncVectorStoresResourceWithStreamingResponse: def __init__(self, vector_stores: AsyncVectorStoresResource) -> None: self._vector_stores = vector_stores - self.create = async_to_streamed_response_wrapper( - vector_stores.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.create, # pyright: ignore[reportDeprecated], + ) ) - self.retrieve = async_to_streamed_response_wrapper( - vector_stores.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_streamed_response_wrapper( - vector_stores.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - vector_stores.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - vector_stores.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.delete, # pyright: ignore[reportDeprecated], + ) ) - self.question_answering = async_to_streamed_response_wrapper( - vector_stores.question_answering, + self.question_answering = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.question_answering, # pyright: ignore[reportDeprecated], + ) ) - self.search = async_to_streamed_response_wrapper( - vector_stores.search, + self.search = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + vector_stores.search, # pyright: ignore[reportDeprecated], + ) ) @cached_property diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py index 651a8004..87fe66f4 100644 --- a/src/mixedbread/types/__init__.py +++ b/src/mixedbread/types/__init__.py @@ -30,7 +30,6 @@ from .api_key_delete_response import APIKeyDeleteResponse as APIKeyDeleteResponse from .data_source_list_params import DataSourceListParams as DataSourceListParams from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams -from .scored_text_input_chunk import ScoredTextInputChunk as ScoredTextInputChunk from .linear_data_source_param import LinearDataSourceParam as LinearDataSourceParam from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam @@ -43,9 +42,6 @@ from .vector_store_search_params import VectorStoreSearchParams as VectorStoreSearchParams from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams from .data_source_delete_response import DataSourceDeleteResponse as DataSourceDeleteResponse -from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk as ScoredAudioURLInputChunk -from .scored_image_url_input_chunk import ScoredImageURLInputChunk as ScoredImageURLInputChunk -from .scored_video_url_input_chunk import ScoredVideoURLInputChunk as ScoredVideoURLInputChunk from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse from .vector_store_question_answering_params import ( diff --git a/src/mixedbread/types/data_sources/connector_create_params.py b/src/mixedbread/types/data_sources/connector_create_params.py index 43c23c67..185c3894 100644 --- a/src/mixedbread/types/data_sources/connector_create_params.py +++ b/src/mixedbread/types/data_sources/connector_create_params.py @@ -9,8 +9,8 @@ class ConnectorCreateParams(TypedDict, total=False): - vector_store_id: Required[str] - """The ID of the vector store""" + store_id: Required[str] + """The ID of the store""" name: str """The name of the connector""" diff --git a/src/mixedbread/types/data_sources/data_source_connector.py b/src/mixedbread/types/data_sources/data_source_connector.py index bda39237..7534233d 100644 --- a/src/mixedbread/types/data_sources/data_source_connector.py +++ b/src/mixedbread/types/data_sources/data_source_connector.py @@ -19,8 +19,8 @@ class DataSourceConnector(BaseModel): updated_at: datetime """The last update time of the connector""" - vector_store_id: str - """The ID of the vector store""" + store_id: str + """The ID of the store""" data_source_id: str """The ID of the data source""" diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py index 8550ad0a..66126cb9 100644 --- a/src/mixedbread/types/expires_after.py +++ b/src/mixedbread/types/expires_after.py @@ -13,4 +13,4 @@ class ExpiresAfter(BaseModel): """Anchor date for the expiration policy""" days: Optional[int] = None - """Number of days after which the vector store expires""" + """Number of days after which the store expires""" diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py index e7b4bee0..432f29d7 100644 --- a/src/mixedbread/types/expires_after_param.py +++ b/src/mixedbread/types/expires_after_param.py @@ -12,4 +12,4 @@ class ExpiresAfterParam(TypedDict, total=False): """Anchor date for the expiration policy""" days: int - """Number of days after which the vector store expires""" + """Number of days after which the store expires""" diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py deleted file mode 100644 index 59d6423f..00000000 --- a/src/mixedbread/types/scored_audio_url_input_chunk.py +++ /dev/null @@ -1,57 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ScoredAudioURLInputChunk", "AudioURL"] - - -class AudioURL(BaseModel): - url: str - """The audio URL. Can be either a URL or a Data URI.""" - - -class ScoredAudioURLInputChunk(BaseModel): - chunk_index: int - """position of the chunk in a file""" - - mime_type: Optional[str] = None - """mime type of the chunk""" - - generated_metadata: Optional[Dict[str, object]] = None - """metadata of the chunk""" - - model: Optional[str] = None - """model used for this chunk""" - - score: float - """score of the chunk""" - - file_id: str - """file id""" - - filename: str - """filename""" - - vector_store_id: str - """vector store id""" - - metadata: Optional[object] = None - """file metadata""" - - type: Optional[Literal["audio_url"]] = None - """Input type identifier""" - - transcription: Optional[str] = None - """speech recognition (sr) text of the audio""" - - summary: Optional[str] = None - """summary of the audio""" - - audio_url: AudioURL - """The audio input specification.""" - - sampling_rate: int - """The sampling rate of the audio.""" diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py deleted file mode 100644 index 9bd0deb2..00000000 --- a/src/mixedbread/types/scored_image_url_input_chunk.py +++ /dev/null @@ -1,57 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ScoredImageURLInputChunk", "ImageURL"] - - -class ImageURL(BaseModel): - url: str - """The image URL. Can be either a URL or a Data URI.""" - - format: Optional[str] = None - """The image format/mimetype""" - - -class ScoredImageURLInputChunk(BaseModel): - chunk_index: int - """position of the chunk in a file""" - - mime_type: Optional[str] = None - """mime type of the chunk""" - - generated_metadata: Optional[Dict[str, object]] = None - """metadata of the chunk""" - - model: Optional[str] = None - """model used for this chunk""" - - score: float - """score of the chunk""" - - file_id: str - """file id""" - - filename: str - """filename""" - - vector_store_id: str - """vector store id""" - - metadata: Optional[object] = None - """file metadata""" - - type: Optional[Literal["image_url"]] = None - """Input type identifier""" - - ocr_text: Optional[str] = None - """ocr text of the image""" - - summary: Optional[str] = None - """summary of the image""" - - image_url: ImageURL - """The image input specification.""" diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py deleted file mode 100644 index 35f20c06..00000000 --- a/src/mixedbread/types/scored_text_input_chunk.py +++ /dev/null @@ -1,46 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ScoredTextInputChunk"] - - -class ScoredTextInputChunk(BaseModel): - chunk_index: int - """position of the chunk in a file""" - - mime_type: Optional[str] = None - """mime type of the chunk""" - - generated_metadata: Optional[Dict[str, object]] = None - """metadata of the chunk""" - - model: Optional[str] = None - """model used for this chunk""" - - score: float - """score of the chunk""" - - file_id: str - """file id""" - - filename: str - """filename""" - - vector_store_id: str - """vector store id""" - - metadata: Optional[object] = None - """file metadata""" - - type: Optional[Literal["text"]] = None - """Input type identifier""" - - offset: Optional[int] = None - """The offset of the text in the file relative to the start of the file.""" - - text: str - """Text content to process""" diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py deleted file mode 100644 index 78d77359..00000000 --- a/src/mixedbread/types/scored_video_url_input_chunk.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ScoredVideoURLInputChunk", "VideoURL"] - - -class VideoURL(BaseModel): - url: str - """The video URL. Can be either a URL or a Data URI.""" - - -class ScoredVideoURLInputChunk(BaseModel): - chunk_index: int - """position of the chunk in a file""" - - mime_type: Optional[str] = None - """mime type of the chunk""" - - generated_metadata: Optional[Dict[str, object]] = None - """metadata of the chunk""" - - model: Optional[str] = None - """model used for this chunk""" - - score: float - """score of the chunk""" - - file_id: str - """file id""" - - filename: str - """filename""" - - vector_store_id: str - """vector store id""" - - metadata: Optional[object] = None - """file metadata""" - - type: Optional[Literal["video_url"]] = None - """Input type identifier""" - - transcription: Optional[str] = None - """speech recognition (sr) text of the video""" - - summary: Optional[str] = None - """summary of the video""" - - video_url: VideoURL - """The video input specification.""" diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py index 331c9913..cbdeeeb8 100644 --- a/src/mixedbread/types/vector_store.py +++ b/src/mixedbread/types/vector_store.py @@ -50,7 +50,7 @@ class VectorStore(BaseModel): """Counts of files in different states""" expires_after: Optional[ExpiresAfter] = None - """Represents an expiration policy for a vector store.""" + """Represents an expiration policy for a store.""" status: Optional[Literal["expired", "in_progress", "completed"]] = None """Processing status of the vector store""" diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py index f22e2673..713342a5 100644 --- a/src/mixedbread/types/vector_store_create_params.py +++ b/src/mixedbread/types/vector_store_create_params.py @@ -22,7 +22,7 @@ class VectorStoreCreateParams(TypedDict, total=False): """Whether the vector store can be accessed by anyone with valid login credentials""" expires_after: Optional[ExpiresAfterParam] - """Represents an expiration policy for a vector store.""" + """Represents an expiration policy for a store.""" metadata: object """Optional metadata key-value pairs""" diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py index 2a477a87..7b2961f2 100644 --- a/src/mixedbread/types/vector_store_question_answering_response.py +++ b/src/mixedbread/types/vector_store_question_answering_response.py @@ -1,19 +1,213 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Annotated, TypeAlias +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias from .._utils import PropertyInfo from .._models import BaseModel -from .scored_text_input_chunk import ScoredTextInputChunk -from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk -from .scored_image_url_input_chunk import ScoredImageURLInputChunk -from .scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["VectorStoreQuestionAnsweringResponse", "Source"] +__all__ = [ + "VectorStoreQuestionAnsweringResponse", + "Source", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk", + "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL", +] + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["text"]] = None + """Input type identifier""" + + offset: Optional[int] = None + """The offset of the text in the file relative to the start of the file.""" + + text: str + """Text content to process""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + url: str + """The image URL. Can be either a URL or a Data URI.""" + + format: Optional[str] = None + """The image format/mimetype""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["image_url"]] = None + """Input type identifier""" + + ocr_text: Optional[str] = None + """ocr text of the image""" + + summary: Optional[str] = None + """summary of the image""" + + image_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL + """The image input specification.""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + url: str + """The audio URL. Can be either a URL or a Data URI.""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["audio_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the audio""" + + summary: Optional[str] = None + """summary of the audio""" + + audio_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL + """The audio input specification.""" + + sampling_rate: int + """The sampling rate of the audio.""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + url: str + """The video URL. Can be either a URL or a Data URI.""" + + +class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["video_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the video""" + + summary: Optional[str] = None + """summary of the video""" + + video_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL + """The video input specification.""" + Source: TypeAlias = Annotated[ - Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + Union[ + SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk, + SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk, + SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk, + SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk, + ], PropertyInfo(discriminator="type"), ] diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py index 50143c9f..3d49be57 100644 --- a/src/mixedbread/types/vector_store_search_response.py +++ b/src/mixedbread/types/vector_store_search_response.py @@ -1,19 +1,213 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Dict, List, Union, Optional from typing_extensions import Literal, Annotated, TypeAlias from .._utils import PropertyInfo from .._models import BaseModel -from .scored_text_input_chunk import ScoredTextInputChunk -from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk -from .scored_image_url_input_chunk import ScoredImageURLInputChunk -from .scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["VectorStoreSearchResponse", "Data"] +__all__ = [ + "VectorStoreSearchResponse", + "Data", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk", + "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL", +] + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["text"]] = None + """Input type identifier""" + + offset: Optional[int] = None + """The offset of the text in the file relative to the start of the file.""" + + text: str + """Text content to process""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + url: str + """The image URL. Can be either a URL or a Data URI.""" + + format: Optional[str] = None + """The image format/mimetype""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["image_url"]] = None + """Input type identifier""" + + ocr_text: Optional[str] = None + """ocr text of the image""" + + summary: Optional[str] = None + """summary of the image""" + + image_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL + """The image input specification.""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + url: str + """The audio URL. Can be either a URL or a Data URI.""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["audio_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the audio""" + + summary: Optional[str] = None + """summary of the audio""" + + audio_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL + """The audio input specification.""" + + sampling_rate: int + """The sampling rate of the audio.""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + url: str + """The video URL. Can be either a URL or a Data URI.""" + + +class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["video_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the video""" + + summary: Optional[str] = None + """summary of the video""" + + video_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL + """The video input specification.""" + Data: TypeAlias = Annotated[ - Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + Union[ + DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk, + DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk, + DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk, + DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk, + ], PropertyInfo(discriminator="type"), ] diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py index 7bf9e2ed..22545d43 100644 --- a/src/mixedbread/types/vector_store_update_params.py +++ b/src/mixedbread/types/vector_store_update_params.py @@ -12,7 +12,7 @@ class VectorStoreUpdateParams(TypedDict, total=False): name: Optional[str] - """New name for the vector store""" + """New name for the store""" description: Optional[str] """New description""" @@ -21,7 +21,7 @@ class VectorStoreUpdateParams(TypedDict, total=False): """Whether the vector store can be accessed by anyone with valid login credentials""" expires_after: Optional[ExpiresAfterParam] - """Represents an expiration policy for a vector store.""" + """Represents an expiration policy for a store.""" metadata: object """Optional metadata key-value pairs""" diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py index a4ac03c8..9f89685c 100644 --- a/src/mixedbread/types/vector_stores/file_list_params.py +++ b/src/mixedbread/types/vector_stores/file_list_params.py @@ -3,9 +3,8 @@ from __future__ import annotations from typing import List, Union, Iterable, Optional -from typing_extensions import TypeAlias, TypedDict +from typing_extensions import Literal, TypeAlias, TypedDict -from .vector_store_file_status import VectorStoreFileStatus from ..shared_params.search_filter_condition import SearchFilterCondition __all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"] @@ -30,7 +29,7 @@ class FileListParams(TypedDict, total=False): include_total: bool """Whether to include total count in response (expensive operation)""" - statuses: Optional[List[VectorStoreFileStatus]] + statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] """Status to filter by""" metadata_filter: Optional[MetadataFilter] diff --git a/src/mixedbread/types/vector_stores/scored_vector_store_file.py b/src/mixedbread/types/vector_stores/scored_vector_store_file.py index 12d8ddd0..247d7d39 100644 --- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py +++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py @@ -1,21 +1,214 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Dict, List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo from ..._models import BaseModel -from ..scored_text_input_chunk import ScoredTextInputChunk -from .vector_store_file_status import VectorStoreFileStatus -from ..scored_audio_url_input_chunk import ScoredAudioURLInputChunk -from ..scored_image_url_input_chunk import ScoredImageURLInputChunk -from ..scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["ScoredVectorStoreFile", "Chunk"] +__all__ = [ + "ScoredVectorStoreFile", + "Chunk", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk", + "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL", +] + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["text"]] = None + """Input type identifier""" + + offset: Optional[int] = None + """The offset of the text in the file relative to the start of the file.""" + + text: str + """Text content to process""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + url: str + """The image URL. Can be either a URL or a Data URI.""" + + format: Optional[str] = None + """The image format/mimetype""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["image_url"]] = None + """Input type identifier""" + + ocr_text: Optional[str] = None + """ocr text of the image""" + + summary: Optional[str] = None + """summary of the image""" + + image_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL + """The image input specification.""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + url: str + """The audio URL. Can be either a URL or a Data URI.""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["audio_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the audio""" + + summary: Optional[str] = None + """summary of the audio""" + + audio_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL + """The audio input specification.""" + + sampling_rate: int + """The sampling rate of the audio.""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + url: str + """The video URL. Can be either a URL or a Data URI.""" + + +class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + generated_metadata: Optional[Dict[str, object]] = None + """metadata of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["video_url"]] = None + """Input type identifier""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the video""" + + summary: Optional[str] = None + """summary of the video""" + + video_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL + """The video input specification.""" + Chunk: TypeAlias = Annotated[ - Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + Union[ + ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk, + ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk, + ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk, + ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk, + ], PropertyInfo(discriminator="type"), ] @@ -30,17 +223,17 @@ class ScoredVectorStoreFile(BaseModel): metadata: Optional[object] = None """Optional file metadata""" - status: Optional[VectorStoreFileStatus] = None + status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None """Processing status of the file""" last_error: Optional[object] = None """Last error message if processing failed""" vector_store_id: str - """ID of the containing vector store""" + """ID of the containing store""" created_at: datetime - """Timestamp of vector store file creation""" + """Timestamp of store file creation""" version: Optional[int] = None """Version number of the file""" diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py index e9c535d4..89f64d8a 100644 --- a/src/mixedbread/types/vector_stores/vector_store_file.py +++ b/src/mixedbread/types/vector_stores/vector_store_file.py @@ -6,7 +6,6 @@ from ..._utils import PropertyInfo from ..._models import BaseModel -from .vector_store_file_status import VectorStoreFileStatus __all__ = [ "VectorStoreFile", @@ -159,17 +158,17 @@ class VectorStoreFile(BaseModel): metadata: Optional[object] = None """Optional file metadata""" - status: Optional[VectorStoreFileStatus] = None + status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None """Processing status of the file""" last_error: Optional[object] = None """Last error message if processing failed""" vector_store_id: str - """ID of the containing vector store""" + """ID of the containing store""" created_at: datetime - """Timestamp of vector store file creation""" + """Timestamp of store file creation""" version: Optional[int] = None """Version number of the file""" diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py index 23c313d4..20d3847e 100644 --- a/tests/api_resources/data_sources/test_connectors.py +++ b/tests/api_resources/data_sources/test_connectors.py @@ -25,7 +25,7 @@ class TestConnectors: def test_method_create(self, client: Mixedbread) -> None: connector = client.data_sources.connectors.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) assert_matches_type(DataSourceConnector, connector, path=["response"]) @@ -33,7 +33,7 @@ def test_method_create(self, client: Mixedbread) -> None: def test_method_create_with_all_params(self, client: Mixedbread) -> None: connector = client.data_sources.connectors.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", name="name", trigger_sync=True, metadata={}, @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None: def test_raw_response_create(self, client: Mixedbread) -> None: response = client.data_sources.connectors.with_raw_response.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None: def test_streaming_response_create(self, client: Mixedbread) -> None: with client.data_sources.connectors.with_streaming_response.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,7 +72,7 @@ def test_path_params_create(self, client: Mixedbread) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"): client.data_sources.connectors.with_raw_response.create( data_source_id="", - vector_store_id="vector_store_id", + store_id="store_id", ) @parametrize @@ -290,7 +290,7 @@ class TestAsyncConnectors: async def test_method_create(self, async_client: AsyncMixedbread) -> None: connector = await async_client.data_sources.connectors.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) assert_matches_type(DataSourceConnector, connector, path=["response"]) @@ -298,7 +298,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None: async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None: connector = await async_client.data_sources.connectors.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", name="name", trigger_sync=True, metadata={}, @@ -310,7 +310,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: response = await async_client.data_sources.connectors.with_raw_response.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) assert response.is_closed is True @@ -322,7 +322,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None: async with async_client.data_sources.connectors.with_streaming_response.create( data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_id="vector_store_id", + store_id="store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,7 +337,7 @@ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"): await async_client.data_sources.connectors.with_raw_response.create( data_source_id="", - vector_store_id="vector_store_id", + store_id="store_id", ) @parametrize diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index 61cbf6c2..5b0c443a 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -17,6 +17,8 @@ ) from mixedbread.pagination import SyncCursor, AsyncCursor +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,27 +27,32 @@ class TestVectorStores: @parametrize def test_method_create(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.create() + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.create() + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.create( - name="Technical Documentation", - description="Contains technical specifications and guides", - is_public=False, - expires_after={ - "anchor": "last_active_at", - "days": 0, - }, - metadata={}, - file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.create( + name="Technical Documentation", + description="Contains technical specifications and guides", + is_public=False, + expires_after={ + "anchor": "last_active_at", + "days": 0, + }, + metadata={}, + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_raw_response_create(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.create() + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,27 +61,31 @@ def test_raw_response_create(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_create(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_retrieve(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.retrieve( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.retrieve( + "vector_store_identifier", + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.retrieve( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.retrieve( + "vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -83,53 +94,60 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_retrieve(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.retrieve( - "vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.retrieve( + "vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.with_raw_response.retrieve( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.with_raw_response.retrieve( + "", + ) @parametrize def test_method_update(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.update( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.update( + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.update( - vector_store_identifier="vector_store_identifier", - name="x", - description="description", - is_public=True, - expires_after={ - "anchor": "last_active_at", - "days": 0, - }, - metadata={}, - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.update( + vector_store_identifier="vector_store_identifier", + name="x", + description="description", + is_public=True, + expires_after={ + "anchor": "last_active_at", + "days": 0, + }, + metadata={}, + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_raw_response_update(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.update( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.update( + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -138,45 +156,52 @@ def test_raw_response_update(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_update(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.update( - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.update( + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_update(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.with_raw_response.update( - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.with_raw_response.update( + vector_store_identifier="", + ) @parametrize def test_method_list(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.list() + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.list() + assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.list( - limit=10, - after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - include_total=False, - q="x", - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.list( + limit=10, + after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + include_total=False, + q="x", + ) + assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"]) @parametrize def test_raw_response_list(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -185,27 +210,31 @@ def test_raw_response_list(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_list(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.delete( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.delete( + "vector_store_identifier", + ) + assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) @parametrize def test_raw_response_delete(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.delete( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.delete( + "vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -214,98 +243,105 @@ def test_raw_response_delete(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_delete(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.delete( - "vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.delete( + "vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.with_raw_response.delete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.with_raw_response.delete( + "", + ) @parametrize def test_method_question_answering(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.question_answering( - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.question_answering( + vector_store_identifiers=["string"], + ) + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) @parametrize def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.question_answering( - query="x", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "apply_search_rules": True, - }, - stream=True, - qa_options={ - "cite": True, - "multimodal": True, - }, - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.question_answering( + query="x", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "apply_search_rules": True, + }, + stream=True, + qa_options={ + "cite": True, + "multimodal": True, + }, + ) + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) @parametrize def test_raw_response_question_answering(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.question_answering( - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.question_answering( + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -314,86 +350,92 @@ def test_raw_response_question_answering(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_question_answering(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.question_answering( - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.question_answering( + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_search(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) @parametrize def test_method_search_with_all_params(self, client: Mixedbread) -> None: - vector_store = client.vector_stores.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "apply_search_rules": True, - }, - ) + with pytest.warns(DeprecationWarning): + vector_store = client.vector_stores.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "apply_search_rules": True, + }, + ) + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) @parametrize def test_raw_response_search(self, client: Mixedbread) -> None: - response = client.vector_stores.with_raw_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.with_raw_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -402,15 +444,16 @@ def test_raw_response_search(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_search(self, client: Mixedbread) -> None: - with client.vector_stores.with_streaming_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.with_streaming_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = response.parse() - assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) + vector_store = response.parse() + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @@ -422,27 +465,32 @@ class TestAsyncVectorStores: @parametrize async def test_method_create(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.create() + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.create() + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.create( - name="Technical Documentation", - description="Contains technical specifications and guides", - is_public=False, - expires_after={ - "anchor": "last_active_at", - "days": 0, - }, - metadata={}, - file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.create( + name="Technical Documentation", + description="Contains technical specifications and guides", + is_public=False, + expires_after={ + "anchor": "last_active_at", + "days": 0, + }, + metadata={}, + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.create() + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -451,27 +499,31 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.retrieve( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.retrieve( + "vector_store_identifier", + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.retrieve( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.retrieve( + "vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -480,53 +532,60 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.retrieve( - "vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.retrieve( + "vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.with_raw_response.retrieve( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.with_raw_response.retrieve( + "", + ) @parametrize async def test_method_update(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.update( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.update( + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.update( - vector_store_identifier="vector_store_identifier", - name="x", - description="description", - is_public=True, - expires_after={ - "anchor": "last_active_at", - "days": 0, - }, - metadata={}, - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.update( + vector_store_identifier="vector_store_identifier", + name="x", + description="description", + is_public=True, + expires_after={ + "anchor": "last_active_at", + "days": 0, + }, + metadata={}, + ) + assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.update( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.update( + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -535,45 +594,52 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.update( - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.update( + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(VectorStore, vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(VectorStore, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_update(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.with_raw_response.update( - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.with_raw_response.update( + vector_store_identifier="", + ) @parametrize async def test_method_list(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.list() + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.list() + assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.list( - limit=10, - after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - include_total=False, - q="x", - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.list( + limit=10, + after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + include_total=False, + q="x", + ) + assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -582,27 +648,31 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.delete( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.delete( + "vector_store_identifier", + ) + assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.delete( - "vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.delete( + "vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -611,98 +681,105 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.delete( - "vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.delete( + "vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.with_raw_response.delete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.with_raw_response.delete( + "", + ) @parametrize async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.question_answering( - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.question_answering( + vector_store_identifiers=["string"], + ) + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) @parametrize async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.question_answering( - query="x", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "apply_search_rules": True, - }, - stream=True, - qa_options={ - "cite": True, - "multimodal": True, - }, - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.question_answering( + query="x", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "apply_search_rules": True, + }, + stream=True, + qa_options={ + "cite": True, + "multimodal": True, + }, + ) + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) @parametrize async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.question_answering( - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.question_answering( + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -711,86 +788,92 @@ async def test_raw_response_question_answering(self, async_client: AsyncMixedbre @parametrize async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.question_answering( - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.question_answering( + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - vector_store = await response.parse() - assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) + vector_store = await response.parse() + assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_search(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) @parametrize async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None: - vector_store = await async_client.vector_stores.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "apply_search_rules": True, - }, - ) + with pytest.warns(DeprecationWarning): + vector_store = await async_client.vector_stores.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "apply_search_rules": True, + }, + ) + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) @parametrize async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.with_raw_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.with_raw_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -799,14 +882,15 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.with_streaming_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - vector_store = await response.parse() - assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.with_streaming_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + vector_store = await response.parse() + assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py index eb15c4b6..21e79500 100644 --- a/tests/api_resources/vector_stores/test_files.py +++ b/tests/api_resources/vector_stores/test_files.py @@ -16,6 +16,8 @@ FileSearchResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,31 +26,36 @@ class TestFiles: @parametrize def test_method_create(self, client: Mixedbread) -> None: - file = client.vector_stores.files.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Mixedbread) -> None: - file = client.vector_stores.files.create( - vector_store_identifier="vector_store_identifier", - metadata={}, - experimental={ - "parsing_strategy": "fast", - "contextualization": True, - }, - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.create( + vector_store_identifier="vector_store_identifier", + metadata={}, + experimental={ + "parsing_strategy": "fast", + "contextualization": True, + }, + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize def test_raw_response_create(self, client: Mixedbread) -> None: - response = client.vector_stores.files.with_raw_response.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.files.with_raw_response.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,51 +64,58 @@ def test_raw_response_create(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_create(self, client: Mixedbread) -> None: - with client.vector_stores.files.with_streaming_response.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.files.with_streaming_response.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = response.parse() - assert_matches_type(VectorStoreFile, file, path=["response"]) + file = response.parse() + assert_matches_type(VectorStoreFile, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.files.with_raw_response.create( - vector_store_identifier="", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.files.with_raw_response.create( + vector_store_identifier="", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) @parametrize def test_method_retrieve(self, client: Mixedbread) -> None: - file = client.vector_stores.files.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None: - file = client.vector_stores.files.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - return_chunks=True, - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + return_chunks=True, + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Mixedbread) -> None: - response = client.vector_stores.files.with_raw_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.files.with_raw_response.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,96 +124,103 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_retrieve(self, client: Mixedbread) -> None: - with client.vector_stores.files.with_streaming_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.files.with_streaming_response.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = response.parse() - assert_matches_type(VectorStoreFile, file, path=["response"]) + file = response.parse() + assert_matches_type(VectorStoreFile, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.files.with_raw_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.files.with_raw_response.retrieve( + file_id="file_id", + vector_store_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): + client.vector_stores.files.with_raw_response.retrieve( + file_id="", + vector_store_identifier="vector_store_identifier", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): - client.vector_stores.files.with_raw_response.retrieve( - file_id="", + @parametrize + def test_method_list(self, client: Mixedbread) -> None: + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.list( vector_store_identifier="vector_store_identifier", ) - @parametrize - def test_method_list(self, client: Mixedbread) -> None: - file = client.vector_stores.files.list( - vector_store_identifier="vector_store_identifier", - ) assert_matches_type(FileListResponse, file, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Mixedbread) -> None: - file = client.vector_stores.files.list( - vector_store_identifier="vector_store_identifier", - limit=10, - after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - include_total=False, - statuses=["pending"], - metadata_filter={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.list( + vector_store_identifier="vector_store_identifier", + limit=10, + after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + include_total=False, + statuses=["pending"], + metadata_filter={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + ) + assert_matches_type(FileListResponse, file, path=["response"]) @parametrize def test_raw_response_list(self, client: Mixedbread) -> None: - response = client.vector_stores.files.with_raw_response.list( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.files.with_raw_response.list( + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,40 +229,45 @@ def test_raw_response_list(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_list(self, client: Mixedbread) -> None: - with client.vector_stores.files.with_streaming_response.list( - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.files.with_streaming_response.list( + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = response.parse() - assert_matches_type(FileListResponse, file, path=["response"]) + file = response.parse() + assert_matches_type(FileListResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.files.with_raw_response.list( - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.files.with_raw_response.list( + vector_store_identifier="", + ) @parametrize def test_method_delete(self, client: Mixedbread) -> None: - file = client.vector_stores.files.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(FileDeleteResponse, file, path=["response"]) @parametrize def test_raw_response_delete(self, client: Mixedbread) -> None: - response = client.vector_stores.files.with_raw_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.files.with_raw_response.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -250,105 +276,112 @@ def test_raw_response_delete(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_delete(self, client: Mixedbread) -> None: - with client.vector_stores.files.with_streaming_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.files.with_streaming_response.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = response.parse() - assert_matches_type(FileDeleteResponse, file, path=["response"]) + file = response.parse() + assert_matches_type(FileDeleteResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Mixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - client.vector_stores.files.with_raw_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): - client.vector_stores.files.with_raw_response.delete( - file_id="", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + client.vector_stores.files.with_raw_response.delete( + file_id="file_id", + vector_store_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): + client.vector_stores.files.with_raw_response.delete( + file_id="", + vector_store_identifier="vector_store_identifier", + ) @parametrize def test_method_search(self, client: Mixedbread) -> None: - file = client.vector_stores.files.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) + assert_matches_type(FileSearchResponse, file, path=["response"]) @parametrize def test_method_search_with_all_params(self, client: Mixedbread) -> None: - file = client.vector_stores.files.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "return_chunks": True, - "chunks_per_file": 0, - "apply_search_rules": True, - }, - ) + with pytest.warns(DeprecationWarning): + file = client.vector_stores.files.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "return_chunks": True, + "chunks_per_file": 0, + "apply_search_rules": True, + }, + ) + assert_matches_type(FileSearchResponse, file, path=["response"]) @parametrize def test_raw_response_search(self, client: Mixedbread) -> None: - response = client.vector_stores.files.with_raw_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = client.vector_stores.files.with_raw_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -357,15 +390,16 @@ def test_raw_response_search(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_search(self, client: Mixedbread) -> None: - with client.vector_stores.files.with_streaming_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.vector_stores.files.with_streaming_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = response.parse() - assert_matches_type(FileSearchResponse, file, path=["response"]) + file = response.parse() + assert_matches_type(FileSearchResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True @@ -377,31 +411,36 @@ class TestAsyncFiles: @parametrize async def test_method_create(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.create( - vector_store_identifier="vector_store_identifier", - metadata={}, - experimental={ - "parsing_strategy": "fast", - "contextualization": True, - }, - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.create( + vector_store_identifier="vector_store_identifier", + metadata={}, + experimental={ + "parsing_strategy": "fast", + "contextualization": True, + }, + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.files.with_raw_response.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.files.with_raw_response.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -410,51 +449,58 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.files.with_streaming_response.create( - vector_store_identifier="vector_store_identifier", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.files.with_streaming_response.create( + vector_store_identifier="vector_store_identifier", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = await response.parse() - assert_matches_type(VectorStoreFile, file, path=["response"]) + file = await response.parse() + assert_matches_type(VectorStoreFile, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.files.with_raw_response.create( - vector_store_identifier="", - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.files.with_raw_response.create( + vector_store_identifier="", + file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) @parametrize async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - return_chunks=True, - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + return_chunks=True, + ) + assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.files.with_raw_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.files.with_raw_response.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -463,96 +509,103 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.files.with_streaming_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.files.with_streaming_response.retrieve( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = await response.parse() - assert_matches_type(VectorStoreFile, file, path=["response"]) + file = await response.parse() + assert_matches_type(VectorStoreFile, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.files.with_raw_response.retrieve( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.files.with_raw_response.retrieve( + file_id="file_id", + vector_store_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): + await async_client.vector_stores.files.with_raw_response.retrieve( + file_id="", + vector_store_identifier="vector_store_identifier", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): - await async_client.vector_stores.files.with_raw_response.retrieve( - file_id="", + @parametrize + async def test_method_list(self, async_client: AsyncMixedbread) -> None: + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.list( vector_store_identifier="vector_store_identifier", ) - @parametrize - async def test_method_list(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.list( - vector_store_identifier="vector_store_identifier", - ) assert_matches_type(FileListResponse, file, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.list( - vector_store_identifier="vector_store_identifier", - limit=10, - after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", - include_total=False, - statuses=["pending"], - metadata_filter={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.list( + vector_store_identifier="vector_store_identifier", + limit=10, + after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==", + include_total=False, + statuses=["pending"], + metadata_filter={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + ) + assert_matches_type(FileListResponse, file, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.files.with_raw_response.list( - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.files.with_raw_response.list( + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -561,40 +614,45 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.files.with_streaming_response.list( - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.files.with_streaming_response.list( + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = await response.parse() - assert_matches_type(FileListResponse, file, path=["response"]) + file = await response.parse() + assert_matches_type(FileListResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.files.with_raw_response.list( - vector_store_identifier="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.files.with_raw_response.list( + vector_store_identifier="", + ) @parametrize async def test_method_delete(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) + assert_matches_type(FileDeleteResponse, file, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.files.with_raw_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.files.with_raw_response.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -603,105 +661,112 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.files.with_streaming_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="vector_store_identifier", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.files.with_streaming_response.delete( + file_id="file_id", + vector_store_identifier="vector_store_identifier", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - file = await response.parse() - assert_matches_type(FileDeleteResponse, file, path=["response"]) + file = await response.parse() + assert_matches_type(FileDeleteResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" - ): - await async_client.vector_stores.files.with_raw_response.delete( - file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - vector_store_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): - await async_client.vector_stores.files.with_raw_response.delete( - file_id="", - vector_store_identifier="vector_store_identifier", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''" + ): + await async_client.vector_stores.files.with_raw_response.delete( + file_id="file_id", + vector_store_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): + await async_client.vector_stores.files.with_raw_response.delete( + file_id="", + vector_store_identifier="vector_store_identifier", + ) @parametrize async def test_method_search(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) + assert_matches_type(FileSearchResponse, file, path=["response"]) @parametrize async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None: - file = await async_client.vector_stores.files.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - top_k=1, - filters={ - "all": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "any": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - "none": [ - { - "key": "price", - "value": "100", - "operator": "gt", - }, - { - "key": "color", - "value": "red", - "operator": "eq", - }, - ], - }, - file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], - search_options={ - "score_threshold": 0, - "rewrite_query": True, - "rerank": True, - "return_metadata": True, - "return_chunks": True, - "chunks_per_file": 0, - "apply_search_rules": True, - }, - ) + with pytest.warns(DeprecationWarning): + file = await async_client.vector_stores.files.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + top_k=1, + filters={ + "all": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "any": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + "none": [ + { + "key": "price", + "value": "100", + "operator": "gt", + }, + { + "key": "color", + "value": "red", + "operator": "eq", + }, + ], + }, + file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"], + search_options={ + "score_threshold": 0, + "rewrite_query": True, + "rerank": True, + "return_metadata": True, + "return_chunks": True, + "chunks_per_file": 0, + "apply_search_rules": True, + }, + ) + assert_matches_type(FileSearchResponse, file, path=["response"]) @parametrize async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None: - response = await async_client.vector_stores.files.with_raw_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.vector_stores.files.with_raw_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -710,14 +775,15 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None: @parametrize async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None: - async with async_client.vector_stores.files.with_streaming_response.search( - query="how to configure SSL", - vector_store_identifiers=["string"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - file = await response.parse() - assert_matches_type(FileSearchResponse, file, path=["response"]) + with pytest.warns(DeprecationWarning): + async with async_client.vector_stores.files.with_streaming_response.search( + query="how to configure SSL", + vector_store_identifiers=["string"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + file = await response.parse() + assert_matches_type(FileSearchResponse, file, path=["response"]) assert cast(Any, response.is_closed) is True From a811cebccaf116db7e4ed1fc81fb9e383b7b2c9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:28:12 +0000 Subject: [PATCH 10/15] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc469a36..add3762c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-badb544207d1a5cbf542ecf662d4d4f085dd7d402c367620eeda31c2949c2f79.yml -openapi_spec_hash: 27c151b834d6c5a5dc72e8f10c861840 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml +openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873 config_hash: fef0ea78daf11093ff503919baae5ec0 From 7424da1c397012d5ceee609660272ccd95df20ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:20:04 +0000 Subject: [PATCH 11/15] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index add3762c..4d54820a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873 -config_hash: fef0ea78daf11093ff503919baae5ec0 +config_hash: 5947672ad343483af4cc320558877dd1 From 0031d74491330b7ecbd7965ff88837e1da71fb22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:22:24 +0000 Subject: [PATCH 12/15] feat(api): update via SDK Studio --- .stats.yml | 2 +- api.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4d54820a..193855ae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873 -config_hash: 5947672ad343483af4cc320558877dd1 +config_hash: a2549e1f1923904c8cee4ea4f5ff58e1 diff --git a/api.md b/api.md index 1f6ce1dd..2a054ea2 100644 --- a/api.md +++ b/api.md @@ -31,6 +31,10 @@ Types: ```python from mixedbread.types import ( ExpiresAfter, + ScoredAudioURLInputChunk, + ScoredImageURLInputChunk, + ScoredTextInputChunk, + ScoredVideoURLInputChunk, VectorStore, VectorStoreChunkSearchOptions, VectorStoreDeleteResponse, From 6c2f07274a337318070c3fb7b09d66677962d0ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:22:45 +0000 Subject: [PATCH 13/15] release: 0.31.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- src/mixedbread/_version.py | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 554e34bb..f81bf992 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.30.0" + ".": "0.31.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 75606cdb..d0f35722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.31.0 (2025-10-01) + +Full Changelog: [v0.30.0...v0.31.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.30.0...v0.31.0) + +### Features + +* **api:** api update ([26ce1c1](https://github.com/mixedbread-ai/mixedbread-python/commit/26ce1c1583f2eef287cdf5383398326d755428c4)) +* **api:** api update ([91f4c77](https://github.com/mixedbread-ai/mixedbread-python/commit/91f4c77e0679065d375bb70b6f4618683aa7d77d)) +* **api:** api update ([cea8399](https://github.com/mixedbread-ai/mixedbread-python/commit/cea83993a41231f4351dba325e798122660dabc3)) +* **api:** update via SDK Studio ([0031d74](https://github.com/mixedbread-ai/mixedbread-python/commit/0031d74491330b7ecbd7965ff88837e1da71fb22)) + + +### Chores + +* do not install brew dependencies in ./scripts/bootstrap by default ([3dab10e](https://github.com/mixedbread-ai/mixedbread-python/commit/3dab10eca037653e15743682f304859d491202aa)) +* **internal:** improve examples ([3edbd38](https://github.com/mixedbread-ai/mixedbread-python/commit/3edbd387ef7fa62afc255a80b9ac0a385f2cef29)) +* **internal:** update pydantic dependency ([90fe5a9](https://github.com/mixedbread-ai/mixedbread-python/commit/90fe5a9b7626b6fefeb720058ce08eee191687eb)) +* **internal:** use some smaller example values ([7566937](https://github.com/mixedbread-ai/mixedbread-python/commit/7566937f6cc6e0d777294adb70963f06023d4358)) +* **types:** change optional parameter type from NotGiven to Omit ([402891b](https://github.com/mixedbread-ai/mixedbread-python/commit/402891b4bc2a09b774827338509bd730747d210c)) + ## 0.30.0 (2025-09-08) Full Changelog: [v0.29.0...v0.30.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.29.0...v0.30.0) diff --git a/pyproject.toml b/pyproject.toml index 897de283..e3bc88a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "0.30.0" +version = "0.31.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 341d4e2a..fae94c2c 100644 --- a/src/mixedbread/_version.py +++ b/src/mixedbread/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "mixedbread" -__version__ = "0.30.0" # x-release-please-version +__version__ = "0.31.0" # x-release-please-version From e178baadfaeffec3a2dbe61b5cbede74d4ecc887 Mon Sep 17 00:00:00 2001 From: Joel Dierkes Date: Wed, 1 Oct 2025 12:27:17 +0200 Subject: [PATCH 14/15] chore: update --- src/mixedbread/resources/parsing/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py index d1d7b51f..aab7986d 100644 --- a/src/mixedbread/resources/parsing/jobs.py +++ b/src/mixedbread/resources/parsing/jobs.py @@ -9,7 +9,7 @@ import httpx from ...lib import polling -from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given, NOT_GIVEN from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource From 11ca612666462525976fe5669df563fb36733067 Mon Sep 17 00:00:00 2001 From: Joel Dierkes Date: Wed, 1 Oct 2025 12:29:19 +0200 Subject: [PATCH 15/15] chore: update --- src/mixedbread/resources/parsing/jobs.py | 58 +++++++++---------- .../resources/vector_stores/files.py | 48 +++++++-------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py index aab7986d..01715572 100644 --- a/src/mixedbread/resources/parsing/jobs.py +++ b/src/mixedbread/resources/parsing/jobs.py @@ -9,7 +9,7 @@ import httpx from ...lib import polling -from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given, NOT_GIVEN +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -303,8 +303,8 @@ def poll( self, job_id: str, *, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """ @@ -329,7 +329,7 @@ def create_and_poll( self, *, file_id: str, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -347,10 +347,10 @@ def create_and_poll( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """ @@ -383,7 +383,7 @@ def upload( self, *, file: FileTypes, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -401,8 +401,8 @@ def upload( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """Upload a file to the `files` API and then create a parsing job for it. @@ -422,7 +422,7 @@ def upload_and_poll( self, *, file: FileTypes, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -440,9 +440,9 @@ def upload_and_poll( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """Upload a file and create a parsing job, then poll until processing is complete.""" @@ -727,8 +727,8 @@ async def poll( self, job_id: str, *, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """ @@ -753,7 +753,7 @@ async def create_and_poll( self, *, file_id: str, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -771,10 +771,10 @@ async def create_and_poll( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """ @@ -807,7 +807,7 @@ async def upload( self, *, file: FileTypes, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -825,8 +825,8 @@ async def upload( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """Upload a file to the `files` API and then create a parsing job for it. @@ -846,7 +846,7 @@ async def upload_and_poll( self, *, file: FileTypes, - chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN, + chunking_strategy: Literal["page"] | NotGiven = not_given, element_types: Optional[ List[ Literal[ @@ -864,9 +864,9 @@ async def upload_and_poll( ] ] ] - | NotGiven = NOT_GIVEN, - return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, + | NotGiven = not_given, + return_format: Literal["html", "markdown", "plain"] | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, **kwargs: Any, ) -> ParsingJob: """Upload a file and create a parsing job, then poll until processing is complete.""" diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py index fc2cd73f..e3d1776e 100644 --- a/src/mixedbread/resources/vector_stores/files.py +++ b/src/mixedbread/resources/vector_stores/files.py @@ -332,8 +332,8 @@ def poll( file_id: str, *, vector_store_identifier: str, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """ @@ -360,10 +360,10 @@ def create_and_poll( file_id: str, *, vector_store_identifier: str, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """ @@ -393,8 +393,8 @@ def upload( *, vector_store_identifier: str, file: FileTypes, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """Upload a file to the `files` API and then attach it to the given vector store. @@ -415,10 +415,10 @@ def upload_and_poll( *, vector_store_identifier: str, file: FileTypes, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """Add a file to a vector store and poll until processing is complete.""" @@ -738,8 +738,8 @@ async def poll( file_id: str, *, vector_store_identifier: str, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """ @@ -766,10 +766,10 @@ async def create_and_poll( file_id: str, *, vector_store_identifier: str, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """ @@ -803,8 +803,8 @@ async def upload( *, vector_store_identifier: str, file: FileTypes, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """Upload a file to the `files` API and then attach it to the given vector store. @@ -825,10 +825,10 @@ async def upload_and_poll( *, vector_store_identifier: str, file: FileTypes, - metadata: Optional[object] | NotGiven = NOT_GIVEN, - experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN, - poll_interval_ms: int | NotGiven = NOT_GIVEN, - poll_timeout_ms: float | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = not_given, + experimental: file_create_params.Experimental | NotGiven = not_given, + poll_interval_ms: int | NotGiven = not_given, + poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> VectorStoreFile: """Add a file to a vector store and poll until processing is complete."""