embed-client 4.0.44__tar.gz → 4.0.46__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 (236) hide show
  1. {embed_client-4.0.44/embed_client.egg-info → embed_client-4.0.46}/PKG-INFO +6 -2
  2. {embed_client-4.0.44 → embed_client-4.0.46}/README.md +5 -1
  3. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/__init__.py +1 -1
  4. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/embedding_client.py +62 -54
  5. {embed_client-4.0.44 → embed_client-4.0.46/embed_client.egg-info}/PKG-INFO +6 -2
  6. {embed_client-4.0.44 → embed_client-4.0.46}/pyproject.toml +1 -1
  7. embed_client-4.0.46/tests/test_vectorization_modes_client.py +245 -0
  8. embed_client-4.0.44/tests/test_vectorization_modes_client.py +0 -152
  9. {embed_client-4.0.44 → embed_client-4.0.46}/CONFIGURATION.md +0 -0
  10. {embed_client-4.0.44 → embed_client-4.0.46}/LICENSE +0 -0
  11. {embed_client-4.0.44 → embed_client-4.0.46}/MANIFEST.in +0 -0
  12. {embed_client-4.0.44 → embed_client-4.0.46}/configs/basic_auth.json +0 -0
  13. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http.json +0 -0
  14. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_8001_test.json +0 -0
  15. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_correct.json +0 -0
  16. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_simple.json +0 -0
  17. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_test.json +0 -0
  18. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_token.json +0 -0
  19. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_token_correct.json +0 -0
  20. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_token_roles.json +0 -0
  21. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_token_roles_token_roles.json +0 -0
  22. {embed_client-4.0.44 → embed_client-4.0.46}/configs/http_token_token_roles.json +0 -0
  23. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https.json +0 -0
  24. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_8001_test.json +0 -0
  25. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_api_test.json +0 -0
  26. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_simple.json +0 -0
  27. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_test.json +0 -0
  28. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_token.json +0 -0
  29. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_token_8001.json +0 -0
  30. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_token_roles.json +0 -0
  31. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_token_roles_token_roles.json +0 -0
  32. {embed_client-4.0.44 → embed_client-4.0.46}/configs/https_token_token_roles.json +0 -0
  33. {embed_client-4.0.44 → embed_client-4.0.46}/configs/jwt.json +0 -0
  34. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls.json +0 -0
  35. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_8001.json +0 -0
  36. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_8001_test.json +0 -0
  37. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_correct.json +0 -0
  38. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_roles.json +0 -0
  39. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_roles_token_roles.json +0 -0
  40. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_test.json +0 -0
  41. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_token_roles.json +0 -0
  42. {embed_client-4.0.44 → embed_client-4.0.46}/configs/mtls_via_adapter.json +0 -0
  43. {embed_client-4.0.44 → embed_client-4.0.46}/configs/roles.json +0 -0
  44. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_http_simple.json +0 -0
  45. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_http_token.json +0 -0
  46. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_http_token_roles.json +0 -0
  47. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_https_simple.json +0 -0
  48. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_https_token.json +0 -0
  49. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_https_token_roles.json +0 -0
  50. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_mtls_roles.json +0 -0
  51. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_mtls_simple.json +0 -0
  52. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_server_http.json +0 -0
  53. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_server_https.json +0 -0
  54. {embed_client-4.0.44 → embed_client-4.0.46}/configs/test_server_mtls.json +0 -0
  55. {embed_client-4.0.44 → embed_client-4.0.46}/docs/BUGREPORT_queue_manager_daemonic.md +0 -0
  56. {embed_client-4.0.44 → embed_client-4.0.46}/docs/IDENTIFIER_ANALYSIS_REPORT.md +0 -0
  57. {embed_client-4.0.44 → embed_client-4.0.46}/docs/PROPOSAL_SERVER_REQUEST_COALESCING.md +0 -0
  58. {embed_client-4.0.44 → embed_client-4.0.46}/docs/PROPOSAL_TWO_CHANNEL_OR_PUSH.md +0 -0
  59. {embed_client-4.0.44 → embed_client-4.0.46}/docs/SERVER_MODES_AND_CLIENT.md +0 -0
  60. {embed_client-4.0.44 → embed_client-4.0.46}/docs/api_format.md +0 -0
  61. {embed_client-4.0.44 → embed_client-4.0.46}/docs/client_integration_guide.md +0 -0
  62. {embed_client-4.0.44 → embed_client-4.0.46}/docs/coverage_report.md +0 -0
  63. {embed_client-4.0.44 → embed_client-4.0.46}/docs/error_500_analysis.md +0 -0
  64. {embed_client-4.0.44 → embed_client-4.0.46}/docs/error_handling_complete.md +0 -0
  65. {embed_client-4.0.44 → embed_client-4.0.46}/docs/error_handling_issue.md +0 -0
  66. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/_template/README.md +0 -0
  67. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/_template/example_global_step/example_tactical_step/example_atomic_step.md +0 -0
  68. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/_template/example_global_step/example_tactical_step/spec.md +0 -0
  69. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/_template/example_global_step/spec.md +0 -0
  70. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/_template/spec.md +0 -0
  71. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/ATOMIC_STEPS_INDEX.md +0 -0
  72. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/freeze-migration-baseline-evidence-links.md +0 -0
  73. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/spec.md +0 -0
  74. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/spec.md +0 -0
  75. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/spec.md +0 -0
  76. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/ATOMIC_STEPS_INDEX.md +0 -0
  77. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-01.md +0 -0
  78. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-02.md +0 -0
  79. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-03.md +0 -0
  80. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-04.md +0 -0
  81. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-05.md +0 -0
  82. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-06.md +0 -0
  83. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-07.md +0 -0
  84. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-08.md +0 -0
  85. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-09.md +0 -0
  86. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-10.md +0 -0
  87. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-11.md +0 -0
  88. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-12.md +0 -0
  89. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-13.md +0 -0
  90. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-14.md +0 -0
  91. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-15.md +0 -0
  92. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-16.md +0 -0
  93. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-17.md +0 -0
  94. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-18.md +0 -0
  95. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-19.md +0 -0
  96. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-20.md +0 -0
  97. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-21.md +0 -0
  98. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-22.md +0 -0
  99. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/plan.md +0 -0
  100. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/ATOMIC_STEPS_INDEX.md +0 -0
  101. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/PARALLEL_WAVES.md +0 -0
  102. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-01-port-constants-and-exceptions.md +0 -0
  103. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-02-port-embedding-client-helpers-and-status-store.md +0 -0
  104. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-03-port-embedding-client-core.md +0 -0
  105. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-04-package-init-version-and-canonical-exports.md +0 -0
  106. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-05-remove-legacy-async-stack-and-adapter-transport.md +0 -0
  107. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-06-remove-testing-client-and-duplicate-helpers.md +0 -0
  108. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-07-rewire-cli-factory-and-minimal-entry-points.md +0 -0
  109. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/spec.md +0 -0
  110. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/spec.md +0 -0
  111. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/README.md +0 -0
  112. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_automated_security_matrix/spec.md +0 -0
  113. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_canonical_mtls_real_server_gate/spec.md +0 -0
  114. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_localhost_vectorization/spec.md +0 -0
  115. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_packaging_and_prereqs/spec.md +0 -0
  116. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_pypi_publication/spec.md +0 -0
  117. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_surviving_examples_executable/spec.md +0 -0
  118. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/spec.md +0 -0
  119. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/ATOMIC_STEPS_INDEX.md +0 -0
  120. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv01-security-matrix.md +0 -0
  121. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv02-vectorization.md +0 -0
  122. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv03-broken-example.md +0 -0
  123. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv04-canonical-gate.md +0 -0
  124. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv05-packaging.md +0 -0
  125. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv06-duplicate-version-or-auth.md +0 -0
  126. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv01-execute-automated-security-matrix.md +0 -0
  127. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv02-execute-localhost-vectorization-mtls-8001.md +0 -0
  128. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv03-execute-surviving-examples-sweep.md +0 -0
  129. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-execute-canonical-mtls-real-server-gate.md +0 -0
  130. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-supplementary-pytest-canonical-example-contract.md +0 -0
  131. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv05-build-artifacts-twine-version-gate.md +0 -0
  132. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv06-pypi-upload.md +0 -0
  133. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/spec.md +0 -0
  134. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/spec.md +0 -0
  135. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/ATOMIC_STEPS_INDEX.md +0 -0
  136. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/align-package-version-with-pyproject-metadata.md +0 -0
  137. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/canonical-localhost-8001-mtls-example-and-execution-tests.md +0 -0
  138. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-pytest-configuration-single-source.md +0 -0
  139. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-redundant-coverage-test-modules.md +0 -0
  140. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/delete-or-replace-skipped-auth-and-ssl-test-modules.md +0 -0
  141. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/extract-async-client-adapter-tests-remove-legacy-aiohttp.md +0 -0
  142. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/fix-or-remove-embed-client-auth-examples.md +0 -0
  143. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/normalize-pyproject-runtime-deps-and-optional-extras.md +0 -0
  144. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/replace-hardcoded-venv-site-packages-in-scripts-and-tests.md +0 -0
  145. {embed_client-4.0.44 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/tasks/tsc_linter_exclusions_and_migration_inventory.md +0 -0
  146. {embed_client-4.0.44 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/README.md +0 -0
  147. {embed_client-4.0.44 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_alignment_verification_and_closure.md +0 -0
  148. {embed_client-4.0.44 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_guides_examples_canonical_mtls.md +0 -0
  149. {embed_client-4.0.44 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_legacy_tree_prune_and_governance.md +0 -0
  150. {embed_client-4.0.44 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_root_metadata_and_pypi_surface.md +0 -0
  151. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/__main__.py +0 -0
  152. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/adapter_config_factory.py +0 -0
  153. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/adapter_config_normalizer.py +0 -0
  154. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/adapter_generator_bridge.py +0 -0
  155. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/auth.py +0 -0
  156. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/cli.py +0 -0
  157. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/cli_core.py +0 -0
  158. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/client_factory.py +0 -0
  159. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/client_factory_examples.py +0 -0
  160. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/client_factory_helpers.py +0 -0
  161. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config.py +0 -0
  162. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_defaults.py +0 -0
  163. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_examples.py +0 -0
  164. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_generator.py +0 -0
  165. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_generator_cli.py +0 -0
  166. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_presets.py +0 -0
  167. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_validator.py +0 -0
  168. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/config_validator_cli.py +0 -0
  169. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/constants.py +0 -0
  170. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/demo_cli.py +0 -0
  171. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/demo_security_cli.py +0 -0
  172. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/embed_file_output_validate.py +0 -0
  173. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/embed_file_status_store.py +0 -0
  174. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/embedding_client_helpers.py +0 -0
  175. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/example_async_usage.py +0 -0
  176. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/example_async_usage_demo.py +0 -0
  177. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/example_async_usage_ru.py +0 -0
  178. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/example_async_usage_ru_demo.py +0 -0
  179. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/exceptions.py +0 -0
  180. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/identifier_types.py +0 -0
  181. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/json_embed_file_preflight.py +0 -0
  182. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/local_json_embed_file.py +0 -0
  183. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/md_embed_file_prep.py +0 -0
  184. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/response_normalizer.py +0 -0
  185. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/response_parsers.py +0 -0
  186. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/security_cli.py +0 -0
  187. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/security_cli_core.py +0 -0
  188. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/ssl_examples.py +0 -0
  189. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client/ssl_manager.py +0 -0
  190. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client.egg-info/SOURCES.txt +0 -0
  191. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client.egg-info/dependency_links.txt +0 -0
  192. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client.egg-info/entry_points.txt +0 -0
  193. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client.egg-info/requires.txt +0 -0
  194. {embed_client-4.0.44 → embed_client-4.0.46}/embed_client.egg-info/top_level.txt +0 -0
  195. {embed_client-4.0.44 → embed_client-4.0.46}/examples/README.md +0 -0
  196. {embed_client-4.0.44 → embed_client-4.0.46}/examples/__init__.py +0 -0
  197. {embed_client-4.0.44 → embed_client-4.0.46}/examples/async_testing_client_example.py +0 -0
  198. {embed_client-4.0.44 → embed_client-4.0.46}/examples/canonical_mtls_localhost_8001.py +0 -0
  199. {embed_client-4.0.44 → embed_client-4.0.46}/examples/configs/http_simple.json +0 -0
  200. {embed_client-4.0.44 → embed_client-4.0.46}/examples/configs/https_token.json +0 -0
  201. {embed_client-4.0.44 → embed_client-4.0.46}/examples/configs/mtls_roles.json +0 -0
  202. {embed_client-4.0.44 → embed_client-4.0.46}/examples/data/embed_file_json_array_sample.json +0 -0
  203. {embed_client-4.0.44 → embed_client-4.0.46}/examples/embed_file_json_local.py +0 -0
  204. {embed_client-4.0.44 → embed_client-4.0.46}/examples/security_examples.py +0 -0
  205. {embed_client-4.0.44 → embed_client-4.0.46}/examples/security_examples_ru.py +0 -0
  206. {embed_client-4.0.44 → embed_client-4.0.46}/setup.cfg +0 -0
  207. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_adapter_integration.py +0 -0
  208. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_adapter_phase1.py +0 -0
  209. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_adapter_phase2.py +0 -0
  210. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_all_security_modes.py +0 -0
  211. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_adapter.py +0 -0
  212. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_real.py +0 -0
  213. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_real_fixtures.py +0 -0
  214. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_stress.py +0 -0
  215. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_stress_new.py +0 -0
  216. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_async_client_stress_updated.py +0 -0
  217. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_auth_manager.py +0 -0
  218. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_canonical_mtls_example.py +0 -0
  219. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_cli_embed_file_json.py +0 -0
  220. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_cli_exit_codes_insecure.py +0 -0
  221. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_client_factory.py +0 -0
  222. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_client_factory_convenience.py +0 -0
  223. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_client_factory_integration.py +0 -0
  224. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_config.py +0 -0
  225. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_embed_file_aggregation_method.py +0 -0
  226. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_embed_file_output_validate.py +0 -0
  227. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_embed_immediate_mode.py +0 -0
  228. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_example_async_usage.py +0 -0
  229. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_json_embed_file_preflight.py +0 -0
  230. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_local_json_embed_file.py +0 -0
  231. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_md_embed_file_prep.py +0 -0
  232. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_security_matrix.py +0 -0
  233. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_ssl_manager.py +0 -0
  234. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_terminal_delivery_events.py +0 -0
  235. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_wait_for_job_ws_fallback.py +0 -0
  236. {embed_client-4.0.44 → embed_client-4.0.46}/tests/test_with_auth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: embed-client
3
- Version: 4.0.44
3
+ Version: 4.0.46
4
4
  Summary: Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
5
5
  Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
6
6
  License-Expression: MIT
@@ -104,7 +104,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
104
104
 
105
105
  **`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
106
106
 
107
- **Vectorization backends (server 4.0.29+):** **`embed`** and **`embed_file`** take **`backend="local"|"external"`** (omitted = the server's configured default; `external` is the macsc service). **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM). A local request while the model is not in VRAM is refused at once with `-32001 MODEL_LOADING` (the load runs in the background; retry), a backend the server mode does not admit with `-32002 BACKEND_MODE_MISMATCH`, an external failure with `-32003`. Refusals of `model_offload`/`model_load` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `backend`; external results also carry `usage`.
107
+ **Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
108
+
109
+ Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
110
+
111
+ Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
108
112
 
109
113
  ## Documentation
110
114
 
@@ -57,7 +57,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
57
57
 
58
58
  **`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
59
59
 
60
- **Vectorization backends (server 4.0.29+):** **`embed`** and **`embed_file`** take **`backend="local"|"external"`** (omitted = the server's configured default; `external` is the macsc service). **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM). A local request while the model is not in VRAM is refused at once with `-32001 MODEL_LOADING` (the load runs in the background; retry), a backend the server mode does not admit with `-32002 BACKEND_MODE_MISMATCH`, an external failure with `-32003`. Refusals of `model_offload`/`model_load` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `backend`; external results also carry `usage`.
60
+ **Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
61
+
62
+ Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
63
+
64
+ Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
61
65
 
62
66
  ## Documentation
63
67
 
@@ -27,7 +27,7 @@ try:
27
27
  __version__ = version("embed-client")
28
28
  except PackageNotFoundError:
29
29
  # Editable checkout without install metadata (e.g. some unit-test sandboxes).
30
- __version__ = "4.0.44"
30
+ __version__ = "4.0.46"
31
31
 
32
32
  __all__ = [
33
33
  "EmbeddingClient",
@@ -650,7 +650,7 @@ class EmbeddingClient:
650
650
  wait_timeout: int = 60,
651
651
  poll_interval: float = 1.0,
652
652
  use_push: bool = True,
653
- backend: Optional[str] = None,
653
+ provider: Optional[str] = None,
654
654
  ) -> Dict[str, Any]:
655
655
  """
656
656
  Generate embeddings for texts (via queue).
@@ -675,30 +675,37 @@ class EmbeddingClient:
675
675
  wait_timeout: Max time to wait (seconds); 0 = no timeout.
676
676
  poll_interval: Unused (kept for API compatibility).
677
677
  use_push: Unused; WS is always used when wait=True.
678
- backend: ``"local"`` (model on the server host) or ``"external"``
679
- (macsc) for this request; ``None`` (omitted, never injected by the
680
- client) lets the model select the backend when ``model`` is
681
- given (the server's local default model -> ``"local"``, a model
682
- of the live macsc list -> ``"external"``), else takes the
683
- server's configured default. Mode local: the local model runs on the GPU (VRAM); mode
684
- mixed: the local model is in RAM and encodes on the CPU only
685
- (never the GPU; a ``device`` of ``cuda``/``cuda:N`` is refused
686
- with -32602); mode external: no local model, only
687
- ``"external"``. A backend the server mode does not admit is
688
- refused (-32002 BACKEND_MODE_MISMATCH); in mode local after
689
- ``model_offload`` the model is held in RAM and a local request
690
- is served on the CPU from the RAM image (no load) until
691
- ``model_load``; a local request while the model is loading or
692
- not loaded at all (mode local) or not yet in RAM (mode mixed)
693
- is refused (-32001 MODEL_LOADING) and the load continues in
694
- the background, so retry it.
678
+ provider: Optional provider id of the full model id (provider +
679
+ model). ``"local"`` is the server's own model; any other id is
680
+ a live macsc vectorization provider (for example ``"openai"``).
681
+ Sent only when not ``None`` (never injected by the client).
682
+ Resolution on the server (default first): provider given ->
683
+ must be known (else UNKNOWN_PROVIDER); model omitted -> the
684
+ default model, which must belong to that provider (else
685
+ UNKNOWN_MODEL). Provider omitted and model omitted -> the
686
+ default pair. Provider omitted and model given -> the default
687
+ provider is tried first (if it lists the model it is used,
688
+ macsc is not consulted for a local default); otherwise the
689
+ other providers are searched: exactly one offering the model
690
+ is used, several -> PROVIDER_REQUIRED, none -> UNKNOWN_MODEL.
691
+ ``dimension`` omitted -> the entry's default dimension; given
692
+ -> must satisfy its supported dimensions (else
693
+ UNSUPPORTED_DIMENSION). Errors arrive with ``error.data.code``
694
+ and ``error.data.kind`` unchanged: -32602 UNKNOWN_PROVIDER,
695
+ UNKNOWN_MODEL, UNSUPPORTED_DIMENSION, PROVIDER_REQUIRED;
696
+ -32003 EXTERNAL_UNAVAILABLE, EXTERNAL_UPSTREAM_FAILURE,
697
+ EXTERNAL_BAD_RESPONSE, EXTERNAL_INVALID_REQUEST; -32001
698
+ MODEL_LOADING (retry); -32004 OWN_MODEL_DISABLED; -32005
699
+ GPU_DISABLED; -32603 MODEL_LOAD_FAILED, NO_GPU_AVAILABLE.
700
+ ``device``, ``aggregation_method`` and ``parts`` are accepted
701
+ only with the effective provider ``"local"``.
695
702
 
696
703
  Returns:
697
704
  If wait=False: ``{"job_id", "status", "message"}``; when the server hit
698
705
  its synchronous execution cap and fell back to the queue, responses may
699
706
  include ``queued_after_timeout: true`` (mcp-proxy-adapter >= 8.10).
700
707
  If wait=True: {"results": [...], "model", "dimension"} (and optional
701
- "device", "backend" and timing fields such as ``timing_total_seconds``,
708
+ "device", "provider", "backend" and timing fields such as ``timing_total_seconds``,
702
709
  ``timing_encode_seconds``, ``timing_tokenization_seconds``,
703
710
  ``timing_median_per_text_encode_seconds``), matching server embed
704
711
  result data.
@@ -742,8 +749,8 @@ class EmbeddingClient:
742
749
  params["aggregation_method"] = aggregation_method
743
750
  if parts is not None:
744
751
  params["parts"] = parts
745
- if backend is not None:
746
- params["backend"] = backend
752
+ if provider is not None:
753
+ params["provider"] = provider
747
754
 
748
755
  # When wait=True use execute_async("embed_execute") for in-process execution
749
756
  # (no queue, no worker spawn) to avoid large per-request delay.
@@ -1113,7 +1120,7 @@ class EmbeddingClient:
1113
1120
  device: Optional[str] = None,
1114
1121
  error_policy: Optional[str] = None,
1115
1122
  aggregation_method: Optional[str] = None,
1116
- backend: Optional[str] = None,
1123
+ provider: Optional[str] = None,
1117
1124
  wait: bool = True,
1118
1125
  wait_timeout: int = 600,
1119
1126
  download_to: Optional[str] = None,
@@ -1145,8 +1152,9 @@ class EmbeddingClient:
1145
1152
  aggregation_method: Same semantics as :meth:`embed`: resolved by
1146
1153
  priority call -> config -> constant when omitted; applied
1147
1154
  per-item, one line/array entry at a time.
1148
- backend: Same semantics as :meth:`embed` (``"local"``/``"external"``;
1149
- ``None`` = the model selects the backend, else the server default).
1155
+ provider: Same semantics as :meth:`embed` (``"local"`` or a live
1156
+ macsc provider id; sent only when not ``None``; resolution order
1157
+ and error codes as documented there).
1150
1158
  wait: If True, block until job completes (WebSocket).
1151
1159
  wait_timeout: Seconds for wait (0 treated as 600 for WS wait).
1152
1160
  download_to: If set, write the downloaded result JSON to this path. If
@@ -1194,8 +1202,8 @@ class EmbeddingClient:
1194
1202
  params["error_policy"] = EMBED_COMMAND_SCHEMA_DEFAULT_ERROR_POLICY
1195
1203
  if aggregation_method is not None:
1196
1204
  params["aggregation_method"] = aggregation_method
1197
- if backend is not None:
1198
- params["backend"] = backend
1205
+ if provider is not None:
1206
+ params["provider"] = provider
1199
1207
 
1200
1208
  response = await self.client.jsonrpc_call("embed_file", params)
1201
1209
  if "error" in response:
@@ -1396,12 +1404,15 @@ class EmbeddingClient:
1396
1404
  List available models (shape matches server models command result.data).
1397
1405
 
1398
1406
  Returns:
1399
- {"models": [...], "mode", "default_backend", "external"}; each entry has
1400
- name, dimension, supported_dimensions, max_tokens, backend and (local
1401
- entries) residency. Mode local lists the one local default model (on
1402
- the GPU), mode external the live macsc list (no local model), mode
1403
- mixed the local default (in RAM, on the CPU) then the macsc list.
1404
- The method takes no parameters.
1407
+ ``{"use_own_model": "none"|"ram"|"gpu", "default": {provider,
1408
+ model}, "external": {configured, service}, "models": [...]}``; each
1409
+ entry has name, provider, dimension, supported_dimensions,
1410
+ max_tokens, backend and (local entries) residency. Entries are
1411
+ unique by (provider, name). The local entry is listed only when
1412
+ ``use_own_model`` is not ``"none"``; macsc entries are the live
1413
+ list of providers with vectorization. macsc configured but down
1414
+ raises -32003 EXTERNAL_UNAVAILABLE (no static fallback). The method
1415
+ takes no parameters.
1405
1416
 
1406
1417
  Raises:
1407
1418
  EmbedClientError: If models request fails
@@ -1421,19 +1432,19 @@ class EmbeddingClient:
1421
1432
  return result.get("data", {})
1422
1433
 
1423
1434
  async def default_model(self) -> Dict[str, Any]:
1424
- """Effective default model of the server and its dimension.
1435
+ """Default pair of the server (provider + model) and its dimension.
1425
1436
 
1426
- The server takes no parameters. Mode local: ``embedding.model_name``;
1427
- mode mixed: the model of ``default_backend`` (local ``embedding.model_name``
1428
- or the external default); mode external: the configured external default
1429
- validated against the live macsc list, with its resolved dimension. No
1430
- model is loaded.
1437
+ The server takes no parameters. The default pair is the configured
1438
+ default provider and model; the dimension is the configured default
1439
+ dimension, else the entry's default dimension (local: the loaded
1440
+ dimension). Calls that name no provider use this pair.
1431
1441
 
1432
1442
  Returns:
1433
- ``{model, dimension}``.
1443
+ Exactly ``{model, dimension, provider}``.
1434
1444
 
1435
1445
  Raises:
1436
- EmbedAPIError: -32003 EXTERNAL_* when macsc fails or does not list the
1446
+ EmbedAPIError: -32001 MODEL_LOADING (local default not loaded yet),
1447
+ -32003 EXTERNAL_* when macsc fails or does not list the
1437
1448
  configured default model.
1438
1449
  """
1439
1450
  return await self._service_command("default_model", {})
@@ -1464,10 +1475,10 @@ class EmbeddingClient:
1464
1475
  The hold lasts until ``model_load`` (or a model selection): neither the
1465
1476
  GPU watcher nor a local request moves it back; local requests are
1466
1477
  served on the CPU from the RAM image meanwhile. Idempotent.
1467
- Mode local: VRAM -> RAM, the GPU is released. Mode mixed: the model is
1468
- only ever in the RAM image, so the call is an idempotent success
1469
- (residency ``ram``, device ``cpu``, ``changed`` false). Mode external:
1470
- no local model, refused with -32002.
1478
+ use_own_model ``gpu``: VRAM -> RAM, the GPU is released. ``ram``: an
1479
+ idempotent success (residency ``ram``, device ``cpu``, ``changed``
1480
+ false). ``none``: refused with -32004 OWN_MODEL_DISABLED. The command
1481
+ takes no ``provider``.
1471
1482
 
1472
1483
  Args:
1473
1484
  model: Local model to offload; defaults to the resident model.
@@ -1478,7 +1489,7 @@ class EmbeddingClient:
1478
1489
 
1479
1490
  Raises:
1480
1491
  EmbedAPIError: -32602 invalid parameter or MODEL_NOT_RESIDENT,
1481
- -32001 MODEL_LOADING, -32002 BACKEND_MODE_MISMATCH (mode external).
1492
+ -32001 MODEL_LOADING, -32004 OWN_MODEL_DISABLED.
1482
1493
  """
1483
1494
  params: Dict[str, Any] = {}
1484
1495
  if model is not None:
@@ -1493,11 +1504,9 @@ class EmbeddingClient:
1493
1504
  ) -> Dict[str, Any]:
1494
1505
  """Move a local model RAM -> VRAM (or load it from disk).
1495
1506
 
1496
- Mode local: the model goes onto the GPU. Mode mixed has no VRAM:
1497
- ``device`` ``"cuda"``/``"cuda:N"`` is refused with -32602 (violation
1498
- ``value``, field ``device``) and an unspecified device only brings the
1499
- model into RAM (residency ``"ram"``, device ``"cpu"``). Mode external:
1500
- no local model, refused with -32002.
1507
+ use_own_model ``gpu``: the model goes onto the GPU. ``ram``: refused
1508
+ with -32005 GPU_DISABLED (any arguments). ``none``: refused with -32004
1509
+ OWN_MODEL_DISABLED. The command takes no ``provider``.
1501
1510
 
1502
1511
  Args:
1503
1512
  model: Local model to load; defaults to the server's ``embedding.model_name``.
@@ -1507,13 +1516,12 @@ class EmbeddingClient:
1507
1516
  ``True`` blocks until the model is in VRAM or the load failed.
1508
1517
 
1509
1518
  Returns:
1510
- ``{model, dimension, residency: "loading"|"vram" (mode local) or
1511
- "loading"|"ram" (mode mixed), previous_residency, device, changed,
1512
- async}``.
1519
+ ``{model, dimension, residency: "loading"|"vram",
1520
+ previous_residency, device, changed, async}``.
1513
1521
 
1514
1522
  Raises:
1515
1523
  EmbedAPIError: -32602 invalid parameter, -32603 NO_GPU_AVAILABLE or
1516
- MODEL_LOAD_FAILED, -32002 BACKEND_MODE_MISMATCH (mode external).
1524
+ MODEL_LOAD_FAILED, -32004 OWN_MODEL_DISABLED, -32005 GPU_DISABLED.
1517
1525
  """
1518
1526
  params: Dict[str, Any] = {}
1519
1527
  if model is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: embed-client
3
- Version: 4.0.44
3
+ Version: 4.0.46
4
4
  Summary: Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
5
5
  Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
6
6
  License-Expression: MIT
@@ -104,7 +104,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
104
104
 
105
105
  **`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
106
106
 
107
- **Vectorization backends (server 4.0.29+):** **`embed`** and **`embed_file`** take **`backend="local"|"external"`** (omitted = the server's configured default; `external` is the macsc service). **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM). A local request while the model is not in VRAM is refused at once with `-32001 MODEL_LOADING` (the load runs in the background; retry), a backend the server mode does not admit with `-32002 BACKEND_MODE_MISMATCH`, an external failure with `-32003`. Refusals of `model_offload`/`model_load` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `backend`; external results also carry `usage`.
107
+ **Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
108
+
109
+ Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
110
+
111
+ Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
108
112
 
109
113
  ## Documentation
110
114
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "embed-client"
7
- version = "4.0.44"
7
+ version = "4.0.46"
8
8
  description = """Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
9
9
 
10
10
  Public API highlights:
@@ -0,0 +1,245 @@
1
+ """
2
+ Client surface of the server's provider contract: the ``provider`` parameter of
3
+ embed / embed_file (no ``backend``), default_model / models and the
4
+ model_offload / model_load commands.
5
+
6
+ Author: Vasiliy Zdanovskiy
7
+ email: vasilyvz@gmail.com
8
+ """
9
+
10
+ import inspect
11
+ from typing import Optional
12
+ from unittest.mock import AsyncMock
13
+
14
+ import pytest
15
+
16
+ from embed_client.embedding_client import EmbeddingClient
17
+ from embed_client.exceptions import EmbedAPIError
18
+
19
+
20
+ def _client() -> EmbeddingClient:
21
+ return EmbeddingClient(protocol="http", host="127.0.0.1", port=8080)
22
+
23
+
24
+ def _ok(data):
25
+ return {"result": {"success": True, "data": data}}
26
+
27
+
28
+ @pytest.mark.asyncio
29
+ async def test_embed_forwards_provider_only_when_supplied():
30
+ client = _client()
31
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
32
+
33
+ await client.embed(["a"], provider="openai", model="text-embedding-3-small")
34
+ _method, params = client.client.jsonrpc_call.await_args.args
35
+ assert params["provider"] == "openai"
36
+ assert params["model"] == "text-embedding-3-small"
37
+
38
+ await client.embed(["a"])
39
+ _method, params = client.client.jsonrpc_call.await_args.args
40
+ assert "provider" not in params
41
+ assert "backend" not in params
42
+
43
+
44
+ @pytest.mark.asyncio
45
+ async def test_embed_file_forwards_provider_only_when_supplied():
46
+ client = _client()
47
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
48
+
49
+ await client.embed_file("/srv/input.txt", provider="local", wait=False)
50
+ method, params = client.client.jsonrpc_call.await_args.args
51
+ assert method == "embed_file"
52
+ assert params["provider"] == "local"
53
+
54
+ await client.embed_file("/srv/input.txt", wait=False)
55
+ _method, params = client.client.jsonrpc_call.await_args.args
56
+ assert "provider" not in params
57
+ assert "backend" not in params
58
+
59
+
60
+ @pytest.mark.asyncio
61
+ async def test_embed_wait_true_carries_provider_to_embed_execute():
62
+ client = _client()
63
+ seen = {}
64
+
65
+ async def fake(params, wait_timeout):
66
+ seen.update(params)
67
+ return {
68
+ "results": [],
69
+ "model": "m",
70
+ "dimension": 1,
71
+ "provider": "openai",
72
+ "backend": "external",
73
+ }
74
+
75
+ client._embed_via_execute_async = fake
76
+ result = await client.embed(["a"], provider="openai", wait=True)
77
+ assert seen["provider"] == "openai"
78
+ assert "backend" not in seen
79
+ assert result["provider"] == "openai"
80
+ assert result["backend"] == "external"
81
+
82
+
83
+ @pytest.mark.asyncio
84
+ async def test_backend_kwarg_is_removed():
85
+ client = _client()
86
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
87
+
88
+ with pytest.raises(TypeError):
89
+ await client.embed(["a"], backend="external")
90
+ with pytest.raises(TypeError):
91
+ await client.embed(["a"], backend="local", wait=True)
92
+ with pytest.raises(TypeError):
93
+ await client.embed_file("/srv/input.txt", backend="local", wait=False)
94
+ client.client.jsonrpc_call.assert_not_awaited()
95
+ for name in ("embed", "embed_file"):
96
+ assert "backend" not in inspect.signature(getattr(client, name)).parameters
97
+ assert "use_own_model" not in inspect.signature(getattr(client, name)).parameters
98
+ assert getattr(client, name).__annotations__["provider"] == Optional[str]
99
+
100
+
101
+ @pytest.mark.asyncio
102
+ async def test_raw_parameter_invocation_still_sends_backend():
103
+ client = _client()
104
+ error = {"code": -32602, "data": {"violation": "unknown", "field": "backend"}}
105
+ client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
106
+
107
+ response = await client.jsonrpc("embed", {"texts": ["a"], "backend": "local"})
108
+ method, params = client.client.jsonrpc_call.await_args.args
109
+ assert (method, params) == ("embed", {"texts": ["a"], "backend": "local"})
110
+ assert response == {"error": error}
111
+
112
+
113
+ @pytest.mark.asyncio
114
+ async def test_model_offload_builds_params_and_returns_data():
115
+ client = _client()
116
+ data = {"model": "m", "residency": "ram", "changed": True}
117
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
118
+
119
+ assert await client.model_offload() == data
120
+ method, params = client.client.jsonrpc_call.await_args.args
121
+ assert (method, params) == ("model_offload", {})
122
+
123
+ await client.model_offload("all-MiniLM-L6-v2")
124
+ _method, params = client.client.jsonrpc_call.await_args.args
125
+ assert params == {"model": "all-MiniLM-L6-v2"}
126
+
127
+
128
+ @pytest.mark.asyncio
129
+ async def test_model_load_builds_params():
130
+ client = _client()
131
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok({"residency": "loading"}))
132
+
133
+ await client.model_load()
134
+ method, params = client.client.jsonrpc_call.await_args.args
135
+ assert (method, params) == ("model_load", {})
136
+
137
+ await client.model_load("all-MiniLM-L6-v2", device="cuda:0", wait=True)
138
+ _method, params = client.client.jsonrpc_call.await_args.args
139
+ assert params == {"model": "all-MiniLM-L6-v2", "device": "cuda:0", "wait": True}
140
+
141
+ await client.model_load(wait=False)
142
+ _method, params = client.client.jsonrpc_call.await_args.args
143
+ assert params == {"wait": False}
144
+
145
+
146
+ @pytest.mark.asyncio
147
+ async def test_refusals_arrive_as_api_errors_with_the_server_error():
148
+ client = _client()
149
+ refusal = {
150
+ "code": -32004,
151
+ "message": "own model is disabled (use_own_model none)",
152
+ "data": {
153
+ "code": "OWN_MODEL_DISABLED",
154
+ "use_own_model": "none",
155
+ "command": "model_offload",
156
+ },
157
+ }
158
+ client.client.jsonrpc_call = AsyncMock(
159
+ return_value={"result": {"success": False, "error": refusal}}
160
+ )
161
+ with pytest.raises(EmbedAPIError) as info:
162
+ await client.model_offload()
163
+ assert info.value.error == refusal
164
+
165
+ client.client.jsonrpc_call = AsyncMock(return_value={"error": refusal})
166
+ with pytest.raises(EmbedAPIError) as info:
167
+ await client.model_load(wait=True)
168
+ assert info.value.error == refusal
169
+
170
+
171
+ @pytest.mark.asyncio
172
+ async def test_default_model_sends_no_parameters_and_returns_exact_triple():
173
+ client = _client()
174
+ data = {"model": "BAAI/bge-m3", "dimension": 1024, "provider": "local"}
175
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
176
+
177
+ result = await client.default_model()
178
+ assert result == data
179
+ assert set(result) == {"model", "dimension", "provider"}
180
+ method, params = client.client.jsonrpc_call.await_args.args
181
+ assert (method, params) == ("default_model", {})
182
+
183
+
184
+ @pytest.mark.asyncio
185
+ async def test_default_model_surfaces_error_code_and_kind():
186
+ client = _client()
187
+ error = {
188
+ "code": -32003,
189
+ "message": "x",
190
+ "data": {"code": "EXTERNAL_UNAVAILABLE", "service": "macsc", "reason": "connect"},
191
+ }
192
+ client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
193
+
194
+ with pytest.raises(EmbedAPIError) as info:
195
+ await client.default_model()
196
+ assert info.value.error == error
197
+ assert info.value.error["data"]["code"] == "EXTERNAL_UNAVAILABLE"
198
+
199
+
200
+ @pytest.mark.asyncio
201
+ async def test_resolution_error_keeps_data_code_and_kind():
202
+ client = _client()
203
+ error = {
204
+ "code": -32602,
205
+ "message": "unknown provider",
206
+ "data": {
207
+ "code": "UNKNOWN_PROVIDER",
208
+ "kind": "unknown_provider",
209
+ "violation": "value",
210
+ "field": "provider",
211
+ "provider_id": "nope",
212
+ "available": ["local", "openai"],
213
+ },
214
+ }
215
+ client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
216
+ with pytest.raises(Exception) as info:
217
+ await client.embed(["a"], provider="nope")
218
+ assert "UNKNOWN_PROVIDER" in str(info.value)
219
+ assert "unknown_provider" in str(info.value)
220
+
221
+
222
+ @pytest.mark.asyncio
223
+ async def test_models_returns_payload_unchanged():
224
+ client = _client()
225
+ data = {
226
+ "use_own_model": "ram",
227
+ "default": {"provider": "local", "model": "BAAI/bge-m3"},
228
+ "external": {"configured": True, "service": "macsc"},
229
+ "models": [
230
+ {
231
+ "name": "BAAI/bge-m3",
232
+ "provider": "local",
233
+ "dimension": 1024,
234
+ "supported_dimensions": {"fixed": 1024},
235
+ "max_tokens": 8192,
236
+ "backend": "local",
237
+ "residency": "ram",
238
+ }
239
+ ],
240
+ }
241
+ client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
242
+
243
+ assert await client.models() == data
244
+ method, params = client.client.jsonrpc_call.await_args.args
245
+ assert (method, params) == ("models", {})