mixedbread 0.46.0__tar.gz → 0.47.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mixedbread-0.47.1/.release-please-manifest.json +3 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/CHANGELOG.md +70 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/CONTRIBUTING.md +1 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/PKG-INFO +1 -1
- {mixedbread-0.46.0 → mixedbread-0.47.1}/api.md +30 -55
- {mixedbread-0.46.0 → mixedbread-0.47.1}/pyproject.toml +2 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/requirements-dev.lock +10 -10
- {mixedbread-0.46.0 → mixedbread-0.47.1}/requirements.lock +4 -4
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/__init__.py +3 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_base_client.py +5 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_client.py +2 -39
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_compat.py +3 -3
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_response.py +3 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_streaming.py +8 -3
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_compat.py +1 -1
- mixedbread-0.47.1/src/mixedbread/_utils/_json.py +35 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_version.py +1 -1
- mixedbread-0.47.1/src/mixedbread/lib/__init__.py +1 -0
- mixedbread-0.47.1/src/mixedbread/lib/multipart_upload.py +361 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/__init__.py +0 -14
- {mixedbread-0.46.0/src/mixedbread/resources/vector_stores → mixedbread-0.47.1/src/mixedbread/resources/files}/__init__.py +13 -13
- {mixedbread-0.46.0/src/mixedbread/resources → mixedbread-0.47.1/src/mixedbread/resources/files}/files.py +112 -10
- mixedbread-0.47.1/src/mixedbread/resources/files/uploads.py +520 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/parsing/jobs.py +9 -4
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/stores/files.py +35 -12
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/stores/stores.py +2 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/__init__.py +0 -16
- mixedbread-0.47.1/src/mixedbread/types/files/__init__.py +13 -0
- mixedbread-0.47.1/src/mixedbread/types/files/multipart_upload_part.py +13 -0
- mixedbread-0.47.1/src/mixedbread/types/files/multipart_upload_part_param.py +15 -0
- mixedbread-0.47.1/src/mixedbread/types/files/multipart_upload_part_url.py +13 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_abort_response.py +19 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_complete_params.py +15 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_create_params.py +21 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_create_response.py +16 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_list_response.py +32 -0
- mixedbread-0.47.1/src/mixedbread/types/files/upload_retrieve_response.py +35 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/parsing_job.py +4 -1
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/scored_audio_url_input_chunk.py +82 -3
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/scored_image_url_input_chunk.py +82 -3
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/scored_text_input_chunk.py +81 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/scored_video_url_input_chunk.py +82 -3
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store.py +8 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_chunk_search_options_param.py +20 -6
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_create_params.py +8 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_search_params.py +6 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_list_params.py +1 -1
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_search_params.py +25 -6
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/store_file.py +315 -11
- mixedbread-0.47.1/tests/api_resources/files/test_uploads.py +450 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_files.py +14 -14
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_stores.py +8 -2
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_client.py +16 -0
- mixedbread-0.47.1/tests/test_utils/test_json.py +126 -0
- mixedbread-0.46.0/.release-please-manifest.json +0 -3
- mixedbread-0.46.0/src/mixedbread/resources/vector_stores/files.py +0 -992
- mixedbread-0.46.0/src/mixedbread/resources/vector_stores/vector_stores.py +0 -1054
- mixedbread-0.46.0/src/mixedbread/types/vector_store.py +0 -78
- mixedbread-0.46.0/src/mixedbread/types/vector_store_chunk_search_options_param.py +0 -59
- mixedbread-0.46.0/src/mixedbread/types/vector_store_create_params.py +0 -31
- mixedbread-0.46.0/src/mixedbread/types/vector_store_delete_response.py +0 -21
- mixedbread-0.46.0/src/mixedbread/types/vector_store_list_params.py +0 -31
- mixedbread-0.46.0/src/mixedbread/types/vector_store_question_answering_params.py +0 -59
- mixedbread-0.46.0/src/mixedbread/types/vector_store_question_answering_response.py +0 -1018
- mixedbread-0.46.0/src/mixedbread/types/vector_store_search_params.py +0 -39
- mixedbread-0.46.0/src/mixedbread/types/vector_store_search_response.py +0 -1016
- mixedbread-0.46.0/src/mixedbread/types/vector_store_update_params.py +0 -27
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/__init__.py +0 -15
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_create_params.py +0 -42
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_delete_response.py +0 -21
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_list_params.py +0 -44
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_list_response.py +0 -52
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_retrieve_params.py +0 -15
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_search_params.py +0 -103
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/file_search_response.py +0 -19
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/rerank_config_param.py +0 -26
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/scored_vector_store_file.py +0 -1050
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/vector_store_file.py +0 -894
- mixedbread-0.46.0/src/mixedbread/types/vector_stores/vector_store_file_status.py +0 -7
- mixedbread-0.46.0/tests/api_resources/test_vector_stores.py +0 -768
- mixedbread-0.46.0/tests/api_resources/vector_stores/test_files.py +0 -659
- {mixedbread-0.46.0 → mixedbread-0.47.1}/.gitignore +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/LICENSE +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/README.md +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/SECURITY.md +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/bin/check-release-environment +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/bin/publish-pypi +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/examples/.keep +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/noxfile.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/release-please-config.json +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_constants.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_exceptions.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_files.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_models.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_qs.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_resource.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_types.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_datetime_parse.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_logs.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_proxy.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_reflection.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_resources_proxy.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_streams.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_sync.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_transform.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_typing.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/_utils/_utils.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/lib/.keep +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/lib/polling.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/pagination.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/py.typed +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/api_keys.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/chat.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/data_sources/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/data_sources/connectors.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/data_sources/data_sources.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/embeddings.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/extractions/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/extractions/content.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/extractions/extractions.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/extractions/jobs.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/extractions/schema.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/parsing/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/parsing/parsing.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/resources/stores/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/api_key.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/api_key_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/api_key_created.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/api_key_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/api_key_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/client_embed_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/client_rerank_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_oauth2_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_type.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_source_update_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/connector_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/connector_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/connector_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/connector_update_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/data_sources/data_source_connector.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/embedding.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/embedding_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/embedding_create_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/encoding_format.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/expires_after.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/expires_after_param.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/content_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/created_json_schema.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/enhanced_json_schema.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/extraction_job.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/extraction_result.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/image_url_input_param.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/job_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/schema_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/schema_enhance_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/schema_validate_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/text_input_param.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/extractions/validated_json_schema.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/file_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/file_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/file_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/file_object.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/file_update_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/info_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/linear_data_source_param.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/multi_encoding_embedding.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/notion_data_source_param.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/oauth2_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/pagination_with_total.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/chunking_strategy.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/element_type.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/job_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/job_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/job_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/job_list_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/parsing_job_status.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/parsing/return_format.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/rerank_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared/search_filter.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared/search_filter_condition.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared/usage.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared_params/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared_params/search_filter.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/shared_params/search_filter_condition.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_list_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_metadata_facets_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_metadata_facets_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_question_answering_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_question_answering_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_search_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/store_update_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_create_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_delete_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_list_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_retrieve_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_search_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/file_update_params.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/scored_store_file.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/src/mixedbread/types/stores/store_file_status.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/data_sources/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/data_sources/test_connectors.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/extractions/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/extractions/test_content.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/extractions/test_jobs.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/extractions/test_schema.py +0 -0
- {mixedbread-0.46.0/tests/api_resources/parsing → mixedbread-0.47.1/tests/api_resources/files}/__init__.py +0 -0
- {mixedbread-0.46.0/tests/api_resources/stores → mixedbread-0.47.1/tests/api_resources/parsing}/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/parsing/test_jobs.py +0 -0
- {mixedbread-0.46.0/tests/api_resources/vector_stores → mixedbread-0.47.1/tests/api_resources/stores}/__init__.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/stores/test_files.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_api_keys.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_chat.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_client.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_data_sources.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/api_resources/test_embeddings.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/conftest.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/sample_file.txt +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_deepcopy.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_extract_files.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_files.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_models.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_qs.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_required_args.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_response.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_streaming.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_transform.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_utils/test_datetime_parse.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_utils/test_proxy.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/test_utils/test_typing.py +0 -0
- {mixedbread-0.46.0 → mixedbread-0.47.1}/tests/utils.py +0 -0
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.47.1 (2026-03-12)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.47.0...v0.47.1](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.47.0...v0.47.1)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* **ci:** skip uploading artifacts on stainless-internal branches ([ffb6f62](https://github.com/mixedbread-ai/mixedbread-python/commit/ffb6f62c5ad6afb7b6330ef4159a32f35327b1b9))
|
|
10
|
+
* **test:** do not count install time for mock server timeout ([5094a5c](https://github.com/mixedbread-ai/mixedbread-python/commit/5094a5c23d75363566963e806d60bf214575c89d))
|
|
11
|
+
* update placeholder string ([eeb1328](https://github.com/mixedbread-ai/mixedbread-python/commit/eeb13288a93f42b17d3f21a7980d22c34c7afc8b))
|
|
12
|
+
|
|
13
|
+
## 0.47.0 (2026-03-05)
|
|
14
|
+
|
|
15
|
+
Full Changelog: [v1.0.0...v0.47.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v1.0.0...v0.47.0)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **api:** add uploads (multipart) subresource to files ([f510cc9](https://github.com/mixedbread-ai/mixedbread-python/commit/f510cc9d7ae96b0874ee2e7ed9b6f4bf37fe8a07))
|
|
20
|
+
* **api:** api update ([e95f5f1](https://github.com/mixedbread-ai/mixedbread-python/commit/e95f5f1ca1ad4215a5d2bc2fa3e5e6838bd17c3c))
|
|
21
|
+
* **api:** api update ([eb27c60](https://github.com/mixedbread-ai/mixedbread-python/commit/eb27c606437eea717438344e343c1adfa5ebff16))
|
|
22
|
+
* **api:** api update ([c4be5ae](https://github.com/mixedbread-ai/mixedbread-python/commit/c4be5ae024212e1fd1feaabdc1d2b07c14228eb7))
|
|
23
|
+
* **api:** api update ([153c4ba](https://github.com/mixedbread-ai/mixedbread-python/commit/153c4ba201048975a882983f882491352a1d7bd3))
|
|
24
|
+
* **api:** api update ([216baf6](https://github.com/mixedbread-ai/mixedbread-python/commit/216baf6093ec37db5b57d0fb675a7c7212bea750))
|
|
25
|
+
* **api:** api update ([8fef561](https://github.com/mixedbread-ai/mixedbread-python/commit/8fef5613483e10652fd1e35ba3e2097a26a5cfcd))
|
|
26
|
+
* **api:** api update ([10a541d](https://github.com/mixedbread-ai/mixedbread-python/commit/10a541d3fa4015fdb5e2b6720fdf1f97322b5439))
|
|
27
|
+
* **api:** files uploads (multipart) subresource ([93a98e6](https://github.com/mixedbread-ai/mixedbread-python/commit/93a98e6c38cce16f1de10df080e6a81e9be25f93))
|
|
28
|
+
* **api:** manual updates ([e38a505](https://github.com/mixedbread-ai/mixedbread-python/commit/e38a505829b962ad8115859cfb3eff149e3c6cb3))
|
|
29
|
+
* **api:** manual updates ([860868e](https://github.com/mixedbread-ai/mixedbread-python/commit/860868e1b9d9c56570fe05e9525bd17bcf427515))
|
|
30
|
+
* **api:** manual updates ([33abdc9](https://github.com/mixedbread-ai/mixedbread-python/commit/33abdc949c57c09804841b7d53c0fec22a02133a))
|
|
31
|
+
* use multipart uploads API for large files automatically with optional config ([#18](https://github.com/mixedbread-ai/mixedbread-python/issues/18)) ([ff0f83f](https://github.com/mixedbread-ai/mixedbread-python/commit/ff0f83fda625c0c67d478bd4cccd6cd179fea44a))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* cancel orphaned upload tasks and fix file size calc for io bytes ([#21](https://github.com/mixedbread-ai/mixedbread-python/issues/21)) ([46aea64](https://github.com/mixedbread-ai/mixedbread-python/commit/46aea647e9aa19ee8095dd1bafe8c54d9f1d7bb9))
|
|
37
|
+
* count uploaded bytes correctly even if parts finish out of order ([#20](https://github.com/mixedbread-ai/mixedbread-python/issues/20)) ([eb8af86](https://github.com/mixedbread-ai/mixedbread-python/commit/eb8af86bcc757e50199d5fc963cb203897b704b6))
|
|
38
|
+
* do not block event loop for read_part on async coroutine in multipart upload ([#19](https://github.com/mixedbread-ai/mixedbread-python/issues/19)) ([537f825](https://github.com/mixedbread-ai/mixedbread-python/commit/537f8254bfa0e11fe3a32c14d5705fdac5b9bc04))
|
|
39
|
+
* do not drop request uptions on multipart upload path ([#23](https://github.com/mixedbread-ai/mixedbread-python/issues/23)) ([2859304](https://github.com/mixedbread-ai/mixedbread-python/commit/2859304036ccc25bcee28d6f5a1c564c6a70ca9e))
|
|
40
|
+
* explicit multipart upload config in store files APIs ([#22](https://github.com/mixedbread-ai/mixedbread-python/issues/22)) ([0ebb7b0](https://github.com/mixedbread-ai/mixedbread-python/commit/0ebb7b0d4cbdd0fd41842e5ac2caa8a4b0d3d9aa))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Chores
|
|
44
|
+
|
|
45
|
+
* format all `api.md` files ([d167e2d](https://github.com/mixedbread-ai/mixedbread-python/commit/d167e2d222b34334f86313213bb01d7c8a003f18))
|
|
46
|
+
* **internal:** add request options to SSE classes ([f241bf6](https://github.com/mixedbread-ai/mixedbread-python/commit/f241bf6d47c31faf166869ef96219d7c7d4c8e10))
|
|
47
|
+
* **internal:** fix lint error on Python 3.14 ([72f3d05](https://github.com/mixedbread-ai/mixedbread-python/commit/72f3d05d8e2b6bea43db9001270d836f21254a9e))
|
|
48
|
+
* **internal:** make `test_proxy_environment_variables` more resilient ([d0ec2d9](https://github.com/mixedbread-ai/mixedbread-python/commit/d0ec2d97d74bbf31468fd8ef537f8d142dc92fc7))
|
|
49
|
+
* **internal:** make `test_proxy_environment_variables` more resilient to env ([c287c24](https://github.com/mixedbread-ai/mixedbread-python/commit/c287c24551007387ccd78ce9faea8d4bae02719e))
|
|
50
|
+
* update mock server docs ([b3523db](https://github.com/mixedbread-ai/mixedbread-python/commit/b3523db2445a8a389ca9828deea5d991c095bd0f))
|
|
51
|
+
|
|
52
|
+
## 1.0.0 (2026-02-12)
|
|
53
|
+
|
|
54
|
+
Full Changelog: [v0.46.0...v1.0.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.46.0...v1.0.0)
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* **api:** api update ([aa4cd1b](https://github.com/mixedbread-ai/mixedbread-python/commit/aa4cd1be677441f7099b98316825fa4873b7d0a9))
|
|
59
|
+
* **api:** api update ([4ee152e](https://github.com/mixedbread-ai/mixedbread-python/commit/4ee152e99e45c3c3ead05f66864b8c5ad0f703bf))
|
|
60
|
+
* **api:** api update ([dbf3b5a](https://github.com/mixedbread-ai/mixedbread-python/commit/dbf3b5a1de72068247b21fa1ccb6449f19af1437))
|
|
61
|
+
* **api:** api update ([af6abf1](https://github.com/mixedbread-ai/mixedbread-python/commit/af6abf14e00dc0adf7ed962b0cb9edf3c40846fb))
|
|
62
|
+
* **api:** api update ([650eb91](https://github.com/mixedbread-ai/mixedbread-python/commit/650eb91df9e65e4c6d9ad95db440f78381cee89e))
|
|
63
|
+
* **api:** api update ([c5efbe2](https://github.com/mixedbread-ai/mixedbread-python/commit/c5efbe227c1ce9a01beace2df1019f30d39fe9b8))
|
|
64
|
+
* **api:** manual updates ([8ac3ea2](https://github.com/mixedbread-ai/mixedbread-python/commit/8ac3ea2e1fd757e00ceab7eb97d7421848869664))
|
|
65
|
+
* **client:** add custom JSON encoder for extended type support ([75cc241](https://github.com/mixedbread-ai/mixedbread-python/commit/75cc241a06480f5dee3f3a3c284ee51663e68193))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Chores
|
|
69
|
+
|
|
70
|
+
* **ci:** upgrade `actions/github-script` ([56e9034](https://github.com/mixedbread-ai/mixedbread-python/commit/56e9034b3f755fef67982f5c2a122a69802c6ea4))
|
|
71
|
+
* **internal:** bump dependencies ([580f6f8](https://github.com/mixedbread-ai/mixedbread-python/commit/580f6f8a878e936e1f9474138c1d7c839681b537))
|
|
72
|
+
|
|
3
73
|
## 0.46.0 (2026-01-17)
|
|
4
74
|
|
|
5
75
|
Full Changelog: [v0.45.0...v0.46.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.45.0...v0.46.0)
|
|
@@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
|
|
|
88
88
|
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
89
89
|
|
|
90
90
|
```sh
|
|
91
|
-
|
|
92
|
-
$ npx prism mock path/to/your/openapi.yml
|
|
91
|
+
$ ./scripts/mock
|
|
93
92
|
```
|
|
94
93
|
|
|
95
94
|
```sh
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mixedbread
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.47.1
|
|
4
4
|
Summary: The official Python library for the Mixedbread API
|
|
5
5
|
Project-URL: Homepage, https://github.com/mixedbread-ai/mixedbread-python
|
|
6
6
|
Project-URL: Repository, https://github.com/mixedbread-ai/mixedbread-python
|
|
@@ -24,7 +24,7 @@ Methods:
|
|
|
24
24
|
- <code title="get /">client.<a href="./src/mixedbread/_client.py">info</a>() -> <a href="./src/mixedbread/types/info_response.py">InfoResponse</a></code>
|
|
25
25
|
- <code title="post /v1/reranking">client.<a href="./src/mixedbread/_client.py">rerank</a>(\*\*<a href="src/mixedbread/types/client_rerank_params.py">params</a>) -> <a href="./src/mixedbread/types/rerank_response.py">RerankResponse</a></code>
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# Stores
|
|
28
28
|
|
|
29
29
|
Types:
|
|
30
30
|
|
|
@@ -35,54 +35,6 @@ from mixedbread.types import (
|
|
|
35
35
|
ScoredImageURLInputChunk,
|
|
36
36
|
ScoredTextInputChunk,
|
|
37
37
|
ScoredVideoURLInputChunk,
|
|
38
|
-
VectorStore,
|
|
39
|
-
VectorStoreChunkSearchOptions,
|
|
40
|
-
VectorStoreDeleteResponse,
|
|
41
|
-
VectorStoreQuestionAnsweringResponse,
|
|
42
|
-
VectorStoreSearchResponse,
|
|
43
|
-
)
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Methods:
|
|
47
|
-
|
|
48
|
-
- <code title="post /v1/vector_stores">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">create</a>(\*\*<a href="src/mixedbread/types/vector_store_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
|
|
49
|
-
- <code title="get /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">retrieve</a>(vector_store_identifier) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
|
|
50
|
-
- <code title="put /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">update</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_store_update_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
|
|
51
|
-
- <code title="get /v1/vector_stores">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">list</a>(\*\*<a href="src/mixedbread/types/vector_store_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">SyncCursor[VectorStore]</a></code>
|
|
52
|
-
- <code title="delete /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">delete</a>(vector_store_identifier) -> <a href="./src/mixedbread/types/vector_store_delete_response.py">VectorStoreDeleteResponse</a></code>
|
|
53
|
-
- <code title="post /v1/vector_stores/question-answering">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">question_answering</a>(\*\*<a href="src/mixedbread/types/vector_store_question_answering_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store_question_answering_response.py">VectorStoreQuestionAnsweringResponse</a></code>
|
|
54
|
-
- <code title="post /v1/vector_stores/search">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">search</a>(\*\*<a href="src/mixedbread/types/vector_store_search_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store_search_response.py">VectorStoreSearchResponse</a></code>
|
|
55
|
-
|
|
56
|
-
## Files
|
|
57
|
-
|
|
58
|
-
Types:
|
|
59
|
-
|
|
60
|
-
```python
|
|
61
|
-
from mixedbread.types.vector_stores import (
|
|
62
|
-
RerankConfig,
|
|
63
|
-
ScoredVectorStoreFile,
|
|
64
|
-
VectorStoreFileStatus,
|
|
65
|
-
VectorStoreFile,
|
|
66
|
-
FileListResponse,
|
|
67
|
-
FileDeleteResponse,
|
|
68
|
-
FileSearchResponse,
|
|
69
|
-
)
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Methods:
|
|
73
|
-
|
|
74
|
-
- <code title="post /v1/vector_stores/{vector_store_identifier}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">create</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
|
|
75
|
-
- <code title="get /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_retrieve_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
|
|
76
|
-
- <code title="post /v1/vector_stores/{vector_store_identifier}/files/list">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">list</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/file_list_response.py">FileListResponse</a></code>
|
|
77
|
-
- <code title="delete /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">delete</a>(file_id, \*, vector_store_identifier) -> <a href="./src/mixedbread/types/vector_stores/file_delete_response.py">FileDeleteResponse</a></code>
|
|
78
|
-
- <code title="post /v1/vector_stores/files/search">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">search</a>(\*\*<a href="src/mixedbread/types/vector_stores/file_search_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/file_search_response.py">FileSearchResponse</a></code>
|
|
79
|
-
|
|
80
|
-
# Stores
|
|
81
|
-
|
|
82
|
-
Types:
|
|
83
|
-
|
|
84
|
-
```python
|
|
85
|
-
from mixedbread.types import (
|
|
86
38
|
Store,
|
|
87
39
|
StoreChunkSearchOptions,
|
|
88
40
|
StoreDeleteResponse,
|
|
@@ -163,12 +115,35 @@ from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
|
|
|
163
115
|
|
|
164
116
|
Methods:
|
|
165
117
|
|
|
166
|
-
- <code title="post /v1/files">client.files.<a href="./src/mixedbread/resources/files.py">create</a>(\*\*<a href="src/mixedbread/types/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
167
|
-
- <code title="get /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files.py">retrieve</a>(file_id) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
168
|
-
- <code title="post /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files.py">update</a>(file_id, \*\*<a href="src/mixedbread/types/file_update_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
169
|
-
- <code title="get /v1/files">client.files.<a href="./src/mixedbread/resources/files.py">list</a>(\*\*<a href="src/mixedbread/types/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">SyncCursor[FileObject]</a></code>
|
|
170
|
-
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files.py">delete</a>(file_id) -> <a href="./src/mixedbread/types/file_delete_response.py">FileDeleteResponse</a></code>
|
|
171
|
-
- <code title="get /v1/files/{file_id}/content">client.files.<a href="./src/mixedbread/resources/files.py">content</a>(file_id) -> BinaryAPIResponse</code>
|
|
118
|
+
- <code title="post /v1/files">client.files.<a href="./src/mixedbread/resources/files/files.py">create</a>(\*\*<a href="src/mixedbread/types/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
119
|
+
- <code title="get /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files/files.py">retrieve</a>(file_id) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
120
|
+
- <code title="post /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files/files.py">update</a>(file_id, \*\*<a href="src/mixedbread/types/file_update_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
121
|
+
- <code title="get /v1/files">client.files.<a href="./src/mixedbread/resources/files/files.py">list</a>(\*\*<a href="src/mixedbread/types/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">SyncCursor[FileObject]</a></code>
|
|
122
|
+
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files/files.py">delete</a>(file_id) -> <a href="./src/mixedbread/types/file_delete_response.py">FileDeleteResponse</a></code>
|
|
123
|
+
- <code title="get /v1/files/{file_id}/content">client.files.<a href="./src/mixedbread/resources/files/files.py">content</a>(file_id) -> BinaryAPIResponse</code>
|
|
124
|
+
|
|
125
|
+
## Uploads
|
|
126
|
+
|
|
127
|
+
Types:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from mixedbread.types.files import (
|
|
131
|
+
MultipartUploadPart,
|
|
132
|
+
MultipartUploadPartURL,
|
|
133
|
+
UploadCreateResponse,
|
|
134
|
+
UploadRetrieveResponse,
|
|
135
|
+
UploadListResponse,
|
|
136
|
+
UploadAbortResponse,
|
|
137
|
+
)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Methods:
|
|
141
|
+
|
|
142
|
+
- <code title="post /v1/files/uploads">client.files.uploads.<a href="./src/mixedbread/resources/files/uploads.py">create</a>(\*\*<a href="src/mixedbread/types/files/upload_create_params.py">params</a>) -> <a href="./src/mixedbread/types/files/upload_create_response.py">UploadCreateResponse</a></code>
|
|
143
|
+
- <code title="get /v1/files/uploads/{upload_id}">client.files.uploads.<a href="./src/mixedbread/resources/files/uploads.py">retrieve</a>(upload_id) -> <a href="./src/mixedbread/types/files/upload_retrieve_response.py">UploadRetrieveResponse</a></code>
|
|
144
|
+
- <code title="get /v1/files/uploads">client.files.uploads.<a href="./src/mixedbread/resources/files/uploads.py">list</a>() -> <a href="./src/mixedbread/types/files/upload_list_response.py">UploadListResponse</a></code>
|
|
145
|
+
- <code title="post /v1/files/uploads/{upload_id}/abort">client.files.uploads.<a href="./src/mixedbread/resources/files/uploads.py">abort</a>(upload_id) -> <a href="./src/mixedbread/types/files/upload_abort_response.py">UploadAbortResponse</a></code>
|
|
146
|
+
- <code title="post /v1/files/uploads/{upload_id}/complete">client.files.uploads.<a href="./src/mixedbread/resources/files/uploads.py">complete</a>(upload_id, \*\*<a href="src/mixedbread/types/files/upload_complete_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
|
|
172
147
|
|
|
173
148
|
# Extractions
|
|
174
149
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mixedbread"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.47.1"
|
|
4
4
|
description = "The official Python library for the Mixedbread API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -69,7 +69,7 @@ format = { chain = [
|
|
|
69
69
|
# run formatting again to fix any inconsistencies when imports are stripped
|
|
70
70
|
"format:ruff",
|
|
71
71
|
]}
|
|
72
|
-
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
|
|
72
|
+
"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'"
|
|
73
73
|
"format:ruff" = "ruff format"
|
|
74
74
|
|
|
75
75
|
"lint" = { chain = [
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
-e file:.
|
|
13
13
|
aiohappyeyeballs==2.6.1
|
|
14
14
|
# via aiohttp
|
|
15
|
-
aiohttp==3.13.
|
|
15
|
+
aiohttp==3.13.3
|
|
16
16
|
# via httpx-aiohttp
|
|
17
17
|
# via mixedbread
|
|
18
18
|
aiosignal==1.4.0
|
|
19
19
|
# via aiohttp
|
|
20
20
|
annotated-types==0.7.0
|
|
21
21
|
# via pydantic
|
|
22
|
-
anyio==4.12.
|
|
22
|
+
anyio==4.12.1
|
|
23
23
|
# via httpx
|
|
24
24
|
# via mixedbread
|
|
25
25
|
argcomplete==3.6.3
|
|
@@ -31,7 +31,7 @@ attrs==25.4.0
|
|
|
31
31
|
# via nox
|
|
32
32
|
backports-asyncio-runner==1.2.0
|
|
33
33
|
# via pytest-asyncio
|
|
34
|
-
certifi==
|
|
34
|
+
certifi==2026.1.4
|
|
35
35
|
# via httpcore
|
|
36
36
|
# via httpx
|
|
37
37
|
colorlog==6.10.1
|
|
@@ -61,7 +61,7 @@ httpx==0.28.1
|
|
|
61
61
|
# via httpx-aiohttp
|
|
62
62
|
# via mixedbread
|
|
63
63
|
# via respx
|
|
64
|
-
httpx-aiohttp==0.1.
|
|
64
|
+
httpx-aiohttp==0.1.12
|
|
65
65
|
# via mixedbread
|
|
66
66
|
humanize==4.13.0
|
|
67
67
|
# via nox
|
|
@@ -69,7 +69,7 @@ idna==3.11
|
|
|
69
69
|
# via anyio
|
|
70
70
|
# via httpx
|
|
71
71
|
# via yarl
|
|
72
|
-
importlib-metadata==8.7.
|
|
72
|
+
importlib-metadata==8.7.1
|
|
73
73
|
iniconfig==2.1.0
|
|
74
74
|
# via pytest
|
|
75
75
|
markdown-it-py==3.0.0
|
|
@@ -82,14 +82,14 @@ multidict==6.7.0
|
|
|
82
82
|
mypy==1.17.0
|
|
83
83
|
mypy-extensions==1.1.0
|
|
84
84
|
# via mypy
|
|
85
|
-
nodeenv==1.
|
|
85
|
+
nodeenv==1.10.0
|
|
86
86
|
# via pyright
|
|
87
87
|
nox==2025.11.12
|
|
88
88
|
packaging==25.0
|
|
89
89
|
# via dependency-groups
|
|
90
90
|
# via nox
|
|
91
91
|
# via pytest
|
|
92
|
-
pathspec==0.
|
|
92
|
+
pathspec==1.0.3
|
|
93
93
|
# via mypy
|
|
94
94
|
platformdirs==4.4.0
|
|
95
95
|
# via virtualenv
|
|
@@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0
|
|
|
115
115
|
# via time-machine
|
|
116
116
|
respx==0.22.0
|
|
117
117
|
rich==14.2.0
|
|
118
|
-
ruff==0.14.
|
|
118
|
+
ruff==0.14.13
|
|
119
119
|
six==1.17.0
|
|
120
120
|
# via python-dateutil
|
|
121
121
|
sniffio==1.3.1
|
|
122
122
|
# via mixedbread
|
|
123
123
|
time-machine==2.19.0
|
|
124
|
-
tomli==2.
|
|
124
|
+
tomli==2.4.0
|
|
125
125
|
# via dependency-groups
|
|
126
126
|
# via mypy
|
|
127
127
|
# via nox
|
|
@@ -141,7 +141,7 @@ typing-extensions==4.15.0
|
|
|
141
141
|
# via virtualenv
|
|
142
142
|
typing-inspection==0.4.2
|
|
143
143
|
# via pydantic
|
|
144
|
-
virtualenv==20.
|
|
144
|
+
virtualenv==20.36.1
|
|
145
145
|
# via nox
|
|
146
146
|
yarl==1.22.0
|
|
147
147
|
# via aiohttp
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
-e file:.
|
|
13
13
|
aiohappyeyeballs==2.6.1
|
|
14
14
|
# via aiohttp
|
|
15
|
-
aiohttp==3.13.
|
|
15
|
+
aiohttp==3.13.3
|
|
16
16
|
# via httpx-aiohttp
|
|
17
17
|
# via mixedbread
|
|
18
18
|
aiosignal==1.4.0
|
|
19
19
|
# via aiohttp
|
|
20
20
|
annotated-types==0.7.0
|
|
21
21
|
# via pydantic
|
|
22
|
-
anyio==4.12.
|
|
22
|
+
anyio==4.12.1
|
|
23
23
|
# via httpx
|
|
24
24
|
# via mixedbread
|
|
25
25
|
async-timeout==5.0.1
|
|
26
26
|
# via aiohttp
|
|
27
27
|
attrs==25.4.0
|
|
28
28
|
# via aiohttp
|
|
29
|
-
certifi==
|
|
29
|
+
certifi==2026.1.4
|
|
30
30
|
# via httpcore
|
|
31
31
|
# via httpx
|
|
32
32
|
distro==1.9.0
|
|
@@ -43,7 +43,7 @@ httpcore==1.0.9
|
|
|
43
43
|
httpx==0.28.1
|
|
44
44
|
# via httpx-aiohttp
|
|
45
45
|
# via mixedbread
|
|
46
|
-
httpx-aiohttp==0.1.
|
|
46
|
+
httpx-aiohttp==0.1.12
|
|
47
47
|
# via mixedbread
|
|
48
48
|
idna==3.11
|
|
49
49
|
# via anyio
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import typing as _t
|
|
4
4
|
|
|
5
5
|
from . import types
|
|
6
|
+
from .lib import PartUploadEvent as PartUploadEvent, MultipartUploadOptions as MultipartUploadOptions
|
|
6
7
|
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
|
|
7
8
|
from ._utils import file_from_path
|
|
8
9
|
from ._client import (
|
|
@@ -83,6 +84,8 @@ __all__ = [
|
|
|
83
84
|
"DefaultHttpxClient",
|
|
84
85
|
"DefaultAsyncHttpxClient",
|
|
85
86
|
"DefaultAioHttpClient",
|
|
87
|
+
"MultipartUploadOptions",
|
|
88
|
+
"PartUploadEvent",
|
|
86
89
|
]
|
|
87
90
|
|
|
88
91
|
if not _t.TYPE_CHECKING:
|
|
@@ -86,6 +86,7 @@ from ._exceptions import (
|
|
|
86
86
|
APIConnectionError,
|
|
87
87
|
APIResponseValidationError,
|
|
88
88
|
)
|
|
89
|
+
from ._utils._json import openapi_dumps
|
|
89
90
|
|
|
90
91
|
log: logging.Logger = logging.getLogger(__name__)
|
|
91
92
|
|
|
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
554
555
|
kwargs["content"] = options.content
|
|
555
556
|
elif isinstance(json_data, bytes):
|
|
556
557
|
kwargs["content"] = json_data
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
elif not files:
|
|
559
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
560
|
+
# since httpx's content param overrides other body arguments
|
|
561
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
559
562
|
kwargs["files"] = files
|
|
560
563
|
else:
|
|
561
564
|
headers.pop("Content-Type", None)
|
|
@@ -53,16 +53,15 @@ from .types.rerank_response import RerankResponse
|
|
|
53
53
|
from .types.embedding_create_response import EmbeddingCreateResponse
|
|
54
54
|
|
|
55
55
|
if TYPE_CHECKING:
|
|
56
|
-
from .resources import chat, files, stores, parsing, api_keys, embeddings, extractions, data_sources
|
|
56
|
+
from .resources import chat, files, stores, parsing, api_keys, embeddings, extractions, data_sources
|
|
57
57
|
from .resources.chat import ChatResource, AsyncChatResource
|
|
58
|
-
from .resources.files import FilesResource, AsyncFilesResource
|
|
59
58
|
from .resources.api_keys import APIKeysResource, AsyncAPIKeysResource
|
|
60
59
|
from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
|
|
60
|
+
from .resources.files.files import FilesResource, AsyncFilesResource
|
|
61
61
|
from .resources.stores.stores import StoresResource, AsyncStoresResource
|
|
62
62
|
from .resources.parsing.parsing import ParsingResource, AsyncParsingResource
|
|
63
63
|
from .resources.extractions.extractions import ExtractionsResource, AsyncExtractionsResource
|
|
64
64
|
from .resources.data_sources.data_sources import DataSourcesResource, AsyncDataSourcesResource
|
|
65
|
-
from .resources.vector_stores.vector_stores import VectorStoresResource, AsyncVectorStoresResource
|
|
66
65
|
|
|
67
66
|
__all__ = [
|
|
68
67
|
"ENVIRONMENTS",
|
|
@@ -162,12 +161,6 @@ class Mixedbread(SyncAPIClient):
|
|
|
162
161
|
_strict_response_validation=_strict_response_validation,
|
|
163
162
|
)
|
|
164
163
|
|
|
165
|
-
@cached_property
|
|
166
|
-
def vector_stores(self) -> VectorStoresResource:
|
|
167
|
-
from .resources.vector_stores import VectorStoresResource
|
|
168
|
-
|
|
169
|
-
return VectorStoresResource(self)
|
|
170
|
-
|
|
171
164
|
@cached_property
|
|
172
165
|
def stores(self) -> StoresResource:
|
|
173
166
|
from .resources.stores import StoresResource
|
|
@@ -565,12 +558,6 @@ class AsyncMixedbread(AsyncAPIClient):
|
|
|
565
558
|
_strict_response_validation=_strict_response_validation,
|
|
566
559
|
)
|
|
567
560
|
|
|
568
|
-
@cached_property
|
|
569
|
-
def vector_stores(self) -> AsyncVectorStoresResource:
|
|
570
|
-
from .resources.vector_stores import AsyncVectorStoresResource
|
|
571
|
-
|
|
572
|
-
return AsyncVectorStoresResource(self)
|
|
573
|
-
|
|
574
561
|
@cached_property
|
|
575
562
|
def stores(self) -> AsyncStoresResource:
|
|
576
563
|
from .resources.stores import AsyncStoresResource
|
|
@@ -905,12 +892,6 @@ class MixedbreadWithRawResponse:
|
|
|
905
892
|
client.rerank,
|
|
906
893
|
)
|
|
907
894
|
|
|
908
|
-
@cached_property
|
|
909
|
-
def vector_stores(self) -> vector_stores.VectorStoresResourceWithRawResponse:
|
|
910
|
-
from .resources.vector_stores import VectorStoresResourceWithRawResponse
|
|
911
|
-
|
|
912
|
-
return VectorStoresResourceWithRawResponse(self._client.vector_stores)
|
|
913
|
-
|
|
914
895
|
@cached_property
|
|
915
896
|
def stores(self) -> stores.StoresResourceWithRawResponse:
|
|
916
897
|
from .resources.stores import StoresResourceWithRawResponse
|
|
@@ -976,12 +957,6 @@ class AsyncMixedbreadWithRawResponse:
|
|
|
976
957
|
client.rerank,
|
|
977
958
|
)
|
|
978
959
|
|
|
979
|
-
@cached_property
|
|
980
|
-
def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithRawResponse:
|
|
981
|
-
from .resources.vector_stores import AsyncVectorStoresResourceWithRawResponse
|
|
982
|
-
|
|
983
|
-
return AsyncVectorStoresResourceWithRawResponse(self._client.vector_stores)
|
|
984
|
-
|
|
985
960
|
@cached_property
|
|
986
961
|
def stores(self) -> stores.AsyncStoresResourceWithRawResponse:
|
|
987
962
|
from .resources.stores import AsyncStoresResourceWithRawResponse
|
|
@@ -1047,12 +1022,6 @@ class MixedbreadWithStreamedResponse:
|
|
|
1047
1022
|
client.rerank,
|
|
1048
1023
|
)
|
|
1049
1024
|
|
|
1050
|
-
@cached_property
|
|
1051
|
-
def vector_stores(self) -> vector_stores.VectorStoresResourceWithStreamingResponse:
|
|
1052
|
-
from .resources.vector_stores import VectorStoresResourceWithStreamingResponse
|
|
1053
|
-
|
|
1054
|
-
return VectorStoresResourceWithStreamingResponse(self._client.vector_stores)
|
|
1055
|
-
|
|
1056
1025
|
@cached_property
|
|
1057
1026
|
def stores(self) -> stores.StoresResourceWithStreamingResponse:
|
|
1058
1027
|
from .resources.stores import StoresResourceWithStreamingResponse
|
|
@@ -1118,12 +1087,6 @@ class AsyncMixedbreadWithStreamedResponse:
|
|
|
1118
1087
|
client.rerank,
|
|
1119
1088
|
)
|
|
1120
1089
|
|
|
1121
|
-
@cached_property
|
|
1122
|
-
def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithStreamingResponse:
|
|
1123
|
-
from .resources.vector_stores import AsyncVectorStoresResourceWithStreamingResponse
|
|
1124
|
-
|
|
1125
|
-
return AsyncVectorStoresResourceWithStreamingResponse(self._client.vector_stores)
|
|
1126
|
-
|
|
1127
1090
|
@cached_property
|
|
1128
1091
|
def stores(self) -> stores.AsyncStoresResourceWithStreamingResponse:
|
|
1129
1092
|
from .resources.stores import AsyncStoresResourceWithStreamingResponse
|
|
@@ -139,6 +139,7 @@ def model_dump(
|
|
|
139
139
|
exclude_defaults: bool = False,
|
|
140
140
|
warnings: bool = True,
|
|
141
141
|
mode: Literal["json", "python"] = "python",
|
|
142
|
+
by_alias: bool | None = None,
|
|
142
143
|
) -> dict[str, Any]:
|
|
143
144
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
144
145
|
return model.model_dump(
|
|
@@ -148,13 +149,12 @@ def model_dump(
|
|
|
148
149
|
exclude_defaults=exclude_defaults,
|
|
149
150
|
# warnings are not supported in Pydantic v1
|
|
150
151
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
+
by_alias=by_alias,
|
|
151
153
|
)
|
|
152
154
|
return cast(
|
|
153
155
|
"dict[str, Any]",
|
|
154
156
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
155
|
-
exclude=exclude,
|
|
156
|
-
exclude_unset=exclude_unset,
|
|
157
|
-
exclude_defaults=exclude_defaults,
|
|
157
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
158
158
|
),
|
|
159
159
|
)
|
|
160
160
|
|
|
@@ -152,6 +152,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
152
152
|
),
|
|
153
153
|
response=self.http_response,
|
|
154
154
|
client=cast(Any, self._client),
|
|
155
|
+
options=self._options,
|
|
155
156
|
),
|
|
156
157
|
)
|
|
157
158
|
|
|
@@ -162,6 +163,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
162
163
|
cast_to=extract_stream_chunk_type(self._stream_cls),
|
|
163
164
|
response=self.http_response,
|
|
164
165
|
client=cast(Any, self._client),
|
|
166
|
+
options=self._options,
|
|
165
167
|
),
|
|
166
168
|
)
|
|
167
169
|
|
|
@@ -175,6 +177,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
175
177
|
cast_to=cast_to,
|
|
176
178
|
response=self.http_response,
|
|
177
179
|
client=cast(Any, self._client),
|
|
180
|
+
options=self._options,
|
|
178
181
|
),
|
|
179
182
|
)
|
|
180
183
|
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import json
|
|
5
5
|
import inspect
|
|
6
6
|
from types import TracebackType
|
|
7
|
-
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
|
|
8
8
|
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable
|
|
9
9
|
|
|
10
10
|
import httpx
|
|
@@ -13,6 +13,7 @@ from ._utils import extract_type_var_from_base
|
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
15
|
from ._client import Mixedbread, AsyncMixedbread
|
|
16
|
+
from ._models import FinalRequestOptions
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
_T = TypeVar("_T")
|
|
@@ -22,7 +23,7 @@ class Stream(Generic[_T]):
|
|
|
22
23
|
"""Provides the core interface to iterate over a synchronous stream response."""
|
|
23
24
|
|
|
24
25
|
response: httpx.Response
|
|
25
|
-
|
|
26
|
+
_options: Optional[FinalRequestOptions] = None
|
|
26
27
|
_decoder: SSEBytesDecoder
|
|
27
28
|
|
|
28
29
|
def __init__(
|
|
@@ -31,10 +32,12 @@ class Stream(Generic[_T]):
|
|
|
31
32
|
cast_to: type[_T],
|
|
32
33
|
response: httpx.Response,
|
|
33
34
|
client: Mixedbread,
|
|
35
|
+
options: Optional[FinalRequestOptions] = None,
|
|
34
36
|
) -> None:
|
|
35
37
|
self.response = response
|
|
36
38
|
self._cast_to = cast_to
|
|
37
39
|
self._client = client
|
|
40
|
+
self._options = options
|
|
38
41
|
self._decoder = client._make_sse_decoder()
|
|
39
42
|
self._iterator = self.__stream__()
|
|
40
43
|
|
|
@@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
|
|
|
85
88
|
"""Provides the core interface to iterate over an asynchronous stream response."""
|
|
86
89
|
|
|
87
90
|
response: httpx.Response
|
|
88
|
-
|
|
91
|
+
_options: Optional[FinalRequestOptions] = None
|
|
89
92
|
_decoder: SSEDecoder | SSEBytesDecoder
|
|
90
93
|
|
|
91
94
|
def __init__(
|
|
@@ -94,10 +97,12 @@ class AsyncStream(Generic[_T]):
|
|
|
94
97
|
cast_to: type[_T],
|
|
95
98
|
response: httpx.Response,
|
|
96
99
|
client: AsyncMixedbread,
|
|
100
|
+
options: Optional[FinalRequestOptions] = None,
|
|
97
101
|
) -> None:
|
|
98
102
|
self.response = response
|
|
99
103
|
self._cast_to = cast_to
|
|
100
104
|
self._client = client
|
|
105
|
+
self._options = options
|
|
101
106
|
self._decoder = client._make_sse_decoder()
|
|
102
107
|
self._iterator = self.__stream__()
|
|
103
108
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|