diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 36b2affb..f9963500 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.34" + ".": "0.1.0-alpha.35" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index eb0b804e..d87685dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e49fa63938c7d1a40e291d7b3f486a09b88afbbecb89bb42e4f06438a1ea9f21.yml -openapi_spec_hash: 09cf222f034cb196974b7c7c131cc860 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml +openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e config_hash: 52e7472faf7b81b5fda98bd67bd7d0d9 diff --git a/CHANGELOG.md b/CHANGELOG.md index 672cc443..f10d92c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.35 (2025-03-29) + +Full Changelog: [v0.1.0-alpha.34...v0.1.0-alpha.35](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.1.0-alpha.34...v0.1.0-alpha.35) + +### Features + +* **api:** update via SDK Studio ([#160](https://github.com/mixedbread-ai/mixedbread-python/issues/160)) ([6446f27](https://github.com/mixedbread-ai/mixedbread-python/commit/6446f276404b983c716d946737d9cc40ed5751ae)) + ## 0.1.0-alpha.34 (2025-03-28) Full Changelog: [v0.1.0-alpha.33...v0.1.0-alpha.34](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.1.0-alpha.33...v0.1.0-alpha.34) diff --git a/pyproject.toml b/pyproject.toml index ab490eae..404a177d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "0.1.0-alpha.34" +version = "0.1.0-alpha.35" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py index 80110af9..e2ce4c5f 100644 --- a/src/mixedbread/_client.py +++ b/src/mixedbread/_client.py @@ -242,7 +242,7 @@ def embed( self, *, model: str, - input: client_embed_params.Input, + input: List[str], dimensions: Optional[int] | NotGiven = NOT_GIVEN, prompt: Optional[str] | NotGiven = NOT_GIVEN, normalized: bool | NotGiven = NOT_GIVEN, @@ -277,7 +277,8 @@ def embed( normalized: Whether to normalize the embeddings. - encoding_format: The encoding format of the embeddings. + encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of + formats. extra_headers: Send extra headers @@ -598,7 +599,7 @@ async def embed( self, *, model: str, - input: client_embed_params.Input, + input: List[str], dimensions: Optional[int] | NotGiven = NOT_GIVEN, prompt: Optional[str] | NotGiven = NOT_GIVEN, normalized: bool | NotGiven = NOT_GIVEN, @@ -633,7 +634,8 @@ async def embed( normalized: Whether to normalize the embeddings. - encoding_format: The encoding format of the embeddings. + encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of + formats. extra_headers: Send extra headers diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 0304e57a..cf408422 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.1.0-alpha.34" # x-release-please-version +__version__ = "0.1.0-alpha.35" # x-release-please-version diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py index 1b128973..d7390eda 100644 --- a/src/mixedbread/resources/embeddings.py +++ b/src/mixedbread/resources/embeddings.py @@ -51,7 +51,7 @@ def create( self, *, model: str, - input: embedding_create_params.Input, + input: List[str], dimensions: Optional[int] | NotGiven = NOT_GIVEN, prompt: Optional[str] | NotGiven = NOT_GIVEN, normalized: bool | NotGiven = NOT_GIVEN, @@ -86,7 +86,8 @@ def create( normalized: Whether to normalize the embeddings. - encoding_format: The encoding format of the embeddings. + encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of + formats. extra_headers: Send extra headers @@ -140,7 +141,7 @@ async def create( self, *, model: str, - input: embedding_create_params.Input, + input: List[str], dimensions: Optional[int] | NotGiven = NOT_GIVEN, prompt: Optional[str] | NotGiven = NOT_GIVEN, normalized: bool | NotGiven = NOT_GIVEN, @@ -175,7 +176,8 @@ async def create( normalized: Whether to normalize the embeddings. - encoding_format: The encoding format of the embeddings. + encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of + formats. extra_headers: Send extra headers diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py index cacd55a6..2d1b896f 100644 --- a/src/mixedbread/resources/extractions/content.py +++ b/src/mixedbread/resources/extractions/content.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Dict + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -48,7 +50,7 @@ def create( self, *, content: str, - json_schema: object, + json_schema: Dict[str, object], # 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, @@ -116,7 +118,7 @@ async def create( self, *, content: str, - json_schema: object, + json_schema: Dict[str, object], # 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, diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py index 3abc64f9..d127824c 100644 --- a/src/mixedbread/resources/extractions/jobs.py +++ b/src/mixedbread/resources/extractions/jobs.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Dict + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -48,7 +50,7 @@ def create( self, *, file_id: str, - json_schema: object, + json_schema: Dict[str, object], # 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, @@ -155,7 +157,7 @@ async def create( self, *, file_id: str, - json_schema: object, + json_schema: Dict[str, object], # 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, diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py index 60ee00a5..d92032fa 100644 --- a/src/mixedbread/resources/extractions/schema.py +++ b/src/mixedbread/resources/extractions/schema.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Dict + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -87,7 +89,7 @@ def create( def enhance( self, *, - json_schema: object, + json_schema: Dict[str, object], # 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, @@ -125,7 +127,7 @@ def enhance( def validate( self, *, - json_schema: object, + json_schema: Dict[str, object], # 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, @@ -222,7 +224,7 @@ async def create( async def enhance( self, *, - json_schema: object, + json_schema: Dict[str, object], # 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, @@ -260,7 +262,7 @@ async def enhance( async def validate( self, *, - json_schema: object, + json_schema: Dict[str, object], # 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, diff --git a/src/mixedbread/types/client_embed_params.py b/src/mixedbread/types/client_embed_params.py index e216a9f7..ec6a6e8b 100644 --- a/src/mixedbread/types/client_embed_params.py +++ b/src/mixedbread/types/client_embed_params.py @@ -3,16 +3,16 @@ from __future__ import annotations from typing import List, Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["ClientEmbedParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"] +__all__ = ["ClientEmbedParams"] class ClientEmbedParams(TypedDict, total=False): model: Required[str] """The model to use for creating embeddings.""" - input: Required[Input] + input: Required[List[str]] """The input to create embeddings for.""" dimensions: Optional[int] @@ -28,28 +28,7 @@ class ClientEmbedParams(TypedDict, total=False): Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"], List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]], ] - """The encoding format of the embeddings.""" + """The encoding format(s) of the embeddings. - -class InputImageURLInputImage(TypedDict, total=False): - url: Required[str] - """The image URL. Can be either a URL or a Data URI.""" - - -class InputImageURLInput(TypedDict, total=False): - type: Literal["image_url"] - """Input type identifier""" - - image: Required[InputImageURLInputImage] - """The image input specification.""" - - -class InputTextInput(TypedDict, total=False): - type: Literal["text"] - """Input type identifier""" - - text: Required[str] - """Text content to process""" - - -Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput] + Can be a single format or a list of formats. + """ diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py index ad8cd3f0..19fd8136 100644 --- a/src/mixedbread/types/embedding.py +++ b/src/mixedbread/types/embedding.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union +from typing import List, Union, Optional from typing_extensions import Literal from .._models import BaseModel @@ -15,5 +15,5 @@ class Embedding(BaseModel): index: int """The index of the embedding.""" - object: Literal["embedding"] + object: Optional[Literal["embedding"]] = None """The object type of the embedding.""" diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py index 271ac261..534982e3 100644 --- a/src/mixedbread/types/embedding_create_params.py +++ b/src/mixedbread/types/embedding_create_params.py @@ -3,16 +3,16 @@ from __future__ import annotations from typing import List, Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["EmbeddingCreateParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"] +__all__ = ["EmbeddingCreateParams"] class EmbeddingCreateParams(TypedDict, total=False): model: Required[str] """The model to use for creating embeddings.""" - input: Required[Input] + input: Required[List[str]] """The input to create embeddings for.""" dimensions: Optional[int] @@ -28,28 +28,7 @@ class EmbeddingCreateParams(TypedDict, total=False): Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"], List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]], ] - """The encoding format of the embeddings.""" + """The encoding format(s) of the embeddings. - -class InputImageURLInputImage(TypedDict, total=False): - url: Required[str] - """The image URL. Can be either a URL or a Data URI.""" - - -class InputImageURLInput(TypedDict, total=False): - type: Literal["image_url"] - """Input type identifier""" - - image: Required[InputImageURLInputImage] - """The image input specification.""" - - -class InputTextInput(TypedDict, total=False): - type: Literal["text"] - """Input type identifier""" - - text: Required[str] - """Text content to process""" - - -Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput] + Can be a single format or a list of formats. + """ diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py index ccd043b9..c72e68cb 100644 --- a/src/mixedbread/types/embedding_create_response.py +++ b/src/mixedbread/types/embedding_create_response.py @@ -32,7 +32,7 @@ class DataUnionMember1Embedding(BaseModel): ubinary: Optional[List[int]] = None - base64: Optional[List[str]] = None + base64: Optional[str] = None class DataUnionMember1(BaseModel): @@ -45,7 +45,7 @@ class DataUnionMember1(BaseModel): index: int """The index of the embedding.""" - object: Literal["embedding_dict"] + object: Optional[Literal["embedding_dict"]] = None """The object type of the embedding.""" @@ -66,7 +66,7 @@ class EmbeddingCreateResponse(BaseModel): "job", "embedding", "embedding_dict", - "text_document", + "rank_result", "file", "vector_store", "vector_store.file", @@ -82,7 +82,7 @@ class EmbeddingCreateResponse(BaseModel): Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"], List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]], ] - """The encoding format of the embeddings.""" + """The encoding formats of the embeddings.""" dimensions: Optional[int] = None """The number of dimensions used for the embeddings.""" diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py index 2bbdada2..372051b0 100644 --- a/src/mixedbread/types/extractions/content_create_params.py +++ b/src/mixedbread/types/extractions/content_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, TypedDict __all__ = ["ContentCreateParams"] @@ -11,5 +12,5 @@ class ContentCreateParams(TypedDict, total=False): content: Required[str] """The content to extract from""" - json_schema: Required[object] + json_schema: Required[Dict[str, object]] """The JSON schema to use for extraction""" diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py index 4b50c4c6..7208722b 100644 --- a/src/mixedbread/types/extractions/created_json_schema.py +++ b/src/mixedbread/types/extractions/created_json_schema.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Dict from ..._models import BaseModel @@ -7,5 +8,5 @@ class CreatedJsonSchema(BaseModel): - json_schema: object + json_schema: Dict[str, object] """The created JSON schema""" diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py index 7b2ab04a..f555a7c0 100644 --- a/src/mixedbread/types/extractions/enhanced_json_schema.py +++ b/src/mixedbread/types/extractions/enhanced_json_schema.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Dict from ..._models import BaseModel @@ -7,5 +8,5 @@ class EnhancedJsonSchema(BaseModel): - json_schema: object + json_schema: Dict[str, object] """The enhanced JSON schema""" diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py index 437f4f89..d6430d4b 100644 --- a/src/mixedbread/types/extractions/extraction_job.py +++ b/src/mixedbread/types/extractions/extraction_job.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from datetime import datetime from typing_extensions import Literal @@ -38,8 +38,8 @@ class ExtractionJob(BaseModel): result: Optional[ExtractionResult] = None """The result of an extraction job.""" - error: Optional[object] = None + error: Optional[Dict[str, object]] = None """Error information if failed""" - json_schema: object + json_schema: Dict[str, object] """The JSON schema used for extraction""" diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py index 11a31990..b5206a09 100644 --- a/src/mixedbread/types/extractions/extraction_result.py +++ b/src/mixedbread/types/extractions/extraction_result.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import Dict, List from ..._models import BaseModel @@ -8,6 +8,6 @@ class ExtractionResult(BaseModel): - data: object + data: Dict[str, object] warnings: List[str] diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py index 476154b2..a252df4a 100644 --- a/src/mixedbread/types/extractions/job_create_params.py +++ b/src/mixedbread/types/extractions/job_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, TypedDict __all__ = ["JobCreateParams"] @@ -11,5 +12,5 @@ class JobCreateParams(TypedDict, total=False): file_id: Required[str] """The ID of the file to extract from""" - json_schema: Required[object] + json_schema: Required[Dict[str, object]] """The JSON schema to use for extraction""" diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py index e0facf34..8526c898 100644 --- a/src/mixedbread/types/extractions/schema_enhance_params.py +++ b/src/mixedbread/types/extractions/schema_enhance_params.py @@ -2,11 +2,12 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, TypedDict __all__ = ["SchemaEnhanceParams"] class SchemaEnhanceParams(TypedDict, total=False): - json_schema: Required[object] + json_schema: Required[Dict[str, object]] """The JSON schema to enhance""" diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py index 947182ca..96a31b4f 100644 --- a/src/mixedbread/types/extractions/schema_validate_params.py +++ b/src/mixedbread/types/extractions/schema_validate_params.py @@ -2,11 +2,12 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, TypedDict __all__ = ["SchemaValidateParams"] class SchemaValidateParams(TypedDict, total=False): - json_schema: Required[object] + json_schema: Required[Dict[str, object]] """The JSON schema to validate""" diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py index cb021c31..784c4983 100644 --- a/src/mixedbread/types/extractions/validated_json_schema.py +++ b/src/mixedbread/types/extractions/validated_json_schema.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import Dict, List from ..._models import BaseModel @@ -14,5 +14,5 @@ class ValidatedJsonSchema(BaseModel): errors: List[str] """List of validation errors""" - json_schema: object + json_schema: Dict[str, object] """The validated JSON schema""" diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py index 70121831..5cf151fc 100644 --- a/src/mixedbread/types/rerank_response.py +++ b/src/mixedbread/types/rerank_response.py @@ -21,27 +21,15 @@ class Usage(BaseModel): class Data(BaseModel): index: int + """The index of the document.""" score: float """The score of the document.""" - input: object + input: Optional[object] = None """The input document.""" - object: Optional[ - Literal[ - "list", - "parsing_job", - "job", - "embedding", - "embedding_dict", - "text_document", - "file", - "vector_store", - "vector_store.file", - "api_key", - ] - ] = None + object: Optional[Literal["rank_result"]] = None """The object type.""" @@ -62,7 +50,7 @@ class RerankResponse(BaseModel): "job", "embedding", "embedding_dict", - "text_document", + "rank_result", "file", "vector_store", "vector_store.file", diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py index 7beb468b..923d1cf5 100644 --- a/tests/api_resources/extractions/test_content.py +++ b/tests/api_resources/extractions/test_content.py @@ -21,7 +21,7 @@ class TestContent: def test_method_create(self, client: Mixedbread) -> None: content = client.extractions.content.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ExtractionResult, content, path=["response"]) @@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None: def test_raw_response_create(self, client: Mixedbread) -> None: response = client.extractions.content.with_raw_response.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None: def test_streaming_response_create(self, client: Mixedbread) -> None: with client.extractions.content.with_streaming_response.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -59,7 +59,7 @@ class TestAsyncContent: async def test_method_create(self, async_client: AsyncMixedbread) -> None: content = await async_client.extractions.content.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ExtractionResult, content, path=["response"]) @@ -67,7 +67,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None: async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: response = await async_client.extractions.content.with_raw_response.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -79,7 +79,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.extractions.content.with_streaming_response.create( content="content", - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py index bb055ba7..312512c7 100644 --- a/tests/api_resources/extractions/test_jobs.py +++ b/tests/api_resources/extractions/test_jobs.py @@ -21,7 +21,7 @@ class TestJobs: def test_method_create(self, client: Mixedbread) -> None: job = client.extractions.jobs.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ExtractionJob, job, path=["response"]) @@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None: def test_raw_response_create(self, client: Mixedbread) -> None: response = client.extractions.jobs.with_raw_response.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None: def test_streaming_response_create(self, client: Mixedbread) -> None: with client.extractions.jobs.with_streaming_response.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -97,7 +97,7 @@ class TestAsyncJobs: async def test_method_create(self, async_client: AsyncMixedbread) -> None: job = await async_client.extractions.jobs.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ExtractionJob, job, path=["response"]) @@ -105,7 +105,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None: async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None: response = await async_client.extractions.jobs.with_raw_response.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -117,7 +117,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.extractions.jobs.with_streaming_response.create( file_id="file_id", - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py index 5bff1298..9e538d07 100644 --- a/tests/api_resources/extractions/test_schema.py +++ b/tests/api_resources/extractions/test_schema.py @@ -55,14 +55,14 @@ def test_streaming_response_create(self, client: Mixedbread) -> None: @parametrize def test_method_enhance(self, client: Mixedbread) -> None: schema = client.extractions.schema.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(EnhancedJsonSchema, schema, path=["response"]) @parametrize def test_raw_response_enhance(self, client: Mixedbread) -> None: response = client.extractions.schema.with_raw_response.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -73,7 +73,7 @@ def test_raw_response_enhance(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_enhance(self, client: Mixedbread) -> None: with client.extractions.schema.with_streaming_response.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -86,14 +86,14 @@ def test_streaming_response_enhance(self, client: Mixedbread) -> None: @parametrize def test_method_validate(self, client: Mixedbread) -> None: schema = client.extractions.schema.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ValidatedJsonSchema, schema, path=["response"]) @parametrize def test_raw_response_validate(self, client: Mixedbread) -> None: response = client.extractions.schema.with_raw_response.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -104,7 +104,7 @@ def test_raw_response_validate(self, client: Mixedbread) -> None: @parametrize def test_streaming_response_validate(self, client: Mixedbread) -> None: with client.extractions.schema.with_streaming_response.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,14 +152,14 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> @parametrize async def test_method_enhance(self, async_client: AsyncMixedbread) -> None: schema = await async_client.extractions.schema.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(EnhancedJsonSchema, schema, path=["response"]) @parametrize async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None: response = await async_client.extractions.schema.with_raw_response.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -170,7 +170,7 @@ async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None @parametrize async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None: async with async_client.extractions.schema.with_streaming_response.enhance( - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,14 +183,14 @@ async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) - @parametrize async def test_method_validate(self, async_client: AsyncMixedbread) -> None: schema = await async_client.extractions.schema.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) assert_matches_type(ValidatedJsonSchema, schema, path=["response"]) @parametrize async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None: response = await async_client.extractions.schema.with_raw_response.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) assert response.is_closed is True @@ -201,7 +201,7 @@ async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> Non @parametrize async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None: async with async_client.extractions.schema.with_streaming_response.validate( - json_schema={}, + json_schema={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py index 9052c3be..1c38d8ba 100644 --- a/tests/api_resources/test_client.py +++ b/tests/api_resources/test_client.py @@ -25,7 +25,7 @@ class TestClient: def test_method_embed(self, client: Mixedbread) -> None: client_ = client.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert_matches_type(EmbeddingCreateResponse, client_, path=["response"]) @@ -33,7 +33,7 @@ def test_method_embed(self, client: Mixedbread) -> None: def test_method_embed_with_all_params(self, client: Mixedbread) -> None: client_ = client.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], dimensions=768, prompt="Provide a detailed summary of the following text.", normalized=True, @@ -45,7 +45,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None: def test_raw_response_embed(self, client: Mixedbread) -> None: response = client.with_raw_response.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None: def test_streaming_response_embed(self, client: Mixedbread) -> None: with client.with_streaming_response.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,7 +146,7 @@ class TestAsyncClient: async def test_method_embed(self, async_client: AsyncMixedbread) -> None: client = await async_client.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert_matches_type(EmbeddingCreateResponse, client, path=["response"]) @@ -154,7 +154,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None: async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None: client = await async_client.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], dimensions=768, prompt="Provide a detailed summary of the following text.", normalized=True, @@ -166,7 +166,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None: response = await async_client.with_raw_response.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert response.is_closed is True @@ -178,7 +178,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None: async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None: async with async_client.with_streaming_response.embed( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py index 38ff5153..ffe758eb 100644 --- a/tests/api_resources/test_embeddings.py +++ b/tests/api_resources/test_embeddings.py @@ -21,7 +21,7 @@ class TestEmbeddings: def test_method_create(self, client: Mixedbread) -> None: embedding = client.embeddings.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"]) @@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None: def test_method_create_with_all_params(self, client: Mixedbread) -> None: embedding = client.embeddings.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], dimensions=768, prompt="Provide a detailed summary of the following text.", normalized=True, @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None: def test_raw_response_create(self, client: Mixedbread) -> None: response = client.embeddings.with_raw_response.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert response.is_closed is True @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None: def test_streaming_response_create(self, client: Mixedbread) -> None: with client.embeddings.with_streaming_response.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -71,7 +71,7 @@ class TestAsyncEmbeddings: async def test_method_create(self, async_client: AsyncMixedbread) -> None: embedding = await async_client.embeddings.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"]) @@ -79,7 +79,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None: async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None: embedding = await async_client.embeddings.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], dimensions=768, prompt="Provide a detailed summary of the following text.", normalized=True, @@ -91,7 +91,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.embeddings.with_raw_response.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) assert response.is_closed is True @@ -103,7 +103,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.embeddings.with_streaming_response.create( model="mixedbread-ai/mxbai-embed-large-v1", - input="This is a sample text input.", + input=["string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"