embed-client 4.0.28__tar.gz → 4.0.30__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.
- {embed_client-4.0.28/embed_client.egg-info → embed_client-4.0.30}/PKG-INFO +3 -1
- {embed_client-4.0.28 → embed_client-4.0.30}/README.md +2 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/__init__.py +1 -1
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/embedding_client.py +93 -2
- {embed_client-4.0.28 → embed_client-4.0.30/embed_client.egg-info}/PKG-INFO +3 -1
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client.egg-info/SOURCES.txt +1 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/pyproject.toml +1 -1
- embed_client-4.0.30/tests/test_vectorization_modes_client.py +120 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/CONFIGURATION.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/LICENSE +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/MANIFEST.in +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/basic_auth.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_8001_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_correct.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_token.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_token_correct.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_token_roles_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/http_token_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_8001_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_api_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_token.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_token_8001.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_token_roles_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/https_token_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/jwt.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_8001.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_8001_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_correct.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_roles_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_test.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/mtls_via_adapter.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_http_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_http_token.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_http_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_https_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_https_token.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_https_token_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_mtls_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_mtls_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_server_http.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_server_https.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/configs/test_server_mtls.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/BUGREPORT_queue_manager_daemonic.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/IDENTIFIER_ANALYSIS_REPORT.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/PROPOSAL_SERVER_REQUEST_COALESCING.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/PROPOSAL_TWO_CHANNEL_OR_PUSH.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/SERVER_MODES_AND_CLIENT.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/api_format.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/client_integration_guide.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/coverage_report.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/error_500_analysis.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/error_handling_complete.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/error_handling_issue.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/README.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/example_global_step/example_tactical_step/example_atomic_step.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/example_global_step/example_tactical_step/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/example_global_step/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/freeze-migration-baseline-evidence-links.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-01.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-02.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-03.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-04.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-05.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-06.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-07.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-08.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-09.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-10.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-11.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-12.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-13.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-14.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-15.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-16.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-17.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-18.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-19.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-20.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-21.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-22.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/plan.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/PARALLEL_WAVES.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-01-port-constants-and-exceptions.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-03-port-embedding-client-core.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/README.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_automated_security_matrix/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_canonical_mtls_real_server_gate/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_localhost_vectorization/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_packaging_and_prereqs/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_pypi_publication/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_surviving_examples_executable/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv01-security-matrix.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv02-vectorization.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv03-broken-example.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv04-canonical-gate.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv05-packaging.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv06-duplicate-version-or-auth.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv01-execute-automated-security-matrix.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv02-execute-localhost-vectorization-mtls-8001.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv03-execute-surviving-examples-sweep.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-execute-canonical-mtls-real-server-gate.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-supplementary-pytest-canonical-example-contract.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv05-build-artifacts-twine-version-gate.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv06-pypi-upload.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/spec.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/align-package-version-with-pyproject-metadata.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/canonical-localhost-8001-mtls-example-and-execution-tests.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-pytest-configuration-single-source.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-redundant-coverage-test-modules.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/extract-async-client-adapter-tests-remove-legacy-aiohttp.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/fix-or-remove-embed-client-auth-examples.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/normalize-pyproject-runtime-deps-and-optional-extras.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/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
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/tasks/tsc_linter_exclusions_and_migration_inventory.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/tech_spec/branches/documentation_normalization/README.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/tech_spec/branches/documentation_normalization/tasks/doc_alignment_verification_and_closure.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/tech_spec/branches/documentation_normalization/tasks/doc_guides_examples_canonical_mtls.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/tech_spec/branches/documentation_normalization/tasks/doc_legacy_tree_prune_and_governance.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/docs/tech_spec/branches/documentation_normalization/tasks/doc_root_metadata_and_pypi_surface.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/__main__.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/adapter_config_factory.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/adapter_config_normalizer.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/adapter_generator_bridge.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/auth.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/cli_core.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/client_factory.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/client_factory_examples.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/client_factory_helpers.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_defaults.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_examples.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_generator.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_generator_cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_presets.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_validator.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/config_validator_cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/constants.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/demo_cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/demo_security_cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/embed_file_output_validate.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/embed_file_status_store.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/embedding_client_helpers.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/example_async_usage.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/example_async_usage_demo.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/example_async_usage_ru.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/example_async_usage_ru_demo.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/exceptions.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/identifier_types.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/json_embed_file_preflight.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/local_json_embed_file.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/md_embed_file_prep.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/response_normalizer.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/response_parsers.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/security_cli.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/security_cli_core.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/ssl_examples.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client/ssl_manager.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client.egg-info/dependency_links.txt +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client.egg-info/entry_points.txt +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client.egg-info/requires.txt +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/embed_client.egg-info/top_level.txt +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/README.md +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/__init__.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/async_testing_client_example.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/canonical_mtls_localhost_8001.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/configs/http_simple.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/configs/https_token.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/configs/mtls_roles.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/data/embed_file_json_array_sample.json +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/embed_file_json_local.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/security_examples.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/examples/security_examples_ru.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/setup.cfg +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_adapter_integration.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_adapter_phase1.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_adapter_phase2.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_all_security_modes.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_adapter.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_real.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_real_fixtures.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_stress.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_stress_new.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_async_client_stress_updated.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_auth_manager.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_canonical_mtls_example.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_cli_embed_file_json.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_cli_exit_codes_insecure.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_client_factory.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_client_factory_convenience.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_client_factory_integration.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_config.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_embed_file_aggregation_method.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_embed_file_output_validate.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_embed_immediate_mode.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_example_async_usage.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_json_embed_file_preflight.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_local_json_embed_file.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_md_embed_file_prep.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_security_matrix.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_ssl_manager.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/tests/test_wait_for_job_ws_fallback.py +0 -0
- {embed_client-4.0.28 → embed_client-4.0.30}/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.
|
|
3
|
+
Version: 4.0.30
|
|
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,6 +104,8 @@ 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`.
|
|
108
|
+
|
|
107
109
|
## Documentation
|
|
108
110
|
|
|
109
111
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -57,6 +57,8 @@ 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`.
|
|
61
|
+
|
|
60
62
|
## Documentation
|
|
61
63
|
|
|
62
64
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -636,6 +636,7 @@ class EmbeddingClient:
|
|
|
636
636
|
wait_timeout: int = 60,
|
|
637
637
|
poll_interval: float = 1.0,
|
|
638
638
|
use_push: bool = True,
|
|
639
|
+
backend: Optional[str] = None,
|
|
639
640
|
) -> Dict[str, Any]:
|
|
640
641
|
"""
|
|
641
642
|
Generate embeddings for texts (via queue).
|
|
@@ -660,13 +661,19 @@ class EmbeddingClient:
|
|
|
660
661
|
wait_timeout: Max time to wait (seconds); 0 = no timeout.
|
|
661
662
|
poll_interval: Unused (kept for API compatibility).
|
|
662
663
|
use_push: Unused; WS is always used when wait=True.
|
|
664
|
+
backend: ``"local"`` (model on the server host) or ``"external"``
|
|
665
|
+
(macsc) for this request; ``None`` takes the server's configured
|
|
666
|
+
default. A backend the server mode does not admit is refused
|
|
667
|
+
(-32002 BACKEND_MODE_MISMATCH); a local request while the model
|
|
668
|
+
is not in VRAM is refused (-32001 MODEL_LOADING) and the load
|
|
669
|
+
continues in the background, so retry it.
|
|
663
670
|
|
|
664
671
|
Returns:
|
|
665
672
|
If wait=False: ``{"job_id", "status", "message"}``; when the server hit
|
|
666
673
|
its synchronous execution cap and fell back to the queue, responses may
|
|
667
674
|
include ``queued_after_timeout: true`` (mcp-proxy-adapter >= 8.10).
|
|
668
675
|
If wait=True: {"results": [...], "model", "dimension"} (and optional
|
|
669
|
-
"device" and timing fields such as ``timing_total_seconds``,
|
|
676
|
+
"device", "backend" and timing fields such as ``timing_total_seconds``,
|
|
670
677
|
``timing_encode_seconds``, ``timing_tokenization_seconds``,
|
|
671
678
|
``timing_median_per_text_encode_seconds``), matching server embed
|
|
672
679
|
result data.
|
|
@@ -710,6 +717,8 @@ class EmbeddingClient:
|
|
|
710
717
|
params["aggregation_method"] = aggregation_method
|
|
711
718
|
if parts is not None:
|
|
712
719
|
params["parts"] = parts
|
|
720
|
+
if backend is not None:
|
|
721
|
+
params["backend"] = backend
|
|
713
722
|
|
|
714
723
|
# When wait=True use execute_async("embed_execute") for in-process execution
|
|
715
724
|
# (no queue, no worker spawn) to avoid large per-request delay.
|
|
@@ -1069,6 +1078,7 @@ class EmbeddingClient:
|
|
|
1069
1078
|
device: Optional[str] = None,
|
|
1070
1079
|
error_policy: Optional[str] = None,
|
|
1071
1080
|
aggregation_method: Optional[str] = None,
|
|
1081
|
+
backend: Optional[str] = None,
|
|
1072
1082
|
wait: bool = True,
|
|
1073
1083
|
wait_timeout: int = 600,
|
|
1074
1084
|
download_to: Optional[str] = None,
|
|
@@ -1100,6 +1110,8 @@ class EmbeddingClient:
|
|
|
1100
1110
|
aggregation_method: Same semantics as :meth:`embed`: resolved by
|
|
1101
1111
|
priority call -> config -> constant when omitted; applied
|
|
1102
1112
|
per-item, one line/array entry at a time.
|
|
1113
|
+
backend: Same semantics as :meth:`embed` (``"local"``/``"external"``;
|
|
1114
|
+
``None`` = server default).
|
|
1103
1115
|
wait: If True, block until job completes (WebSocket).
|
|
1104
1116
|
wait_timeout: Seconds for wait (0 treated as 600 for WS wait).
|
|
1105
1117
|
download_to: If set, write the downloaded result JSON to this path. If
|
|
@@ -1147,6 +1159,8 @@ class EmbeddingClient:
|
|
|
1147
1159
|
params["error_policy"] = EMBED_COMMAND_SCHEMA_DEFAULT_ERROR_POLICY
|
|
1148
1160
|
if aggregation_method is not None:
|
|
1149
1161
|
params["aggregation_method"] = aggregation_method
|
|
1162
|
+
if backend is not None:
|
|
1163
|
+
params["backend"] = backend
|
|
1150
1164
|
|
|
1151
1165
|
response = await self.client.jsonrpc_call("embed_file", params)
|
|
1152
1166
|
if "error" in response:
|
|
@@ -1347,7 +1361,9 @@ class EmbeddingClient:
|
|
|
1347
1361
|
List available models (shape matches server models command result.data).
|
|
1348
1362
|
|
|
1349
1363
|
Returns:
|
|
1350
|
-
{"models": [...]
|
|
1364
|
+
{"models": [...], "mode", "default_backend", "external"}; each entry has
|
|
1365
|
+
name, dimension, supported_dimensions, max_tokens, backend and (local
|
|
1366
|
+
entries) residency.
|
|
1351
1367
|
|
|
1352
1368
|
Raises:
|
|
1353
1369
|
EmbedClientError: If models request fails
|
|
@@ -1366,6 +1382,81 @@ class EmbeddingClient:
|
|
|
1366
1382
|
|
|
1367
1383
|
return result.get("data", {})
|
|
1368
1384
|
|
|
1385
|
+
async def _service_command(
|
|
1386
|
+
self, command: str, params: Dict[str, Any]
|
|
1387
|
+
) -> Dict[str, Any]:
|
|
1388
|
+
"""Run a synchronous service command and return its ``data``.
|
|
1389
|
+
|
|
1390
|
+
A refusal (error response or ``success: false``) is raised as
|
|
1391
|
+
:class:`EmbedAPIError` carrying the server's own error object, whose
|
|
1392
|
+
``code``/``data.code`` name the refusal (for example MODEL_LOADING).
|
|
1393
|
+
"""
|
|
1394
|
+
response = await self.client.jsonrpc_call(command, params)
|
|
1395
|
+
if isinstance(response, dict) and response.get("error") is not None:
|
|
1396
|
+
raise EmbedAPIError(response["error"])
|
|
1397
|
+
result = response.get("result") if isinstance(response, dict) else None
|
|
1398
|
+
if not isinstance(result, dict):
|
|
1399
|
+
raise EmbedAPIError(f"Command {command!r} returned {response!r}")
|
|
1400
|
+
if result.get("success") is False:
|
|
1401
|
+
raise EmbedAPIError(result.get("error") or result)
|
|
1402
|
+
data = result.get("data")
|
|
1403
|
+
return data if isinstance(data, dict) else result
|
|
1404
|
+
|
|
1405
|
+
async def model_offload(self, model: Optional[str] = None) -> Dict[str, Any]:
|
|
1406
|
+
"""Move the resident local model VRAM -> RAM and pin it there.
|
|
1407
|
+
|
|
1408
|
+
The GPU watcher does not move it back; ``model_load`` (or a local
|
|
1409
|
+
request, which starts the load in the background) does. Idempotent.
|
|
1410
|
+
Available in server modes ``local`` and ``mixed``.
|
|
1411
|
+
|
|
1412
|
+
Args:
|
|
1413
|
+
model: Local model to offload; defaults to the resident model.
|
|
1414
|
+
|
|
1415
|
+
Returns:
|
|
1416
|
+
``{model, dimension, residency: "ram", previous_residency, device:
|
|
1417
|
+
"cpu", changed, vram_released_mb}``.
|
|
1418
|
+
|
|
1419
|
+
Raises:
|
|
1420
|
+
EmbedAPIError: -32602 invalid parameter or MODEL_NOT_RESIDENT,
|
|
1421
|
+
-32001 MODEL_LOADING, -32002 BACKEND_MODE_MISMATCH (mode external).
|
|
1422
|
+
"""
|
|
1423
|
+
params: Dict[str, Any] = {}
|
|
1424
|
+
if model is not None:
|
|
1425
|
+
params["model"] = model
|
|
1426
|
+
return await self._service_command("model_offload", params)
|
|
1427
|
+
|
|
1428
|
+
async def model_load(
|
|
1429
|
+
self,
|
|
1430
|
+
model: Optional[str] = None,
|
|
1431
|
+
device: Optional[str] = None,
|
|
1432
|
+
wait: Optional[bool] = None,
|
|
1433
|
+
) -> Dict[str, Any]:
|
|
1434
|
+
"""Move a local model RAM -> VRAM (or load it from disk).
|
|
1435
|
+
|
|
1436
|
+
Args:
|
|
1437
|
+
model: Local model to load; defaults to the server's ``embedding.model_name``.
|
|
1438
|
+
device: ``"auto"`` (server default), ``"cuda"`` or ``"cuda:N"``.
|
|
1439
|
+
wait: ``False`` (server default) returns at once with residency
|
|
1440
|
+
``"loading"`` while the load continues in the background;
|
|
1441
|
+
``True`` blocks until the model is in VRAM or the load failed.
|
|
1442
|
+
|
|
1443
|
+
Returns:
|
|
1444
|
+
``{model, dimension, residency: "loading"|"vram", previous_residency,
|
|
1445
|
+
device, changed, async}``.
|
|
1446
|
+
|
|
1447
|
+
Raises:
|
|
1448
|
+
EmbedAPIError: -32602 invalid parameter, -32603 NO_GPU_AVAILABLE or
|
|
1449
|
+
MODEL_LOAD_FAILED, -32002 BACKEND_MODE_MISMATCH (mode external).
|
|
1450
|
+
"""
|
|
1451
|
+
params: Dict[str, Any] = {}
|
|
1452
|
+
if model is not None:
|
|
1453
|
+
params["model"] = model
|
|
1454
|
+
if device is not None:
|
|
1455
|
+
params["device"] = device
|
|
1456
|
+
if wait is not None:
|
|
1457
|
+
params["wait"] = wait
|
|
1458
|
+
return await self._service_command("model_load", params)
|
|
1459
|
+
|
|
1369
1460
|
async def list_commands(self) -> Dict[str, Any]:
|
|
1370
1461
|
"""
|
|
1371
1462
|
List available commands.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: embed-client
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.30
|
|
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,6 +104,8 @@ 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`.
|
|
108
|
+
|
|
107
109
|
## Documentation
|
|
108
110
|
|
|
109
111
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "embed-client"
|
|
7
|
-
version = "4.0.
|
|
7
|
+
version = "4.0.30"
|
|
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,120 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Client surface of the server's vectorization modes: the ``backend`` parameter of
|
|
3
|
+
embed / embed_file and the model_offload / model_load commands.
|
|
4
|
+
|
|
5
|
+
Author: Vasiliy Zdanovskiy
|
|
6
|
+
email: vasilyvz@gmail.com
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from unittest.mock import AsyncMock
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
|
+
|
|
13
|
+
from embed_client.embedding_client import EmbeddingClient
|
|
14
|
+
from embed_client.exceptions import EmbedAPIError
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _client() -> EmbeddingClient:
|
|
18
|
+
return EmbeddingClient(protocol="http", host="127.0.0.1", port=8080)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _ok(data):
|
|
22
|
+
return {"result": {"success": True, "data": data}}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest.mark.asyncio
|
|
26
|
+
async def test_embed_forwards_backend_only_when_supplied():
|
|
27
|
+
client = _client()
|
|
28
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
|
|
29
|
+
|
|
30
|
+
await client.embed(["a"], backend="external")
|
|
31
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
32
|
+
assert params["backend"] == "external"
|
|
33
|
+
|
|
34
|
+
await client.embed(["a"])
|
|
35
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
36
|
+
assert "backend" not in params
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.mark.asyncio
|
|
40
|
+
async def test_embed_file_forwards_backend_only_when_supplied():
|
|
41
|
+
client = _client()
|
|
42
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
|
|
43
|
+
|
|
44
|
+
await client.embed_file("/srv/input.txt", backend="local", wait=False)
|
|
45
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
46
|
+
assert method == "embed_file"
|
|
47
|
+
assert params["backend"] == "local"
|
|
48
|
+
|
|
49
|
+
await client.embed_file("/srv/input.txt", wait=False)
|
|
50
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
51
|
+
assert "backend" not in params
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@pytest.mark.asyncio
|
|
55
|
+
async def test_embed_wait_true_carries_backend_to_embed_execute():
|
|
56
|
+
client = _client()
|
|
57
|
+
seen = {}
|
|
58
|
+
|
|
59
|
+
async def fake(params, wait_timeout):
|
|
60
|
+
seen.update(params)
|
|
61
|
+
return {"results": [], "model": "m", "dimension": 1, "backend": "external"}
|
|
62
|
+
|
|
63
|
+
client._embed_via_execute_async = fake
|
|
64
|
+
result = await client.embed(["a"], backend="external", wait=True)
|
|
65
|
+
assert seen["backend"] == "external"
|
|
66
|
+
assert result["backend"] == "external"
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@pytest.mark.asyncio
|
|
70
|
+
async def test_model_offload_builds_params_and_returns_data():
|
|
71
|
+
client = _client()
|
|
72
|
+
data = {"model": "m", "residency": "ram", "changed": True}
|
|
73
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
|
|
74
|
+
|
|
75
|
+
assert await client.model_offload() == data
|
|
76
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
77
|
+
assert (method, params) == ("model_offload", {})
|
|
78
|
+
|
|
79
|
+
await client.model_offload("all-MiniLM-L6-v2")
|
|
80
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
81
|
+
assert params == {"model": "all-MiniLM-L6-v2"}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@pytest.mark.asyncio
|
|
85
|
+
async def test_model_load_builds_params():
|
|
86
|
+
client = _client()
|
|
87
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"residency": "loading"}))
|
|
88
|
+
|
|
89
|
+
await client.model_load()
|
|
90
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
91
|
+
assert (method, params) == ("model_load", {})
|
|
92
|
+
|
|
93
|
+
await client.model_load("all-MiniLM-L6-v2", device="cuda:0", wait=True)
|
|
94
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
95
|
+
assert params == {"model": "all-MiniLM-L6-v2", "device": "cuda:0", "wait": True}
|
|
96
|
+
|
|
97
|
+
await client.model_load(wait=False)
|
|
98
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
99
|
+
assert params == {"wait": False}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@pytest.mark.asyncio
|
|
103
|
+
async def test_refusals_arrive_as_api_errors_with_the_server_error():
|
|
104
|
+
client = _client()
|
|
105
|
+
refusal = {
|
|
106
|
+
"code": -32002,
|
|
107
|
+
"message": "command is not available in vectorization mode 'external'",
|
|
108
|
+
"data": {"code": "BACKEND_MODE_MISMATCH", "field": "command"},
|
|
109
|
+
}
|
|
110
|
+
client.client.jsonrpc_call = AsyncMock(
|
|
111
|
+
return_value={"result": {"success": False, "error": refusal}}
|
|
112
|
+
)
|
|
113
|
+
with pytest.raises(EmbedAPIError) as info:
|
|
114
|
+
await client.model_offload()
|
|
115
|
+
assert info.value.error == refusal
|
|
116
|
+
|
|
117
|
+
client.client.jsonrpc_call = AsyncMock(return_value={"error": refusal})
|
|
118
|
+
with pytest.raises(EmbedAPIError) as info:
|
|
119
|
+
await client.model_load(wait=True)
|
|
120
|
+
assert info.value.error == refusal
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/_template/example_global_step/spec.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{embed_client-4.0.28 → embed_client-4.0.30}/docs/specs/server_client_convergence_and_release/plan.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|