embed-client 4.0.51__tar.gz → 4.0.53__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.51/embed_client.egg-info → embed_client-4.0.53}/PKG-INFO +3 -1
- {embed_client-4.0.51 → embed_client-4.0.53}/README.md +2 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/api_format.md +1 -1
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/__init__.py +1 -1
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/embedding_client.py +225 -25
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/embedding_client_helpers.py +4 -1
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/exceptions.py +27 -1
- {embed_client-4.0.51 → embed_client-4.0.53/embed_client.egg-info}/PKG-INFO +3 -1
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client.egg-info/SOURCES.txt +2 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/pyproject.toml +1 -1
- embed_client-4.0.53/tests/test_input_limit_commands_client.py +232 -0
- embed_client-4.0.53/tests/test_structured_terminal_error.py +477 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/CONFIGURATION.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/LICENSE +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/MANIFEST.in +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/basic_auth.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_8001_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_correct.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_token.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_token_correct.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_token_roles_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/http_token_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_8001_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_api_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_token.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_token_8001.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_token_roles_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/https_token_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/jwt.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_8001.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_8001_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_correct.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_roles_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_test.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/mtls_via_adapter.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_http_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_http_token.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_http_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_https_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_https_token.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_https_token_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_mtls_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_mtls_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_server_http.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_server_https.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/configs/test_server_mtls.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/BUGREPORT_queue_manager_daemonic.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/IDENTIFIER_ANALYSIS_REPORT.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/PROPOSAL_SERVER_REQUEST_COALESCING.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/PROPOSAL_TWO_CHANNEL_OR_PUSH.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/SERVER_MODES_AND_CLIENT.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/client_integration_guide.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/coverage_report.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/error_500_analysis.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/error_handling_complete.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/error_handling_issue.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/_template/README.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/_template/example_global_step/example_tactical_step/example_atomic_step.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/_template/example_global_step/example_tactical_step/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/_template/example_global_step/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/_template/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-01.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-02.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-03.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-04.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-05.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-06.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-07.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-08.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-09.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-10.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-11.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-12.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-13.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-14.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-15.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-16.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-17.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-18.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-19.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-20.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-21.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-22.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/plan.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/PARALLEL_WAVES.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/README.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_automated_security_matrix/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_localhost_vectorization/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_packaging_and_prereqs/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_pypi_publication/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_surviving_examples_executable/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv02-vectorization.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv05-packaging.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv06-pypi-upload.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/spec.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/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.51 → embed_client-4.0.53}/docs/tech_spec/branches/documentation_normalization/README.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/tech_spec/branches/documentation_normalization/tasks/doc_alignment_verification_and_closure.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/tech_spec/branches/documentation_normalization/tasks/doc_guides_examples_canonical_mtls.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/tech_spec/branches/documentation_normalization/tasks/doc_legacy_tree_prune_and_governance.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/docs/tech_spec/branches/documentation_normalization/tasks/doc_root_metadata_and_pypi_surface.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/__main__.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/adapter_config_factory.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/adapter_config_normalizer.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/adapter_generator_bridge.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/auth.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/cli_core.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/client_factory.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/client_factory_examples.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/client_factory_helpers.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_defaults.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_examples.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_generator.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_generator_cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_presets.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_validator.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/config_validator_cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/constants.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/demo_cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/demo_security_cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/embed_file_output_validate.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/embed_file_status_store.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/example_async_usage.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/example_async_usage_demo.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/example_async_usage_ru.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/example_async_usage_ru_demo.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/identifier_types.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/json_embed_file_preflight.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/local_json_embed_file.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/md_embed_file_prep.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/response_normalizer.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/response_parsers.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/security_cli.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/security_cli_core.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/ssl_examples.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client/ssl_manager.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client.egg-info/dependency_links.txt +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client.egg-info/entry_points.txt +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client.egg-info/requires.txt +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/embed_client.egg-info/top_level.txt +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/README.md +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/__init__.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/async_testing_client_example.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/canonical_mtls_localhost_8001.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/configs/http_simple.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/configs/https_token.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/configs/mtls_roles.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/data/embed_file_json_array_sample.json +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/embed_file_json_local.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/security_examples.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/examples/security_examples_ru.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/setup.cfg +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_adapter_integration.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_adapter_phase1.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_adapter_phase2.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_all_security_modes.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_adapter.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_real.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_real_fixtures.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_stress.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_stress_new.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_async_client_stress_updated.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_auth_manager.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_canonical_mtls_example.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_cli_embed_file_json.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_cli_exit_codes_insecure.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_client_factory.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_client_factory_convenience.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_client_factory_integration.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_config.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_embed_file_aggregation_method.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_embed_file_output_validate.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_embed_immediate_mode.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_example_async_usage.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_json_embed_file_preflight.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_local_json_embed_file.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_md_embed_file_prep.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_security_matrix.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_ssl_manager.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_terminal_delivery_events.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_vectorization_modes_client.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/tests/test_wait_for_job_ws_fallback.py +0 -0
- {embed_client-4.0.51 → embed_client-4.0.53}/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.53
|
|
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
|
|
@@ -110,6 +110,8 @@ Resolution order (server): provider given -> must be known, model omitted -> the
|
|
|
110
110
|
|
|
111
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`.
|
|
112
112
|
|
|
113
|
+
**Input-limit table (server input_limit_* commands):** **`input_limit_add(provider, model, max_input_tokens, tokenizer, max_inputs_per_request=None, max_total_tokens_per_request=None, source=None)`** adds a manual row (`-32602` `INPUT_LIMIT_EXISTS`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_delete(provider, model)`** removes a row (`-32602` `INPUT_LIMIT_NOT_FOUND`); **`input_limit_update(provider, model, *, <named cells>)`** changes only the cells passed explicitly (`None` sends null, which only the three nullable cells accept; `-32602` `INPUT_LIMIT_NOT_FOUND`, `INPUT_LIMIT_EMPTY_UPDATE`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_list(provider=None)`** returns `{rows: [...]}` sorted by `(provider, model)` with each row's `origin` (`module` | `manual`). Mutating commands may also return `-32603` `INPUT_LIMIT_PERSIST_FAILED`. Refusals arrive as **`EmbedAPIError`**. The client does not validate these parameters.
|
|
114
|
+
|
|
113
115
|
## Documentation
|
|
114
116
|
|
|
115
117
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -63,6 +63,8 @@ Resolution order (server): provider given -> must be known, model omitted -> the
|
|
|
63
63
|
|
|
64
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`.
|
|
65
65
|
|
|
66
|
+
**Input-limit table (server input_limit_* commands):** **`input_limit_add(provider, model, max_input_tokens, tokenizer, max_inputs_per_request=None, max_total_tokens_per_request=None, source=None)`** adds a manual row (`-32602` `INPUT_LIMIT_EXISTS`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_delete(provider, model)`** removes a row (`-32602` `INPUT_LIMIT_NOT_FOUND`); **`input_limit_update(provider, model, *, <named cells>)`** changes only the cells passed explicitly (`None` sends null, which only the three nullable cells accept; `-32602` `INPUT_LIMIT_NOT_FOUND`, `INPUT_LIMIT_EMPTY_UPDATE`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_list(provider=None)`** returns `{rows: [...]}` sorted by `(provider, model)` with each row's `origin` (`module` | `manual`). Mutating commands may also return `-32603` `INPUT_LIMIT_PERSIST_FAILED`. Refusals arrive as **`EmbedAPIError`**. The client does not validate these parameters.
|
|
67
|
+
|
|
66
68
|
## Documentation
|
|
67
69
|
|
|
68
70
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -31,7 +31,7 @@ Use **`response_parsers`** helpers when consuming raw **`cmd`** responses.
|
|
|
31
31
|
**Method:** `embed_file`
|
|
32
32
|
**Params (high level):** `input_file` (path on the **embedding server** host), `format` (`lines` | `json_array`), optional `model`, `dimension`, `device`, `error_policy`, `aggregation_method`.
|
|
33
33
|
|
|
34
|
-
`aggregation_method` (optional; one of `mean_normalized`, `weighted_mean_by_tokens_normalized`, or omitted/`None`) is resolved server-side by priority call → config → constant, applied per line/array entry
|
|
34
|
+
`aggregation_method` (optional; one of `mean_normalized`, `weighted_mean_by_tokens_normalized`, or omitted/`None`) is accepted for any effective provider (`local` or a macsc provider). For the local model it is resolved server-side by priority call → config → constant, applied per line/array entry. For a nonlocal provider an entry longer than the provider's input limit is split and aggregated server-side; when omitted the method is `weighted_mean_by_tokens_normalized` (`method_source` `provider_default`). The client does not validate it. Same semantics as `EmbeddingClient.embed`'s own `aggregation_method` parameter. See the server's `EMBED_REQUEST_LIFECYCLE.md` "Aggregation method resolution" for the full chain.
|
|
35
35
|
|
|
36
36
|
The wire shape matches the server command: **`input_file`** is always the server-visible path. For a client-staged file, call **`upload_file`**, then **`get_upload_session(transfer_id)`** and use the returned **`storage_path`** as **`input_file`** (same pattern as the reference integration tests).
|
|
37
37
|
|
|
@@ -42,6 +42,8 @@ except ImportError: # pragma: no cover - older adapter builds
|
|
|
42
42
|
_POLL_COMPLETED_STATES = ("completed", "success")
|
|
43
43
|
_POLL_FAILED_STATES = ("failed", "error")
|
|
44
44
|
_POLL_STOPPED_STATES = ("stopped", "cancelled", "canceled")
|
|
45
|
+
# Marks an input_limit_update cell that the caller did not name (distinct from null).
|
|
46
|
+
_NOT_GIVEN: Any = object()
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
def _is_ws_closed_before_terminal(exc: BaseException) -> bool:
|
|
@@ -161,15 +163,18 @@ def _normalize_terminal_job_payload(payload: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
161
163
|
ev = payload.get("event") or payload.get("type")
|
|
162
164
|
if ev in _FAILED_TERMINAL_EVENTS:
|
|
163
165
|
err = payload.get("error", "Unknown error")
|
|
164
|
-
raise EmbedClientError(f"Job failed: {err}")
|
|
166
|
+
raise EmbedClientError(f"Job failed: {err}", error=payload.get("error"))
|
|
165
167
|
if ev in _CANCELLED_TERMINAL_EVENTS:
|
|
166
168
|
err = payload.get("error", "Unknown error")
|
|
167
|
-
raise EmbedClientError(f"Job cancelled: {err}")
|
|
169
|
+
raise EmbedClientError(f"Job cancelled: {err}", error=payload.get("error"))
|
|
168
170
|
if ev in ("job_completed", "job_completed_success", "delivery_completed"):
|
|
169
171
|
raw = payload.get("result") or {}
|
|
170
172
|
error = _find_failed_command_result(raw)
|
|
171
173
|
if error is not None:
|
|
172
|
-
raise EmbedClientError(
|
|
174
|
+
raise EmbedClientError(
|
|
175
|
+
f"Job command failed: {error}",
|
|
176
|
+
error=_find_failed_command_error_object(raw),
|
|
177
|
+
)
|
|
173
178
|
return _merge_jsonrpc_result_data_layers(raw)
|
|
174
179
|
raise EmbedClientError(
|
|
175
180
|
f"Unexpected WebSocket event: {ev} (payload keys: {list(payload.keys())})"
|
|
@@ -193,6 +198,22 @@ def _missing_from_worker_registry(exc: Exception) -> bool:
|
|
|
193
198
|
return "not found" in str(status.get("description") or "").lower()
|
|
194
199
|
|
|
195
200
|
|
|
201
|
+
def _find_failed_command_error_object(value: Any) -> Any:
|
|
202
|
+
"""Return the raw error object of the first nested failed command envelope.
|
|
203
|
+
|
|
204
|
+
Sibling of :func:`_find_failed_command_result` (same traversal) that returns
|
|
205
|
+
the error exactly as received (dict, str or ``None``) instead of a message.
|
|
206
|
+
"""
|
|
207
|
+
if not isinstance(value, dict):
|
|
208
|
+
return None
|
|
209
|
+
if value.get("success") is False:
|
|
210
|
+
return value.get("error")
|
|
211
|
+
for key in ("result", "data"):
|
|
212
|
+
if _find_failed_command_result(value.get(key)) is not None:
|
|
213
|
+
return _find_failed_command_error_object(value.get(key))
|
|
214
|
+
return None
|
|
215
|
+
|
|
216
|
+
|
|
196
217
|
def _find_failed_command_result(value: Any) -> Optional[str]:
|
|
197
218
|
"""Return the first nested command error from a completed queue envelope.
|
|
198
219
|
|
|
@@ -667,8 +688,11 @@ class EmbeddingClient:
|
|
|
667
688
|
error_policy: 'fail_fast' or 'continue'; default from server
|
|
668
689
|
device: 'auto', 'cpu', 'cuda', 'cuda:0'; default from server
|
|
669
690
|
aggregation_method: How to combine part vectors when a text is
|
|
670
|
-
longer than the model can read.
|
|
671
|
-
text past the limit is refused rather than
|
|
691
|
+
longer than the model can read. For the local model, ``None``
|
|
692
|
+
embeds directly and a text past the limit is refused rather than
|
|
693
|
+
truncated. For a nonlocal provider a text past its input limit is
|
|
694
|
+
split and aggregated server-side, with the default
|
|
695
|
+
``weighted_mean_by_tokens_normalized`` when this is omitted.
|
|
672
696
|
parts: One entry per text: a list of parts to combine, or ``None``
|
|
673
697
|
to let the server derive the parts from the text itself.
|
|
674
698
|
wait: If True, wait for job completion and return results (via /ws).
|
|
@@ -697,8 +721,15 @@ class EmbeddingClient:
|
|
|
697
721
|
EXTERNAL_BAD_RESPONSE, EXTERNAL_INVALID_REQUEST; -32001
|
|
698
722
|
MODEL_LOADING (retry); -32004 OWN_MODEL_DISABLED; -32005
|
|
699
723
|
GPU_DISABLED; -32603 MODEL_LOAD_FAILED, NO_GPU_AVAILABLE.
|
|
700
|
-
``
|
|
701
|
-
|
|
724
|
+
``aggregation_method`` and ``parts`` are accepted for any
|
|
725
|
+
effective provider. A text longer than a nonlocal provider's input
|
|
726
|
+
limit is split and aggregated server-side: with no
|
|
727
|
+
``aggregation_method`` the default is
|
|
728
|
+
``weighted_mean_by_tokens_normalized`` (reported as
|
|
729
|
+
``method_source`` ``provider_default``); it is never refused for
|
|
730
|
+
lack of a method. ``device`` is accepted only with the effective
|
|
731
|
+
provider ``"local"``. The client does not validate these
|
|
732
|
+
parameters; it forwards them as given.
|
|
702
733
|
|
|
703
734
|
Returns:
|
|
704
735
|
If wait=False: ``{"job_id", "status", "message"}``; when the server hit
|
|
@@ -893,16 +924,20 @@ class EmbeddingClient:
|
|
|
893
924
|
}
|
|
894
925
|
)
|
|
895
926
|
if state in _POLL_FAILED_STATES:
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
927
|
+
failed_event: Dict[str, Any] = {
|
|
928
|
+
"event": "job_failed",
|
|
929
|
+
"job_id": job_id,
|
|
930
|
+
}
|
|
931
|
+
# Omit "error" when the status has none: the normalizer then
|
|
932
|
+
# words the message "Unknown error" and exc.error stays None.
|
|
933
|
+
failed_error = (
|
|
934
|
+
status.get("error")
|
|
935
|
+
or status.get("description")
|
|
936
|
+
or status.get("message")
|
|
905
937
|
)
|
|
938
|
+
if failed_error:
|
|
939
|
+
failed_event["error"] = failed_error
|
|
940
|
+
return _normalize_terminal_job_payload(failed_event)
|
|
906
941
|
if state in _POLL_STOPPED_STATES:
|
|
907
942
|
raise EmbedClientError(f"Job {job_id} was stopped") from cause
|
|
908
943
|
if deadline is not None and loop.time() >= deadline:
|
|
@@ -945,10 +980,10 @@ class EmbeddingClient:
|
|
|
945
980
|
ev = event.get("event") or event.get("type")
|
|
946
981
|
if ev in _FAILED_TERMINAL_EVENTS:
|
|
947
982
|
err = event.get("error", "Unknown error")
|
|
948
|
-
raise EmbedClientError(f"Embed failed: {err}")
|
|
983
|
+
raise EmbedClientError(f"Embed failed: {err}", error=event.get("error"))
|
|
949
984
|
if ev in _CANCELLED_TERMINAL_EVENTS:
|
|
950
985
|
err = event.get("error", "Unknown error")
|
|
951
|
-
raise EmbedClientError(f"Embed cancelled: {err}")
|
|
986
|
+
raise EmbedClientError(f"Embed cancelled: {err}", error=event.get("error"))
|
|
952
987
|
# Accept job_completed, job_completed_success, and delivery_completed
|
|
953
988
|
# (delivery_completed is used in newer adapter versions)
|
|
954
989
|
if ev not in ("job_completed", "job_completed_success", "delivery_completed"):
|
|
@@ -1081,18 +1116,25 @@ class EmbeddingClient:
|
|
|
1081
1116
|
)
|
|
1082
1117
|
|
|
1083
1118
|
if "error" in response:
|
|
1084
|
-
raise EmbedClientError(
|
|
1119
|
+
raise EmbedClientError(
|
|
1120
|
+
f"Status check failed: {response['error']}",
|
|
1121
|
+
error=response["error"],
|
|
1122
|
+
)
|
|
1085
1123
|
|
|
1086
1124
|
result = response.get("result", {})
|
|
1087
1125
|
if not result.get("success"):
|
|
1088
1126
|
error = result.get("error", {})
|
|
1089
1127
|
raise EmbedClientError(
|
|
1090
|
-
f"Status check failed: {error.get('message', 'Unknown error')}"
|
|
1128
|
+
f"Status check failed: {error.get('message', 'Unknown error')}",
|
|
1129
|
+
error=result.get("error"),
|
|
1091
1130
|
)
|
|
1092
1131
|
|
|
1093
1132
|
return result.get("data", {})
|
|
1094
1133
|
except Exception as e:
|
|
1095
|
-
raise EmbedClientError(
|
|
1134
|
+
raise EmbedClientError(
|
|
1135
|
+
f"Status check failed: {e}",
|
|
1136
|
+
error=e.error if isinstance(e, EmbedClientError) else None,
|
|
1137
|
+
) from e
|
|
1096
1138
|
|
|
1097
1139
|
async def upload_file(
|
|
1098
1140
|
self,
|
|
@@ -1149,9 +1191,12 @@ class EmbeddingClient:
|
|
|
1149
1191
|
input_file: Absolute path to UTF-8 file on the **server** filesystem.
|
|
1150
1192
|
file_format: ``lines`` or ``json_array`` (maps to server param ``format``).
|
|
1151
1193
|
model, dimension, device, error_policy: Same semantics as :meth:`embed`.
|
|
1152
|
-
aggregation_method: Same semantics as :meth:`embed`:
|
|
1153
|
-
|
|
1154
|
-
|
|
1194
|
+
aggregation_method: Same semantics as :meth:`embed`: accepted for any
|
|
1195
|
+
provider; for a nonlocal provider an over-limit entry is split
|
|
1196
|
+
and aggregated server-side (default
|
|
1197
|
+
``weighted_mean_by_tokens_normalized``). For the local model it
|
|
1198
|
+
is resolved by priority call -> config -> constant when omitted;
|
|
1199
|
+
applied per-item, one line/array entry at a time.
|
|
1155
1200
|
provider: Same semantics as :meth:`embed` (``"local"`` or a live
|
|
1156
1201
|
macsc provider id; sent only when not ``None``; resolution order
|
|
1157
1202
|
and error codes as documented there).
|
|
@@ -1264,7 +1309,15 @@ class EmbeddingClient:
|
|
|
1264
1309
|
|
|
1265
1310
|
fail_msg = _embed_file_queue_result_error_message(data)
|
|
1266
1311
|
if fail_msg:
|
|
1267
|
-
|
|
1312
|
+
inner_result = data.get("result")
|
|
1313
|
+
raise EmbedClientError(
|
|
1314
|
+
f"embed_file failed: {fail_msg}",
|
|
1315
|
+
error=(
|
|
1316
|
+
inner_result.get("error")
|
|
1317
|
+
if isinstance(inner_result, dict)
|
|
1318
|
+
else None
|
|
1319
|
+
),
|
|
1320
|
+
)
|
|
1268
1321
|
|
|
1269
1322
|
if local_source_path:
|
|
1270
1323
|
expected_in = _normalize_hex_checksum(data.get("input_checksum_value"))
|
|
@@ -1532,6 +1585,153 @@ class EmbeddingClient:
|
|
|
1532
1585
|
params["wait"] = wait
|
|
1533
1586
|
return await self._service_command("model_load", params)
|
|
1534
1587
|
|
|
1588
|
+
async def input_limit_add(
|
|
1589
|
+
self,
|
|
1590
|
+
provider: str,
|
|
1591
|
+
model: str,
|
|
1592
|
+
max_input_tokens: int,
|
|
1593
|
+
tokenizer: str,
|
|
1594
|
+
max_inputs_per_request: Optional[int] = None,
|
|
1595
|
+
max_total_tokens_per_request: Optional[int] = None,
|
|
1596
|
+
source: Optional[str] = None,
|
|
1597
|
+
) -> Dict[str, Any]:
|
|
1598
|
+
"""Add a manual input-limit row for (provider, model).
|
|
1599
|
+
|
|
1600
|
+
Cells not given are omitted from the request (server default: null for
|
|
1601
|
+
the three nullable cells). The client does not validate the values.
|
|
1602
|
+
|
|
1603
|
+
Args:
|
|
1604
|
+
provider: Provider id (``"local"`` or a macsc provider id).
|
|
1605
|
+
model: Model id under that provider.
|
|
1606
|
+
max_input_tokens: Positive integer limit; ``"model"`` is the only
|
|
1607
|
+
value the local row accepts, so a number on ``local`` is refused.
|
|
1608
|
+
tokenizer: Tokenizer name (enum ``cl100k_base``).
|
|
1609
|
+
max_inputs_per_request: Positive integer or ``None``.
|
|
1610
|
+
max_total_tokens_per_request: Positive integer or ``None``.
|
|
1611
|
+
source: Free-text provenance of the limit, or ``None``.
|
|
1612
|
+
|
|
1613
|
+
Returns:
|
|
1614
|
+
``{provider, model, row: {max_input_tokens, tokenizer,
|
|
1615
|
+
max_inputs_per_request, max_total_tokens_per_request, source,
|
|
1616
|
+
origin: "manual"}}``.
|
|
1617
|
+
|
|
1618
|
+
Raises:
|
|
1619
|
+
EmbedAPIError: -32602 INPUT_LIMIT_EXISTS (row already present),
|
|
1620
|
+
-32602 LOCAL_LIMIT_FROM_MODEL (numeric limit on ``local``),
|
|
1621
|
+
-32602 validation (unknown, missing, type or value; expected/got),
|
|
1622
|
+
-32603 INPUT_LIMIT_PERSIST_FAILED (table and file unchanged).
|
|
1623
|
+
"""
|
|
1624
|
+
params: Dict[str, Any] = {
|
|
1625
|
+
"provider": provider,
|
|
1626
|
+
"model": model,
|
|
1627
|
+
"max_input_tokens": max_input_tokens,
|
|
1628
|
+
"tokenizer": tokenizer,
|
|
1629
|
+
}
|
|
1630
|
+
if max_inputs_per_request is not None:
|
|
1631
|
+
params["max_inputs_per_request"] = max_inputs_per_request
|
|
1632
|
+
if max_total_tokens_per_request is not None:
|
|
1633
|
+
params["max_total_tokens_per_request"] = max_total_tokens_per_request
|
|
1634
|
+
if source is not None:
|
|
1635
|
+
params["source"] = source
|
|
1636
|
+
return await self._service_command("input_limit_add", params)
|
|
1637
|
+
|
|
1638
|
+
async def input_limit_delete(self, provider: str, model: str) -> Dict[str, Any]:
|
|
1639
|
+
"""Delete the input-limit row for (provider, model).
|
|
1640
|
+
|
|
1641
|
+
A row registered by a module is remembered as deleted (not re-added at
|
|
1642
|
+
startup); a manual row with no module row is removed.
|
|
1643
|
+
|
|
1644
|
+
Args:
|
|
1645
|
+
provider: Provider id.
|
|
1646
|
+
model: Model id under that provider.
|
|
1647
|
+
|
|
1648
|
+
Returns:
|
|
1649
|
+
``{provider, model, deleted: true, origin_was}``.
|
|
1650
|
+
|
|
1651
|
+
Raises:
|
|
1652
|
+
EmbedAPIError: -32602 INPUT_LIMIT_NOT_FOUND (no such row), -32602
|
|
1653
|
+
validation, -32603 INPUT_LIMIT_PERSIST_FAILED (unchanged).
|
|
1654
|
+
"""
|
|
1655
|
+
return await self._service_command(
|
|
1656
|
+
"input_limit_delete", {"provider": provider, "model": model}
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
async def input_limit_update(
|
|
1660
|
+
self,
|
|
1661
|
+
provider: str,
|
|
1662
|
+
model: str,
|
|
1663
|
+
*,
|
|
1664
|
+
max_input_tokens: Any = _NOT_GIVEN,
|
|
1665
|
+
tokenizer: Any = _NOT_GIVEN,
|
|
1666
|
+
max_inputs_per_request: Any = _NOT_GIVEN,
|
|
1667
|
+
max_total_tokens_per_request: Any = _NOT_GIVEN,
|
|
1668
|
+
source: Any = _NOT_GIVEN,
|
|
1669
|
+
) -> Dict[str, Any]:
|
|
1670
|
+
"""Change only the named cells of the input-limit row for (provider, model).
|
|
1671
|
+
|
|
1672
|
+
Only the cells passed explicitly are sent; every other cell of the row
|
|
1673
|
+
stays unchanged. Passing ``None`` sends null, which the server accepts
|
|
1674
|
+
only for ``max_inputs_per_request``, ``max_total_tokens_per_request`` and
|
|
1675
|
+
``source``. Updating a module row makes it a manual row (manual override).
|
|
1676
|
+
Calling with no cells sends none, and the server refuses it with
|
|
1677
|
+
INPUT_LIMIT_EMPTY_UPDATE.
|
|
1678
|
+
|
|
1679
|
+
Args:
|
|
1680
|
+
provider: Provider id.
|
|
1681
|
+
model: Model id under that provider.
|
|
1682
|
+
max_input_tokens: Positive integer; refused on ``local``
|
|
1683
|
+
(LOCAL_LIMIT_FROM_MODEL).
|
|
1684
|
+
tokenizer: Tokenizer name (enum ``cl100k_base``).
|
|
1685
|
+
max_inputs_per_request: Positive integer or ``None``.
|
|
1686
|
+
max_total_tokens_per_request: Positive integer or ``None``.
|
|
1687
|
+
source: Free-text provenance or ``None``.
|
|
1688
|
+
|
|
1689
|
+
Returns:
|
|
1690
|
+
``{provider, model, row: {all cells}, changed: [names of the cells
|
|
1691
|
+
whose value changed], origin: "manual"}``.
|
|
1692
|
+
|
|
1693
|
+
Raises:
|
|
1694
|
+
EmbedAPIError: -32602 INPUT_LIMIT_NOT_FOUND (no such row),
|
|
1695
|
+
-32602 INPUT_LIMIT_EMPTY_UPDATE (no cell named),
|
|
1696
|
+
-32602 LOCAL_LIMIT_FROM_MODEL, -32602 validation (unknown cell,
|
|
1697
|
+
type or value; expected/got), -32603 INPUT_LIMIT_PERSIST_FAILED
|
|
1698
|
+
(unchanged).
|
|
1699
|
+
"""
|
|
1700
|
+
named = {
|
|
1701
|
+
"max_input_tokens": max_input_tokens,
|
|
1702
|
+
"tokenizer": tokenizer,
|
|
1703
|
+
"max_inputs_per_request": max_inputs_per_request,
|
|
1704
|
+
"max_total_tokens_per_request": max_total_tokens_per_request,
|
|
1705
|
+
"source": source,
|
|
1706
|
+
}
|
|
1707
|
+
params: Dict[str, Any] = {"provider": provider, "model": model}
|
|
1708
|
+
for name, value in named.items():
|
|
1709
|
+
if value is not _NOT_GIVEN:
|
|
1710
|
+
params[name] = value
|
|
1711
|
+
return await self._service_command("input_limit_update", params)
|
|
1712
|
+
|
|
1713
|
+
async def input_limit_list(self, provider: Optional[str] = None) -> Dict[str, Any]:
|
|
1714
|
+
"""List input-limit rows, sorted by (provider, model), unique by key.
|
|
1715
|
+
|
|
1716
|
+
Reads no model and makes no provider call. Deletion marks are not shown.
|
|
1717
|
+
|
|
1718
|
+
Args:
|
|
1719
|
+
provider: Optional provider filter; sent only when not ``None``.
|
|
1720
|
+
|
|
1721
|
+
Returns:
|
|
1722
|
+
``{rows: [{provider, model, max_input_tokens, tokenizer,
|
|
1723
|
+
max_inputs_per_request, max_total_tokens_per_request, source,
|
|
1724
|
+
origin: "module" | "manual"}]}``; a provider with no rows gives
|
|
1725
|
+
``rows: []``.
|
|
1726
|
+
|
|
1727
|
+
Raises:
|
|
1728
|
+
EmbedAPIError: -32602 validation (unknown parameter, value).
|
|
1729
|
+
"""
|
|
1730
|
+
params: Dict[str, Any] = {}
|
|
1731
|
+
if provider is not None:
|
|
1732
|
+
params["provider"] = provider
|
|
1733
|
+
return await self._service_command("input_limit_list", params)
|
|
1734
|
+
|
|
1535
1735
|
async def list_commands(self) -> Dict[str, Any]:
|
|
1536
1736
|
"""
|
|
1537
1737
|
List available commands.
|
|
@@ -45,7 +45,10 @@ async def wait_for_job_poll(
|
|
|
45
45
|
return cast(Dict[str, Any], inner if isinstance(inner, dict) else {})
|
|
46
46
|
if job_status in ("failed", "error"):
|
|
47
47
|
error = status.get("error") or status.get("message", "Unknown error")
|
|
48
|
-
raise EmbedClientError(
|
|
48
|
+
raise EmbedClientError(
|
|
49
|
+
f"Job failed: {error}",
|
|
50
|
+
error=status.get("error") or status.get("message"),
|
|
51
|
+
)
|
|
49
52
|
raise EmbedClientError(
|
|
50
53
|
f"Job completed with unexpected status: {job_status}"
|
|
51
54
|
)
|
|
@@ -5,7 +5,8 @@ Author: Vasiliy Zdanovskiy
|
|
|
5
5
|
email: vasilyvz@gmail.com
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import copy
|
|
9
|
+
from typing import Any, Optional
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class EmbedError(Exception):
|
|
@@ -28,8 +29,33 @@ class EmbedClientError(EmbedError):
|
|
|
28
29
|
"""
|
|
29
30
|
Client-facing failure: embed failed, job not found, status check failed,
|
|
30
31
|
or models list failed.
|
|
32
|
+
|
|
33
|
+
Attributes:
|
|
34
|
+
error: Deep copy of the original terminal error object as received (a
|
|
35
|
+
dict, or a str when the producer sent a string); ``None`` when the
|
|
36
|
+
failure carries none.
|
|
37
|
+
code: ``error["code"]`` when ``error`` is a dict with a ``code`` key,
|
|
38
|
+
else ``None``.
|
|
39
|
+
data: Deep copy of ``error["data"]`` when ``error`` is a dict with a
|
|
40
|
+
``data`` key, else ``None``.
|
|
31
41
|
"""
|
|
32
42
|
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
message: str,
|
|
46
|
+
*args: object,
|
|
47
|
+
error: Optional[Any] = None,
|
|
48
|
+
**kwargs: object,
|
|
49
|
+
) -> None:
|
|
50
|
+
super().__init__(message, *args, **kwargs)
|
|
51
|
+
self.error: Any = copy.deepcopy(error)
|
|
52
|
+
self.code: Any = None
|
|
53
|
+
self.data: Any = None
|
|
54
|
+
if isinstance(self.error, dict):
|
|
55
|
+
self.code = self.error.get("code")
|
|
56
|
+
if "data" in self.error:
|
|
57
|
+
self.data = copy.deepcopy(self.error["data"])
|
|
58
|
+
|
|
33
59
|
|
|
34
60
|
class EmbedServiceError(EmbedError):
|
|
35
61
|
"""Generic service or runtime failure (e.g. model load, encode, I/O)."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: embed-client
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.53
|
|
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
|
|
@@ -110,6 +110,8 @@ Resolution order (server): provider given -> must be known, model omitted -> the
|
|
|
110
110
|
|
|
111
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`.
|
|
112
112
|
|
|
113
|
+
**Input-limit table (server input_limit_* commands):** **`input_limit_add(provider, model, max_input_tokens, tokenizer, max_inputs_per_request=None, max_total_tokens_per_request=None, source=None)`** adds a manual row (`-32602` `INPUT_LIMIT_EXISTS`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_delete(provider, model)`** removes a row (`-32602` `INPUT_LIMIT_NOT_FOUND`); **`input_limit_update(provider, model, *, <named cells>)`** changes only the cells passed explicitly (`None` sends null, which only the three nullable cells accept; `-32602` `INPUT_LIMIT_NOT_FOUND`, `INPUT_LIMIT_EMPTY_UPDATE`, `LOCAL_LIMIT_FROM_MODEL`); **`input_limit_list(provider=None)`** returns `{rows: [...]}` sorted by `(provider, model)` with each row's `origin` (`module` | `manual`). Mutating commands may also return `-32603` `INPUT_LIMIT_PERSIST_FAILED`. Refusals arrive as **`EmbedAPIError`**. The client does not validate these parameters.
|
|
114
|
+
|
|
113
115
|
## Documentation
|
|
114
116
|
|
|
115
117
|
- **[CONFIGURATION.md](CONFIGURATION.md)** — JSON config schema, protocols, validation
|
|
@@ -222,11 +222,13 @@ tests/test_embed_file_aggregation_method.py
|
|
|
222
222
|
tests/test_embed_file_output_validate.py
|
|
223
223
|
tests/test_embed_immediate_mode.py
|
|
224
224
|
tests/test_example_async_usage.py
|
|
225
|
+
tests/test_input_limit_commands_client.py
|
|
225
226
|
tests/test_json_embed_file_preflight.py
|
|
226
227
|
tests/test_local_json_embed_file.py
|
|
227
228
|
tests/test_md_embed_file_prep.py
|
|
228
229
|
tests/test_security_matrix.py
|
|
229
230
|
tests/test_ssl_manager.py
|
|
231
|
+
tests/test_structured_terminal_error.py
|
|
230
232
|
tests/test_terminal_delivery_events.py
|
|
231
233
|
tests/test_vectorization_modes_client.py
|
|
232
234
|
tests/test_wait_for_job_ws_fallback.py
|
|
@@ -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.53"
|
|
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:
|