mixedbread 0.49.0__tar.gz → 0.51.0__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.
Files changed (263) hide show
  1. {mixedbread-0.49.0 → mixedbread-0.51.0}/.gitignore +1 -0
  2. mixedbread-0.51.0/.release-please-manifest.json +3 -0
  3. {mixedbread-0.49.0 → mixedbread-0.51.0}/CHANGELOG.md +70 -0
  4. {mixedbread-0.49.0 → mixedbread-0.51.0}/CONTRIBUTING.md +1 -1
  5. {mixedbread-0.49.0 → mixedbread-0.51.0}/PKG-INFO +1 -1
  6. {mixedbread-0.49.0 → mixedbread-0.51.0}/api.md +30 -7
  7. {mixedbread-0.49.0 → mixedbread-0.51.0}/pyproject.toml +2 -2
  8. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_base_client.py +4 -0
  9. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_client.py +19 -0
  10. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_files.py +54 -4
  11. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_models.py +80 -0
  12. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_qs.py +6 -7
  13. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_types.py +3 -0
  14. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/__init__.py +1 -1
  15. mixedbread-0.51.0/src/mixedbread/_utils/_path.py +127 -0
  16. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_utils.py +37 -25
  17. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_version.py +1 -1
  18. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/api_keys.py +12 -11
  19. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/data_sources/connectors.py +35 -11
  20. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/data_sources/data_sources.py +7 -7
  21. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/extractions/jobs.py +3 -3
  22. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/files/files.py +14 -13
  23. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/files/uploads.py +7 -7
  24. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/parsing/jobs.py +7 -7
  25. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/stores/files.py +41 -160
  26. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/stores/stores.py +86 -47
  27. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/__init__.py +23 -12
  28. mixedbread-0.51.0/src/mixedbread/types/agentic_search_config_param.py +41 -0
  29. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/api_key.py +2 -9
  30. mixedbread-0.51.0/src/mixedbread/types/api_key_create_or_update_params.py +16 -0
  31. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/api_key_create_params.py +4 -11
  32. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/api_key_created.py +2 -9
  33. mixedbread-0.51.0/src/mixedbread/types/audio_chunk_generated_metadata.py +42 -0
  34. mixedbread-0.51.0/src/mixedbread/types/audio_url.py +12 -0
  35. mixedbread-0.51.0/src/mixedbread/types/code_chunk_generated_metadata.py +40 -0
  36. mixedbread-0.51.0/src/mixedbread/types/contextualization_config.py +24 -0
  37. mixedbread-0.51.0/src/mixedbread/types/contextualization_config_param.py +27 -0
  38. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source.py +3 -12
  39. mixedbread-0.51.0/src/mixedbread/types/data_source_api_key_params.py +17 -0
  40. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_create_params.py +3 -17
  41. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_update_params.py +3 -17
  42. mixedbread-0.51.0/src/mixedbread/types/file_counts.py +29 -0
  43. mixedbread-0.51.0/src/mixedbread/types/image_chunk_generated_metadata.py +36 -0
  44. mixedbread-0.51.0/src/mixedbread/types/image_url_output.py +17 -0
  45. mixedbread-0.51.0/src/mixedbread/types/markdown_chunk_generated_metadata.py +47 -0
  46. mixedbread-0.51.0/src/mixedbread/types/markdown_heading.py +11 -0
  47. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/notion_data_source_param.py +3 -12
  48. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/__init__.py +3 -0
  49. mixedbread-0.51.0/src/mixedbread/types/parsing/chunk.py +21 -0
  50. mixedbread-0.51.0/src/mixedbread/types/parsing/chunk_element.py +33 -0
  51. mixedbread-0.51.0/src/mixedbread/types/parsing/document_parser_result.py +30 -0
  52. mixedbread-0.51.0/src/mixedbread/types/parsing/parsing_job.py +48 -0
  53. mixedbread-0.51.0/src/mixedbread/types/pdf_chunk_generated_metadata.py +34 -0
  54. mixedbread-0.51.0/src/mixedbread/types/rerank_config_param.py +26 -0
  55. mixedbread-0.51.0/src/mixedbread/types/scope.py +16 -0
  56. mixedbread-0.51.0/src/mixedbread/types/scope_param.py +16 -0
  57. mixedbread-0.51.0/src/mixedbread/types/scored_audio_url_input_chunk.py +78 -0
  58. mixedbread-0.51.0/src/mixedbread/types/scored_image_url_input_chunk.py +75 -0
  59. mixedbread-0.51.0/src/mixedbread/types/scored_text_input_chunk.py +74 -0
  60. mixedbread-0.51.0/src/mixedbread/types/scored_video_url_input_chunk.py +75 -0
  61. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/shared/__init__.py +0 -1
  62. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/shared_params/__init__.py +0 -1
  63. mixedbread-0.51.0/src/mixedbread/types/store.py +67 -0
  64. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_chunk_search_options_param.py +5 -38
  65. mixedbread-0.51.0/src/mixedbread/types/store_config.py +26 -0
  66. mixedbread-0.51.0/src/mixedbread/types/store_config_param.py +27 -0
  67. mixedbread-0.51.0/src/mixedbread/types/store_create_params.py +41 -0
  68. mixedbread-0.51.0/src/mixedbread/types/store_metadata_facets_params.py +101 -0
  69. mixedbread-0.51.0/src/mixedbread/types/store_question_answering_params.py +115 -0
  70. mixedbread-0.51.0/src/mixedbread/types/store_search_params.py +94 -0
  71. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_search_response.py +16 -1
  72. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_update_params.py +3 -0
  73. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/__init__.py +6 -3
  74. mixedbread-0.51.0/src/mixedbread/types/stores/audio_url_input_chunk.py +60 -0
  75. mixedbread-0.51.0/src/mixedbread/types/stores/file_create_params.py +30 -0
  76. mixedbread-0.51.0/src/mixedbread/types/stores/file_list_params.py +99 -0
  77. mixedbread-0.51.0/src/mixedbread/types/stores/image_url_input_chunk.py +57 -0
  78. mixedbread-0.49.0/src/mixedbread/types/stores/scored_store_file.py → mixedbread-0.51.0/src/mixedbread/types/stores/store_file.py +13 -20
  79. mixedbread-0.51.0/src/mixedbread/types/stores/store_file_config.py +15 -0
  80. mixedbread-0.51.0/src/mixedbread/types/stores/store_file_config_param.py +14 -0
  81. mixedbread-0.51.0/src/mixedbread/types/stores/text_input_chunk.py +56 -0
  82. mixedbread-0.51.0/src/mixedbread/types/stores/video_url_input_chunk.py +57 -0
  83. mixedbread-0.51.0/src/mixedbread/types/text_chunk_generated_metadata.py +40 -0
  84. mixedbread-0.51.0/src/mixedbread/types/video_chunk_generated_metadata.py +46 -0
  85. mixedbread-0.51.0/src/mixedbread/types/video_url.py +12 -0
  86. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/stores/test_files.py +72 -125
  87. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_stores.py +238 -30
  88. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_client.py +48 -0
  89. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_extract_files.py +28 -1
  90. mixedbread-0.51.0/tests/test_files.py +148 -0
  91. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_models.py +57 -3
  92. mixedbread-0.51.0/tests/test_utils/test_path.py +89 -0
  93. mixedbread-0.49.0/.release-please-manifest.json +0 -3
  94. mixedbread-0.49.0/src/mixedbread/types/parsing/parsing_job.py +0 -107
  95. mixedbread-0.49.0/src/mixedbread/types/scored_audio_url_input_chunk.py +0 -319
  96. mixedbread-0.49.0/src/mixedbread/types/scored_image_url_input_chunk.py +0 -319
  97. mixedbread-0.49.0/src/mixedbread/types/scored_text_input_chunk.py +0 -305
  98. mixedbread-0.49.0/src/mixedbread/types/scored_video_url_input_chunk.py +0 -316
  99. mixedbread-0.49.0/src/mixedbread/types/shared/search_filter.py +0 -40
  100. mixedbread-0.49.0/src/mixedbread/types/shared_params/search_filter.py +0 -39
  101. mixedbread-0.49.0/src/mixedbread/types/store.py +0 -112
  102. mixedbread-0.49.0/src/mixedbread/types/store_create_params.py +0 -65
  103. mixedbread-0.49.0/src/mixedbread/types/store_metadata_facets_params.py +0 -42
  104. mixedbread-0.49.0/src/mixedbread/types/store_question_answering_params.py +0 -65
  105. mixedbread-0.49.0/src/mixedbread/types/store_search_params.py +0 -43
  106. mixedbread-0.49.0/src/mixedbread/types/stores/file_create_params.py +0 -42
  107. mixedbread-0.49.0/src/mixedbread/types/stores/file_list_params.py +0 -47
  108. mixedbread-0.49.0/src/mixedbread/types/stores/file_search_params.py +0 -128
  109. mixedbread-0.49.0/src/mixedbread/types/stores/file_search_response.py +0 -17
  110. mixedbread-0.49.0/src/mixedbread/types/stores/store_file.py +0 -1231
  111. mixedbread-0.49.0/tests/test_deepcopy.py +0 -58
  112. mixedbread-0.49.0/tests/test_files.py +0 -51
  113. {mixedbread-0.49.0 → mixedbread-0.51.0}/LICENSE +0 -0
  114. {mixedbread-0.49.0 → mixedbread-0.51.0}/README.md +0 -0
  115. {mixedbread-0.49.0 → mixedbread-0.51.0}/SECURITY.md +0 -0
  116. {mixedbread-0.49.0 → mixedbread-0.51.0}/bin/check-release-environment +0 -0
  117. {mixedbread-0.49.0 → mixedbread-0.51.0}/bin/publish-pypi +0 -0
  118. {mixedbread-0.49.0 → mixedbread-0.51.0}/examples/.keep +0 -0
  119. {mixedbread-0.49.0 → mixedbread-0.51.0}/noxfile.py +0 -0
  120. {mixedbread-0.49.0 → mixedbread-0.51.0}/release-please-config.json +0 -0
  121. {mixedbread-0.49.0 → mixedbread-0.51.0}/requirements-dev.lock +0 -0
  122. {mixedbread-0.49.0 → mixedbread-0.51.0}/requirements.lock +0 -0
  123. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/__init__.py +0 -0
  124. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_compat.py +0 -0
  125. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_constants.py +0 -0
  126. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_exceptions.py +0 -0
  127. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_resource.py +0 -0
  128. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_response.py +0 -0
  129. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_streaming.py +0 -0
  130. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_compat.py +0 -0
  131. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_datetime_parse.py +0 -0
  132. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_json.py +0 -0
  133. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_logs.py +0 -0
  134. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_proxy.py +0 -0
  135. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_reflection.py +0 -0
  136. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_resources_proxy.py +0 -0
  137. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_streams.py +0 -0
  138. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_sync.py +0 -0
  139. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_transform.py +0 -0
  140. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/_utils/_typing.py +0 -0
  141. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/lib/.keep +0 -0
  142. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/lib/__init__.py +0 -0
  143. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/lib/multipart_upload.py +0 -0
  144. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/lib/polling.py +0 -0
  145. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/pagination.py +0 -0
  146. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/py.typed +0 -0
  147. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/__init__.py +0 -0
  148. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/chat.py +0 -0
  149. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/data_sources/__init__.py +0 -0
  150. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/embeddings.py +0 -0
  151. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/extractions/__init__.py +0 -0
  152. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/extractions/content.py +0 -0
  153. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/extractions/extractions.py +0 -0
  154. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/extractions/schema.py +0 -0
  155. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/files/__init__.py +0 -0
  156. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/parsing/__init__.py +0 -0
  157. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/parsing/parsing.py +0 -0
  158. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/resources/stores/__init__.py +0 -0
  159. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/api_key_delete_response.py +0 -0
  160. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/api_key_list_params.py +0 -0
  161. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/client_embed_params.py +0 -0
  162. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/client_rerank_params.py +0 -0
  163. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_delete_response.py +0 -0
  164. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_list_params.py +0 -0
  165. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_oauth2_params.py +0 -0
  166. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_source_type.py +0 -0
  167. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/__init__.py +0 -0
  168. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/connector_create_params.py +0 -0
  169. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/connector_delete_response.py +0 -0
  170. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/connector_list_params.py +0 -0
  171. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/connector_update_params.py +0 -0
  172. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/data_sources/data_source_connector.py +0 -0
  173. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/embedding.py +0 -0
  174. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/embedding_create_params.py +0 -0
  175. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/embedding_create_response.py +0 -0
  176. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/encoding_format.py +0 -0
  177. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/expires_after.py +0 -0
  178. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/expires_after_param.py +0 -0
  179. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/__init__.py +0 -0
  180. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/content_create_params.py +0 -0
  181. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/created_json_schema.py +0 -0
  182. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/enhanced_json_schema.py +0 -0
  183. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/extraction_job.py +0 -0
  184. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/extraction_result.py +0 -0
  185. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/image_url_input_param.py +0 -0
  186. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/job_create_params.py +0 -0
  187. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/schema_create_params.py +0 -0
  188. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/schema_enhance_params.py +0 -0
  189. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/schema_validate_params.py +0 -0
  190. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/text_input_param.py +0 -0
  191. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/extractions/validated_json_schema.py +0 -0
  192. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/file_create_params.py +0 -0
  193. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/file_delete_response.py +0 -0
  194. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/file_list_params.py +0 -0
  195. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/file_object.py +0 -0
  196. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/file_update_params.py +0 -0
  197. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/__init__.py +0 -0
  198. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/multipart_upload_part.py +0 -0
  199. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/multipart_upload_part_param.py +0 -0
  200. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/multipart_upload_part_url.py +0 -0
  201. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_abort_response.py +0 -0
  202. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_complete_params.py +0 -0
  203. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_create_params.py +0 -0
  204. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_create_response.py +0 -0
  205. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_list_response.py +0 -0
  206. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/files/upload_retrieve_response.py +0 -0
  207. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/info_response.py +0 -0
  208. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/linear_data_source_param.py +0 -0
  209. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/multi_encoding_embedding.py +0 -0
  210. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/oauth2_params.py +0 -0
  211. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/pagination_with_total.py +0 -0
  212. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/chunking_strategy.py +0 -0
  213. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/element_type.py +0 -0
  214. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/job_create_params.py +0 -0
  215. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/job_delete_response.py +0 -0
  216. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/job_list_params.py +0 -0
  217. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/job_list_response.py +0 -0
  218. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/parsing_job_status.py +0 -0
  219. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/parsing/return_format.py +0 -0
  220. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/rerank_response.py +0 -0
  221. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/shared/search_filter_condition.py +0 -0
  222. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/shared/usage.py +0 -0
  223. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/shared_params/search_filter_condition.py +0 -0
  224. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_delete_response.py +0 -0
  225. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_list_params.py +0 -0
  226. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_metadata_facets_response.py +0 -0
  227. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/store_question_answering_response.py +0 -0
  228. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/file_delete_response.py +0 -0
  229. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/file_list_response.py +0 -0
  230. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/file_retrieve_params.py +0 -0
  231. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/file_update_params.py +0 -0
  232. {mixedbread-0.49.0 → mixedbread-0.51.0}/src/mixedbread/types/stores/store_file_status.py +0 -0
  233. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/__init__.py +0 -0
  234. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/__init__.py +0 -0
  235. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/data_sources/__init__.py +0 -0
  236. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/data_sources/test_connectors.py +0 -0
  237. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/extractions/__init__.py +0 -0
  238. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/extractions/test_content.py +0 -0
  239. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/extractions/test_jobs.py +0 -0
  240. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/extractions/test_schema.py +0 -0
  241. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/files/__init__.py +0 -0
  242. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/files/test_uploads.py +0 -0
  243. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/parsing/__init__.py +0 -0
  244. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/parsing/test_jobs.py +0 -0
  245. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/stores/__init__.py +0 -0
  246. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_api_keys.py +0 -0
  247. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_chat.py +0 -0
  248. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_client.py +0 -0
  249. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_data_sources.py +0 -0
  250. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_embeddings.py +0 -0
  251. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/api_resources/test_files.py +0 -0
  252. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/conftest.py +0 -0
  253. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/sample_file.txt +0 -0
  254. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_qs.py +0 -0
  255. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_required_args.py +0 -0
  256. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_response.py +0 -0
  257. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_streaming.py +0 -0
  258. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_transform.py +0 -0
  259. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_utils/test_datetime_parse.py +0 -0
  260. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_utils/test_json.py +0 -0
  261. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_utils/test_proxy.py +0 -0
  262. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/test_utils/test_typing.py +0 -0
  263. {mixedbread-0.49.0 → mixedbread-0.51.0}/tests/utils.py +0 -0
@@ -1,4 +1,5 @@
1
1
  .prism.log
2
+ .stdy.log
2
3
  _dev
3
4
 
4
5
  __pycache__
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.51.0"
3
+ }
@@ -1,5 +1,75 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.51.0 (2026-05-20)
4
+
5
+ Full Changelog: [v0.50.0...v0.51.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.50.0...v0.51.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([c59f556](https://github.com/mixedbread-ai/mixedbread-python/commit/c59f5561b5e782ae7e35b9cbfb498f357856c8f8))
10
+ * **api:** api update ([842efa8](https://github.com/mixedbread-ai/mixedbread-python/commit/842efa840415d1a6d8f754f9c1594655283858c9))
11
+ * **api:** api update ([6fe066e](https://github.com/mixedbread-ai/mixedbread-python/commit/6fe066e17443211a47a21f677344bf8c349e6fde))
12
+ * **api:** api update ([eac4b8f](https://github.com/mixedbread-ai/mixedbread-python/commit/eac4b8f34275c9377765cfe62f677d5ca36cf061))
13
+ * **api:** api update ([66aa7dc](https://github.com/mixedbread-ai/mixedbread-python/commit/66aa7dc394357766b869a3d067e4c130cdf482e8))
14
+ * **internal/types:** support eagerly validating pydantic iterators ([3e9c5ac](https://github.com/mixedbread-ai/mixedbread-python/commit/3e9c5ac9ab56db4eddf8a6a2f219a8789c9c45ac))
15
+ * support setting headers via env ([38de0ee](https://github.com/mixedbread-ai/mixedbread-python/commit/38de0ee2781d9e27d6aecafe89f5a5b5baaed75c))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **client:** add missing f-string prefix in file type error message ([fe74792](https://github.com/mixedbread-ai/mixedbread-python/commit/fe74792cd81bb58bd62e58c086d6d1ee6c233c25))
21
+ * use correct field name format for multipart file arrays ([361fcd6](https://github.com/mixedbread-ai/mixedbread-python/commit/361fcd66f8422020375b076d4c70a83c2b82241d))
22
+
23
+
24
+ ### Chores
25
+
26
+ * **internal:** reformat pyproject.toml ([8802c53](https://github.com/mixedbread-ai/mixedbread-python/commit/8802c53023895e9248f03b92477c9a17013ec7b7))
27
+
28
+ ## 0.50.0 (2026-04-23)
29
+
30
+ Full Changelog: [v0.49.0...v0.50.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.49.0...v0.50.0)
31
+
32
+ ### Features
33
+
34
+ * **api:** api update ([9cb94bc](https://github.com/mixedbread-ai/mixedbread-python/commit/9cb94bcfc4cf74adfd82b1ff6e8166d5bf597bf7))
35
+ * **api:** api update ([c7f1a92](https://github.com/mixedbread-ai/mixedbread-python/commit/c7f1a92a897408fe54d22ae773e617c0eb9be584))
36
+ * **api:** api update ([34d8ca8](https://github.com/mixedbread-ai/mixedbread-python/commit/34d8ca84c2ed2fd3a7bf77a84047741b537a178a))
37
+ * **api:** api update ([4ad956c](https://github.com/mixedbread-ai/mixedbread-python/commit/4ad956c1b52e6a08dc44958cb331451f5bec75af))
38
+ * **api:** api update ([a24ebe9](https://github.com/mixedbread-ai/mixedbread-python/commit/a24ebe9e241e075c2958cefecfe9e972a5bcd55f))
39
+ * include results in store search events response ([8bb1069](https://github.com/mixedbread-ai/mixedbread-python/commit/8bb1069f016d97cf24bf4f7031c180ca3752e07d))
40
+ * **internal:** implement indices array format for query and form serialization ([e52e262](https://github.com/mixedbread-ai/mixedbread-python/commit/e52e262bd9acd3caa49cf9ba08a29b260b722bf0))
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * **client:** preserve hardcoded query params when merging with user params ([83d3f20](https://github.com/mixedbread-ai/mixedbread-python/commit/83d3f201d14edd8afa08a6046c2315097d6509d4))
46
+ * ensure file data are only sent as 1 parameter ([0957f16](https://github.com/mixedbread-ai/mixedbread-python/commit/0957f16bb9a20c72499ae6ee86b9494c1e1ee5c8))
47
+ * sanitize endpoint path params ([7d519be](https://github.com/mixedbread-ai/mixedbread-python/commit/7d519be7f4ea6b2ce11c9915ee1ac903ebb97cea))
48
+
49
+
50
+ ### Performance Improvements
51
+
52
+ * **client:** optimize file structure copying in multipart requests ([63a2728](https://github.com/mixedbread-ai/mixedbread-python/commit/63a272878dc28300f5169d38cb523cc641498fed))
53
+
54
+
55
+ ### Chores
56
+
57
+ * **ci:** skip lint on metadata-only changes ([a3ec133](https://github.com/mixedbread-ai/mixedbread-python/commit/a3ec133b88d1a70a066c17e29dd2ebd5decffb25))
58
+ * **internal:** more robust bootstrap script ([5b52286](https://github.com/mixedbread-ai/mixedbread-python/commit/5b5228640759a7bf277d9478f10eeca3d358e10f))
59
+ * **internal:** update gitignore ([cf3aa78](https://github.com/mixedbread-ai/mixedbread-python/commit/cf3aa78ec44036bbedce95735ee7ab43cc4d566a))
60
+ * **tests:** bump steady to v0.19.4 ([d6e32d5](https://github.com/mixedbread-ai/mixedbread-python/commit/d6e32d5abe0e137375ea79373033c07057b22c83))
61
+ * **tests:** bump steady to v0.19.5 ([59351b9](https://github.com/mixedbread-ai/mixedbread-python/commit/59351b9dcb0eaf2578c985c80a0501d610ff357d))
62
+ * **tests:** bump steady to v0.19.6 ([ac0e7ac](https://github.com/mixedbread-ai/mixedbread-python/commit/ac0e7acc35384a0ae9f78040b60bce03f8258d81))
63
+ * **tests:** bump steady to v0.19.7 ([839ee9c](https://github.com/mixedbread-ai/mixedbread-python/commit/839ee9c7c60749ae03a125f84e87a7be9365daac))
64
+ * **tests:** bump steady to v0.20.1 ([31e2274](https://github.com/mixedbread-ai/mixedbread-python/commit/31e2274bfe265fbebae02c86beae2f575f9b7b18))
65
+ * **tests:** bump steady to v0.20.2 ([6879b15](https://github.com/mixedbread-ai/mixedbread-python/commit/6879b159d830df5df58696899c7551c709595ed4))
66
+ * **tests:** bump steady to v0.22.1 ([3f6450d](https://github.com/mixedbread-ai/mixedbread-python/commit/3f6450dbda2fe9baeee031495fd10f4d87fa815a))
67
+
68
+
69
+ ### Refactors
70
+
71
+ * **tests:** switch from prism to steady ([cc454cf](https://github.com/mixedbread-ai/mixedbread-python/commit/cc454cfbe5752c8e439361c52fb31d2d2b14180d))
72
+
3
73
  ## 0.49.0 (2026-03-19)
4
74
 
5
75
  Full Changelog: [v0.48.0...v0.49.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.48.0...v0.49.0)
@@ -85,7 +85,7 @@ $ pip install ./path-to-wheel-file.whl
85
85
 
86
86
  ## Running tests
87
87
 
88
- Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
88
+ Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.
89
89
 
90
90
  ```sh
91
91
  $ ./scripts/mock
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mixedbread
3
- Version: 0.49.0
3
+ Version: 0.51.0
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
@@ -1,7 +1,7 @@
1
1
  # Shared Types
2
2
 
3
3
  ```python
4
- from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
4
+ from mixedbread.types import SearchFilterCondition, Usage
5
5
  ```
6
6
 
7
7
  # Mixedbread
@@ -30,13 +30,29 @@ Types:
30
30
 
31
31
  ```python
32
32
  from mixedbread.types import (
33
+ AgenticSearchConfig,
34
+ AudioChunkGeneratedMetadata,
35
+ AudioURL,
36
+ CodeChunkGeneratedMetadata,
37
+ ContextualizationConfig,
33
38
  ExpiresAfter,
39
+ FileCounts,
40
+ ImageChunkGeneratedMetadata,
41
+ ImageURLOutput,
42
+ MarkdownChunkGeneratedMetadata,
43
+ MarkdownHeading,
44
+ PdfChunkGeneratedMetadata,
45
+ RerankConfig,
34
46
  ScoredAudioURLInputChunk,
35
47
  ScoredImageURLInputChunk,
36
48
  ScoredTextInputChunk,
37
49
  ScoredVideoURLInputChunk,
38
50
  Store,
39
51
  StoreChunkSearchOptions,
52
+ StoreConfig,
53
+ TextChunkGeneratedMetadata,
54
+ VideoChunkGeneratedMetadata,
55
+ VideoURL,
40
56
  StoreDeleteResponse,
41
57
  StoreMetadataFacetsResponse,
42
58
  StoreQuestionAnsweringResponse,
@@ -61,12 +77,15 @@ Types:
61
77
 
62
78
  ```python
63
79
  from mixedbread.types.stores import (
64
- ScoredStoreFile,
65
- StoreFileStatus,
80
+ AudioURLInputChunk,
81
+ ImageURLInputChunk,
66
82
  StoreFile,
83
+ StoreFileConfig,
84
+ StoreFileStatus,
85
+ TextInputChunk,
86
+ VideoURLInputChunk,
67
87
  FileListResponse,
68
88
  FileDeleteResponse,
69
- FileSearchResponse,
70
89
  )
71
90
  ```
72
91
 
@@ -77,7 +96,6 @@ Methods:
77
96
  - <code title="patch /v1/stores/{store_identifier}/files/{file_identifier}">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">update</a>(file_identifier, \*, store_identifier, \*\*<a href="src/mixedbread/types/stores/file_update_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/store_file.py">StoreFile</a></code>
78
97
  - <code title="post /v1/stores/{store_identifier}/files/list">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">list</a>(store_identifier, \*\*<a href="src/mixedbread/types/stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/file_list_response.py">FileListResponse</a></code>
79
98
  - <code title="delete /v1/stores/{store_identifier}/files/{file_identifier}">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">delete</a>(file_identifier, \*, store_identifier) -> <a href="./src/mixedbread/types/stores/file_delete_response.py">FileDeleteResponse</a></code>
80
- - <code title="post /v1/stores/files/search">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">search</a>(\*\*<a href="src/mixedbread/types/stores/file_search_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/file_search_response.py">FileSearchResponse</a></code>
81
99
 
82
100
  # Parsing
83
101
 
@@ -87,10 +105,13 @@ Types:
87
105
 
88
106
  ```python
89
107
  from mixedbread.types.parsing import (
108
+ Chunk,
109
+ ChunkElement,
90
110
  ChunkingStrategy,
111
+ DocumentParserResult,
91
112
  ElementType,
92
- ParsingJobStatus,
93
113
  ParsingJob,
114
+ ParsingJobStatus,
94
115
  ReturnFormat,
95
116
  JobListResponse,
96
117
  JobDeleteResponse,
@@ -204,7 +225,9 @@ Types:
204
225
 
205
226
  ```python
206
227
  from mixedbread.types import (
228
+ APIKeyCreateOrUpdateParams,
207
229
  DataSource,
230
+ DataSourceAPIKeyParams,
208
231
  DataSourceOauth2Params,
209
232
  DataSourceType,
210
233
  LinearDataSource,
@@ -243,7 +266,7 @@ Methods:
243
266
  Types:
244
267
 
245
268
  ```python
246
- from mixedbread.types import APIKey, APIKeyCreated, APIKeyDeleteResponse
269
+ from mixedbread.types import APIKey, APIKeyCreated, Scope, APIKeyDeleteResponse
247
270
  ```
248
271
 
249
272
  Methods:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mixedbread"
3
- version = "0.49.0"
3
+ version = "0.51.0"
4
4
  description = "The official Python library for the Mixedbread API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -168,7 +168,7 @@ show_error_codes = true
168
168
  #
169
169
  # We also exclude our `tests` as mypy doesn't always infer
170
170
  # types correctly and Pyright will still catch any type errors.
171
- exclude = ['src/mixedbread/_files.py', '_dev/.*.py', 'tests/.*']
171
+ exclude = ["src/mixedbread/_files.py", "_dev/.*.py", "tests/.*"]
172
172
 
173
173
  strict_equality = true
174
174
  implicit_reexport = true
@@ -540,6 +540,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
540
540
  files = cast(HttpxRequestFiles, ForceMultipartDict())
541
541
 
542
542
  prepared_url = self._prepare_url(options.url)
543
+ # preserve hard-coded query params from the url
544
+ if params and prepared_url.query:
545
+ params = {**dict(prepared_url.params.items()), **params}
546
+ prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
543
547
  if "_" in prepared_url.host:
544
548
  # work around https://github.com/encode/httpx/discussions/2880
545
549
  kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
@@ -27,6 +27,7 @@ from ._types import (
27
27
  )
28
28
  from ._utils import (
29
29
  is_given,
30
+ is_mapping_t,
30
31
  maybe_transform,
31
32
  get_async_library,
32
33
  async_maybe_transform,
@@ -150,6 +151,15 @@ class Mixedbread(SyncAPIClient):
150
151
  except KeyError as exc:
151
152
  raise ValueError(f"Unknown environment: {environment}") from exc
152
153
 
154
+ custom_headers_env = os.environ.get("MIXEDBREAD_CUSTOM_HEADERS")
155
+ if custom_headers_env is not None:
156
+ parsed: dict[str, str] = {}
157
+ for line in custom_headers_env.split("\n"):
158
+ colon = line.find(":")
159
+ if colon >= 0:
160
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
161
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
162
+
153
163
  super().__init__(
154
164
  version=__version__,
155
165
  base_url=base_url,
@@ -547,6 +557,15 @@ class AsyncMixedbread(AsyncAPIClient):
547
557
  except KeyError as exc:
548
558
  raise ValueError(f"Unknown environment: {environment}") from exc
549
559
 
560
+ custom_headers_env = os.environ.get("MIXEDBREAD_CUSTOM_HEADERS")
561
+ if custom_headers_env is not None:
562
+ parsed: dict[str, str] = {}
563
+ for line in custom_headers_env.split("\n"):
564
+ colon = line.find(":")
565
+ if colon >= 0:
566
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
567
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
568
+
550
569
  super().__init__(
551
570
  version=__version__,
552
571
  base_url=base_url,
@@ -3,8 +3,8 @@ from __future__ import annotations
3
3
  import io
4
4
  import os
5
5
  import pathlib
6
- from typing import overload
7
- from typing_extensions import TypeGuard
6
+ from typing import Sequence, cast, overload
7
+ from typing_extensions import TypeVar, TypeGuard
8
8
 
9
9
  import anyio
10
10
 
@@ -17,7 +17,9 @@ from ._types import (
17
17
  HttpxFileContent,
18
18
  HttpxRequestFiles,
19
19
  )
20
- from ._utils import is_tuple_t, is_mapping_t, is_sequence_t
20
+ from ._utils import is_list, is_mapping, is_tuple_t, is_mapping_t, is_sequence_t
21
+
22
+ _T = TypeVar("_T")
21
23
 
22
24
 
23
25
  def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]:
@@ -97,7 +99,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles
97
99
  elif is_sequence_t(files):
98
100
  files = [(key, await _async_transform_file(file)) for key, file in files]
99
101
  else:
100
- raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence")
102
+ raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence")
101
103
 
102
104
  return files
103
105
 
@@ -121,3 +123,51 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
121
123
  return await anyio.Path(file).read_bytes()
122
124
 
123
125
  return file
126
+
127
+
128
+ def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T:
129
+ """Copy only the containers along the given paths.
130
+
131
+ Used to guard against mutation by extract_files without copying the entire structure.
132
+ Only dicts and lists that lie on a path are copied; everything else
133
+ is returned by reference.
134
+
135
+ For example, given paths=[["foo", "files", "file"]] and the structure:
136
+ {
137
+ "foo": {
138
+ "bar": {"baz": {}},
139
+ "files": {"file": <content>}
140
+ }
141
+ }
142
+ The root dict, "foo", and "files" are copied (they lie on the path).
143
+ "bar" and "baz" are returned by reference (off the path).
144
+ """
145
+ return _deepcopy_with_paths(item, paths, 0)
146
+
147
+
148
+ def _deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]], index: int) -> _T:
149
+ if not paths:
150
+ return item
151
+ if is_mapping(item):
152
+ key_to_paths: dict[str, list[Sequence[str]]] = {}
153
+ for path in paths:
154
+ if index < len(path):
155
+ key_to_paths.setdefault(path[index], []).append(path)
156
+
157
+ # if no path continues through this mapping, it won't be mutated and copying it is redundant
158
+ if not key_to_paths:
159
+ return item
160
+
161
+ result = dict(item)
162
+ for key, subpaths in key_to_paths.items():
163
+ if key in result:
164
+ result[key] = _deepcopy_with_paths(result[key], subpaths, index + 1)
165
+ return cast(_T, result)
166
+ if is_list(item):
167
+ array_paths = [path for path in paths if index < len(path) and path[index] == "<array>"]
168
+
169
+ # if no path expects a list here, nothing will be mutated inside it - return by reference
170
+ if not array_paths:
171
+ return cast(_T, item)
172
+ return cast(_T, [_deepcopy_with_paths(entry, array_paths, index + 1) for entry in item])
173
+ return item
@@ -25,7 +25,9 @@ from typing_extensions import (
25
25
  ClassVar,
26
26
  Protocol,
27
27
  Required,
28
+ Annotated,
28
29
  ParamSpec,
30
+ TypeAlias,
29
31
  TypedDict,
30
32
  TypeGuard,
31
33
  final,
@@ -79,7 +81,15 @@ from ._compat import (
79
81
  from ._constants import RAW_RESPONSE_HEADER
80
82
 
81
83
  if TYPE_CHECKING:
84
+ from pydantic import GetCoreSchemaHandler, ValidatorFunctionWrapHandler
85
+ from pydantic_core import CoreSchema, core_schema
82
86
  from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
87
+ else:
88
+ try:
89
+ from pydantic_core import CoreSchema, core_schema
90
+ except ImportError:
91
+ CoreSchema = None
92
+ core_schema = None
83
93
 
84
94
  __all__ = ["BaseModel", "GenericModel"]
85
95
 
@@ -396,6 +406,76 @@ class BaseModel(pydantic.BaseModel):
396
406
  )
397
407
 
398
408
 
409
+ class _EagerIterable(list[_T], Generic[_T]):
410
+ """
411
+ Accepts any Iterable[T] input (including generators), consumes it
412
+ eagerly, and validates all items upfront.
413
+
414
+ Validation preserves the original container type where possible
415
+ (e.g. a set[T] stays a set[T]). Serialization (model_dump / JSON)
416
+ always emits a list — round-tripping through model_dump() will not
417
+ restore the original container type.
418
+ """
419
+
420
+ @classmethod
421
+ def __get_pydantic_core_schema__(
422
+ cls,
423
+ source_type: Any,
424
+ handler: GetCoreSchemaHandler,
425
+ ) -> CoreSchema:
426
+ (item_type,) = get_args(source_type) or (Any,)
427
+ item_schema: CoreSchema = handler.generate_schema(item_type)
428
+ list_of_items_schema: CoreSchema = core_schema.list_schema(item_schema)
429
+
430
+ return core_schema.no_info_wrap_validator_function(
431
+ cls._validate,
432
+ list_of_items_schema,
433
+ serialization=core_schema.plain_serializer_function_ser_schema(
434
+ cls._serialize,
435
+ info_arg=False,
436
+ ),
437
+ )
438
+
439
+ @staticmethod
440
+ def _validate(v: Iterable[_T], handler: "ValidatorFunctionWrapHandler") -> Any:
441
+ original_type: type[Any] = type(v)
442
+
443
+ # Normalize to list so list_schema can validate each item
444
+ if isinstance(v, list):
445
+ items: list[_T] = v
446
+ else:
447
+ try:
448
+ items = list(v)
449
+ except TypeError as e:
450
+ raise TypeError("Value is not iterable") from e
451
+
452
+ # Validate items against the inner schema
453
+ validated: list[_T] = handler(items)
454
+
455
+ # Reconstruct original container type
456
+ if original_type is list:
457
+ return validated
458
+ # str(list) produces the list's repr, not a string built from items,
459
+ # so skip reconstruction for str and its subclasses.
460
+ if issubclass(original_type, str):
461
+ return validated
462
+ try:
463
+ return original_type(validated)
464
+ except (TypeError, ValueError):
465
+ # If the type cannot be reconstructed, just return the validated list
466
+ return validated
467
+
468
+ @staticmethod
469
+ def _serialize(v: Iterable[_T]) -> list[_T]:
470
+ """Always serialize as a list so Pydantic's JSON encoder is happy."""
471
+ if isinstance(v, list):
472
+ return v
473
+ return list(v)
474
+
475
+
476
+ EagerIterable: TypeAlias = Annotated[Iterable[_T], _EagerIterable]
477
+
478
+
399
479
  def _construct_field(value: object, field: FieldInfo, key: str) -> object:
400
480
  if value is None:
401
481
  return field_get_default(field)
@@ -2,17 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any, List, Tuple, Union, Mapping, TypeVar
4
4
  from urllib.parse import parse_qs, urlencode
5
- from typing_extensions import Literal, get_args
5
+ from typing_extensions import get_args
6
6
 
7
- from ._types import NotGiven, not_given
7
+ from ._types import NotGiven, ArrayFormat, NestedFormat, not_given
8
8
  from ._utils import flatten
9
9
 
10
10
  _T = TypeVar("_T")
11
11
 
12
-
13
- ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
14
- NestedFormat = Literal["dots", "brackets"]
15
-
16
12
  PrimitiveData = Union[str, int, float, bool, None]
17
13
  # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"]
18
14
  # https://github.com/microsoft/pyright/issues/3555
@@ -101,7 +97,10 @@ class Querystring:
101
97
  items.extend(self._stringify_item(key, item, opts))
102
98
  return items
103
99
  elif array_format == "indices":
104
- raise NotImplementedError("The array indices format is not supported yet")
100
+ items = []
101
+ for i, item in enumerate(value):
102
+ items.extend(self._stringify_item(f"{key}[{i}]", item, opts))
103
+ return items
105
104
  elif array_format == "brackets":
106
105
  items = []
107
106
  key = key + "[]"
@@ -47,6 +47,9 @@ AnyMapping = Mapping[str, object]
47
47
  ModelT = TypeVar("ModelT", bound=pydantic.BaseModel)
48
48
  _T = TypeVar("_T")
49
49
 
50
+ ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
51
+ NestedFormat = Literal["dots", "brackets"]
52
+
50
53
 
51
54
  # Approximates httpx internal ProxiesTypes and RequestFiles types
52
55
  # while adding support for `PathLike` instances
@@ -1,3 +1,4 @@
1
+ from ._path import path_template as path_template
1
2
  from ._sync import asyncify as asyncify
2
3
  from ._proxy import LazyProxy as LazyProxy
3
4
  from ._utils import (
@@ -23,7 +24,6 @@ from ._utils import (
23
24
  coerce_integer as coerce_integer,
24
25
  file_from_path as file_from_path,
25
26
  strip_not_given as strip_not_given,
26
- deepcopy_minimal as deepcopy_minimal,
27
27
  get_async_library as get_async_library,
28
28
  maybe_coerce_float as maybe_coerce_float,
29
29
  get_required_header as get_required_header,
@@ -0,0 +1,127 @@
1
+ from __future__ import annotations
2
+
3
+ import re
4
+ from typing import (
5
+ Any,
6
+ Mapping,
7
+ Callable,
8
+ )
9
+ from urllib.parse import quote
10
+
11
+ # Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E).
12
+ _DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$")
13
+
14
+ _PLACEHOLDER_RE = re.compile(r"\{(\w+)\}")
15
+
16
+
17
+ def _quote_path_segment_part(value: str) -> str:
18
+ """Percent-encode `value` for use in a URI path segment.
19
+
20
+ Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe.
21
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
22
+ """
23
+ # quote() already treats unreserved characters (letters, digits, and -._~)
24
+ # as safe, so we only need to add sub-delims, ':', and '@'.
25
+ # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted.
26
+ return quote(value, safe="!$&'()*+,;=:@")
27
+
28
+
29
+ def _quote_query_part(value: str) -> str:
30
+ """Percent-encode `value` for use in a URI query string.
31
+
32
+ Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe.
33
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
34
+ """
35
+ return quote(value, safe="!$'()*+,;:@/?")
36
+
37
+
38
+ def _quote_fragment_part(value: str) -> str:
39
+ """Percent-encode `value` for use in a URI fragment.
40
+
41
+ Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe.
42
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
43
+ """
44
+ return quote(value, safe="!$&'()*+,;=:@/?")
45
+
46
+
47
+ def _interpolate(
48
+ template: str,
49
+ values: Mapping[str, Any],
50
+ quoter: Callable[[str], str],
51
+ ) -> str:
52
+ """Replace {name} placeholders in `template`, quoting each value with `quoter`.
53
+
54
+ Placeholder names are looked up in `values`.
55
+
56
+ Raises:
57
+ KeyError: If a placeholder is not found in `values`.
58
+ """
59
+ # re.split with a capturing group returns alternating
60
+ # [text, name, text, name, ..., text] elements.
61
+ parts = _PLACEHOLDER_RE.split(template)
62
+
63
+ for i in range(1, len(parts), 2):
64
+ name = parts[i]
65
+ if name not in values:
66
+ raise KeyError(f"a value for placeholder {{{name}}} was not provided")
67
+ val = values[name]
68
+ if val is None:
69
+ parts[i] = "null"
70
+ elif isinstance(val, bool):
71
+ parts[i] = "true" if val else "false"
72
+ else:
73
+ parts[i] = quoter(str(values[name]))
74
+
75
+ return "".join(parts)
76
+
77
+
78
+ def path_template(template: str, /, **kwargs: Any) -> str:
79
+ """Interpolate {name} placeholders in `template` from keyword arguments.
80
+
81
+ Args:
82
+ template: The template string containing {name} placeholders.
83
+ **kwargs: Keyword arguments to interpolate into the template.
84
+
85
+ Returns:
86
+ The template with placeholders interpolated and percent-encoded.
87
+
88
+ Safe characters for percent-encoding are dependent on the URI component.
89
+ Placeholders in path and fragment portions are percent-encoded where the `segment`
90
+ and `fragment` sets from RFC 3986 respectively are considered safe.
91
+ Placeholders in the query portion are percent-encoded where the `query` set from
92
+ RFC 3986 §3.3 is considered safe except for = and & characters.
93
+
94
+ Raises:
95
+ KeyError: If a placeholder is not found in `kwargs`.
96
+ ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments).
97
+ """
98
+ # Split the template into path, query, and fragment portions.
99
+ fragment_template: str | None = None
100
+ query_template: str | None = None
101
+
102
+ rest = template
103
+ if "#" in rest:
104
+ rest, fragment_template = rest.split("#", 1)
105
+ if "?" in rest:
106
+ rest, query_template = rest.split("?", 1)
107
+ path_template = rest
108
+
109
+ # Interpolate each portion with the appropriate quoting rules.
110
+ path_result = _interpolate(path_template, kwargs, _quote_path_segment_part)
111
+
112
+ # Reject dot-segments (. and ..) in the final assembled path. The check
113
+ # runs after interpolation so that adjacent placeholders or a mix of static
114
+ # text and placeholders that together form a dot-segment are caught.
115
+ # Also reject percent-encoded dot-segments to protect against incorrectly
116
+ # implemented normalization in servers/proxies.
117
+ for segment in path_result.split("/"):
118
+ if _DOT_SEGMENT_RE.match(segment):
119
+ raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed")
120
+
121
+ result = path_result
122
+ if query_template is not None:
123
+ result += "?" + _interpolate(query_template, kwargs, _quote_query_part)
124
+ if fragment_template is not None:
125
+ result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part)
126
+
127
+ return result