├── .codecov.yml ├── .coveragerc ├── .flake8 ├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ └── main.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CONTRIBUTING.md ├── LICENSE ├── README.rst ├── ci ├── compose.sh ├── docker-compose-async.yml ├── docker-compose-azure.yml ├── docker-compose-cluster.yml ├── docker-compose-modules.yml ├── docker-compose-okta-cc.yml ├── docker-compose-okta-users.yml ├── docker-compose-proxy.yml ├── docker-compose-rbac.yml ├── docker-compose-wcs.yml ├── docker-compose.yml ├── proxy │ └── envoy.yaml ├── start_weaviate.sh ├── start_weaviate_jt.sh └── stop_weaviate.sh ├── docs ├── Makefile ├── README.rst ├── _static │ └── custom.css ├── changelog.rst ├── conf.py ├── index.rst ├── make.bat ├── modules.rst ├── weaviate.backup.rst ├── weaviate.classes.rst ├── weaviate.cluster.rst ├── weaviate.collections.aggregations.rst ├── weaviate.collections.backups.rst ├── weaviate.collections.batch.rst ├── weaviate.collections.classes.rst ├── weaviate.collections.cluster.rst ├── weaviate.collections.collection.rst ├── weaviate.collections.collections.rst ├── weaviate.collections.config.rst ├── weaviate.collections.data.rst ├── weaviate.collections.grpc.rst ├── weaviate.collections.queries.bm25.rst ├── weaviate.collections.queries.fetch_object_by_id.rst ├── weaviate.collections.queries.fetch_objects.rst ├── weaviate.collections.queries.fetch_objects_by_ids.rst ├── weaviate.collections.queries.hybrid.rst ├── weaviate.collections.queries.near_image.rst ├── weaviate.collections.queries.near_media.rst ├── weaviate.collections.queries.near_object.rst ├── weaviate.collections.queries.near_text.rst ├── weaviate.collections.queries.near_vector.rst ├── weaviate.collections.queries.rst ├── weaviate.collections.rst ├── weaviate.collections.tenants.rst ├── weaviate.connect.rst ├── weaviate.debug.rst ├── weaviate.exceptions.rst ├── weaviate.gql.rst ├── weaviate.outputs.rst ├── weaviate.rbac.rst ├── weaviate.rst └── weaviate.users.rst ├── integration ├── 1234.3gp ├── __init__.py ├── conftest.py ├── constants.py ├── hobbits.mp4 ├── test_auth.py ├── test_backup_v4.py ├── test_batch_v4.py ├── test_client.py ├── test_client_debug.py ├── test_collection.py ├── test_collection_aggregate.py ├── test_collection_async.py ├── test_collection_batch.py ├── test_collection_batch_delete.py ├── test_collection_config.py ├── test_collection_filter.py ├── test_collection_geo.py ├── test_collection_get.py ├── test_collection_hybrid.py ├── test_collection_model.py ├── test_collection_multi_node.py ├── test_collection_near_vector.py ├── test_collection_nested.py ├── test_collection_openai.py ├── test_collection_references.py ├── test_collection_rerank.py ├── test_collections_sorting.py ├── test_gql_raw_v4.py ├── test_iterator.py ├── test_named_vectors.py ├── test_rbac.py ├── test_tenants.py ├── test_users.py └── weaviate-logo.png ├── integration_embedded ├── __init__.py └── test_client.py ├── journey_tests ├── __init__.py ├── gunicorn │ ├── __init__.py │ ├── asgi.py │ ├── test.py │ └── wsgi.py ├── journeys.py ├── run.sh ├── test_fastapi.py ├── test_flask.py └── test_litestar.py ├── mock_tests ├── __init__.py ├── conftest.py ├── mock_data.py ├── test_auth.py ├── test_collection.py ├── test_tenants_get.py └── test_timeouts.py ├── profiling ├── __init__.py ├── conftest.py ├── constants.py ├── pyspy.py ├── test_import_and_query.py ├── test_profiling.py ├── test_refs.py └── test_sphere.py ├── publishing.md ├── pyproject.toml ├── pyrightconfig.json ├── pytest.ini ├── requirements-devel.txt ├── ruff.toml ├── run-mypy.sh ├── setup.cfg ├── setup.py ├── test ├── README.md ├── __init__.py ├── collection │ ├── __init__.py │ ├── conftest.py │ ├── schema.py │ ├── test_aggregates.py │ ├── test_batch.py │ ├── test_byteops.py │ ├── test_classes.py │ ├── test_classes_generative.py │ ├── test_client.py │ ├── test_collection_model.py │ ├── test_collections_sorting.py │ ├── test_config.py │ ├── test_config_update.py │ ├── test_filter.py │ ├── test_queries.py │ ├── test_validator.py │ ├── test_vectorizer.py │ └── weaviate-logo.png ├── test_auth.py ├── test_client.py ├── test_get_vector_v4.py ├── test_rbac.py ├── test_server_version.py ├── test_util.py └── util.py ├── tools ├── __init__.py ├── proto_regen.sh ├── stubs.py └── stubs_regen.sh └── weaviate ├── .gitignore ├── __init__.py ├── agents ├── __init__.py ├── __init__.pyi ├── base.pyi ├── classes │ └── __init__.pyi ├── personalization │ └── __init__.pyi ├── query │ └── __init__.pyi ├── transformation │ └── __init__.pyi └── utils.pyi ├── auth.py ├── backup ├── __init__.py ├── async_.py ├── async_.pyi ├── backup.py ├── backup_location.py ├── executor.py ├── sync.py └── sync.pyi ├── classes ├── __init__.py ├── aggregate.py ├── backup.py ├── batch.py ├── config.py ├── data.py ├── debug.py ├── generate.py ├── generics.py ├── init.py ├── query.py ├── rbac.py └── tenants.py ├── client.py ├── client.pyi ├── client_executor.py ├── cluster ├── __init__.py └── types.py ├── collections ├── __init__.py ├── aggregate.py ├── aggregations │ ├── __init__.py │ ├── base_executor.py │ ├── hybrid │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ ├── near_image │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ ├── near_object │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ ├── near_text │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ ├── near_vector │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ └── over_all │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi ├── backups │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── executor.py │ ├── sync.py │ └── sync.pyi ├── batch │ ├── __init__.py │ ├── base.py │ ├── batch_wrapper.py │ ├── client.py │ ├── collection.py │ ├── grpc_batch_delete.py │ ├── grpc_batch_objects.py │ └── rest.py ├── classes │ ├── __init__.py │ ├── aggregate.py │ ├── batch.py │ ├── cluster.py │ ├── config.py │ ├── config_base.py │ ├── config_methods.py │ ├── config_named_vectors.py │ ├── config_vector_index.py │ ├── config_vectorizers.py │ ├── data.py │ ├── filters.py │ ├── generative.py │ ├── grpc.py │ ├── internal.py │ ├── orm.py │ ├── tenants.py │ └── types.py ├── cluster │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── executor.py │ ├── sync.py │ └── sync.pyi ├── collection │ ├── __init__.py │ ├── async_.py │ ├── base.py │ └── sync.py ├── collections │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── base.py │ ├── executor.py │ ├── sync.py │ └── sync.pyi ├── config │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── executor.py │ ├── sync.py │ └── sync.pyi ├── data │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── executor.py │ ├── sync.py │ └── sync.pyi ├── filters.py ├── generate.py ├── grpc │ ├── __init__.py │ ├── aggregate.py │ ├── query.py │ ├── shared.py │ └── tenants.py ├── iterator.py ├── orm.py ├── queries │ ├── __init__.py │ ├── base_executor.py │ ├── bm25 │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── fetch_object_by_id │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ ├── fetch_objects │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── fetch_objects_by_ids │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── hybrid │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── near_image │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── near_media │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── near_object │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ ├── near_text │ │ ├── __init__.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ │ └── query │ │ │ ├── __init__.py │ │ │ ├── async_.py │ │ │ ├── async_.pyi │ │ │ ├── executor.py │ │ │ ├── sync.py │ │ │ └── sync.pyi │ └── near_vector │ │ ├── __init__.py │ │ ├── generate │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi │ │ └── query │ │ ├── __init__.py │ │ ├── async_.py │ │ ├── async_.pyi │ │ ├── executor.py │ │ ├── sync.py │ │ └── sync.pyi ├── query.py └── tenants │ ├── __init__.py │ ├── async_.py │ ├── async_.pyi │ ├── executor.py │ ├── sync.py │ ├── sync.pyi │ └── types.py ├── config.py ├── conftest.py ├── connect ├── __init__.py ├── authentication.py ├── base.py ├── event_loop.py ├── executor.py ├── helpers.py ├── integrations.py └── v4.py ├── debug ├── __init__.py ├── async_.py ├── async_.pyi ├── executor.py ├── sync.py ├── sync.pyi └── types.py ├── embedded.py ├── error_msgs.py ├── exceptions.py ├── gql ├── __init__.py ├── aggregate.py └── filter.py ├── integrations.py ├── logger.py ├── outputs ├── __init__.py ├── aggregate.py ├── backup.py ├── batch.py ├── cluster.py ├── config.py ├── data.py ├── generate.py ├── query.py ├── rbac.py ├── tenants.py └── users.py ├── proto ├── __init__.py └── v1 │ ├── __init__.py │ ├── aggregate_pb2.py │ ├── aggregate_pb2.pyi │ ├── aggregate_pb2_grpc.py │ ├── base_grpc.py │ ├── base_pb2.py │ ├── base_pb2.pyi │ ├── base_pb2_grpc.py │ ├── base_search_pb2.py │ ├── base_search_pb2.pyi │ ├── base_search_pb2_grpc.py │ ├── batch_delete_pb2.py │ ├── batch_delete_pb2.pyi │ ├── batch_delete_pb2_grpc.py │ ├── batch_pb2.py │ ├── batch_pb2.pyi │ ├── batch_pb2_grpc.py │ ├── generative_pb2.py │ ├── generative_pb2.pyi │ ├── generative_pb2_grpc.py │ ├── properties_pb2.py │ ├── properties_pb2.pyi │ ├── properties_pb2_grpc.py │ ├── regen.sh │ ├── search_get_pb2.py │ ├── search_get_pb2.pyi │ ├── search_get_pb2_grpc.py │ ├── tenants_pb2.py │ ├── tenants_pb2.pyi │ ├── tenants_pb2_grpc.py │ ├── weaviate_pb2.py │ ├── weaviate_pb2.pyi │ └── weaviate_pb2_grpc.py ├── py.typed ├── rbac ├── __init__.py ├── async_.py ├── async_.pyi ├── executor.py ├── models.py ├── sync.py └── sync.pyi ├── retry.py ├── str_enum.py ├── types.py ├── users ├── __init__.py ├── async_.py ├── async_.pyi ├── base.py ├── sync.py ├── sync.pyi └── users.py ├── util.py ├── validator.py └── warnings.py /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | after_n_builds: 1 4 | comment: 5 | after_n_builds: 1 -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = *tests*/*,*__init__.py,weaviate/proto/** 3 | 4 | 5 | [report] 6 | omit = *tests*/*,*__init__.py 7 | exclude_lines = 8 | pragma: not covered 9 | @overload 10 | @abstractmethod -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 100 3 | docstring-convention = google 4 | ; enable-extensions = G # if using flake8-google-style plugins 5 | exclude = 6 | .git, 7 | venv, 8 | .venv, 9 | .pytest_cache, 10 | dist, 11 | .idea, 12 | docs/conf.py, 13 | weaviate/collections/orm.py, 14 | weaviate/collections/classes/orm.py, 15 | weaviate/proto/**/*.py, 16 | build/ 17 | tools/stubs.py, 18 | ignore = D100, D101, D102, D103, D104, D105, D107, E203, E266, E501, E704, E731, W503, DOC301 19 | per-file-ignores = 20 | weaviate/cluster/types.py: A005 21 | weaviate/collections/classes/types.py: A005 22 | weaviate/collections/collections/__init__.py: A005 23 | weaviate/collections/__init__.py: A005 24 | weaviate/debug/types.py: A005 25 | weaviate/collections/tenants/types.py: A005 26 | weaviate/types.py: A005 27 | weaviate/warnings.py: A005 28 | test/*: D100, D101, D102, D103, D104, D105, D107, PYD001 29 | mock_tests/*: D100, D101, D102, D103, D104, D105, D107, PYD001 30 | integration/*: D100, D101, D102, D103, D104, D105, D107, PYD001 31 | 32 | # D100: Missing docstring in a public module 33 | # D101: Missing docstring in a public class 34 | # D102: Missing docstring in a public method 35 | # D103: Missing docstring in a public function 36 | # D104: Missing docstring in a public package 37 | # D105: Missing docstring in a magic method 38 | # D107: Missing docstring in an __init__ method 39 | # E203: Whitespace before ':' 40 | # E266: Too many consecutive '#' in a comment 41 | # E501: Line too long 42 | # E704: Multiple statements on one line (def) 43 | # E731: Do not assign a lambda expression, use a def instead 44 | # W503: Line break before a binary operator 45 | # DOC301: Class method __init__ should not have a docstring 46 | 47 | [tool.pydoclint] 48 | style = google # or numpy or sphinx 49 | arg-type-hints-in-docstring = true # Optional: require types in docstrings 50 | check-return-types = true 51 | require-return-section-when-returning-none = false -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Ci related folders 2 | /.github/ @weaviate/core 3 | /ci/ @weaviate/core 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "pip" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | ignore: 13 | - dependency-name: "grpcio" 14 | - dependency-name: "grpcio-tools" 15 | - dependency-name: "grpcio-health-checking" 16 | - dependency-name: "pydantic" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .venv 2 | venv 3 | .idea 4 | dist/ 5 | weaviate_client.egg-info 6 | **/__pycache__ 7 | tmp 8 | build/ 9 | docs/_build 10 | docs/html 11 | *.pyc 12 | ./docker-compose.yml 13 | .DS_Store 14 | .ipynb_checkpoints 15 | *.ipynb 16 | nohup.out 17 | .coverage 18 | coverage.xml 19 | .pytest_cache 20 | .mypy_cache 21 | prof 22 | 23 | image.png 24 | .vscode/ 25 | scratch/ 26 | 27 | *-test.sh 28 | *.hdf5 29 | *.jsonl 30 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: ^proto/ 2 | repos: 3 | - repo: local 4 | hooks: 5 | - id: stubs-autogen 6 | name: stubs-autogen 7 | language: system 8 | entry: ./tools/stubs_regen.sh 9 | 10 | - repo: https://github.com/astral-sh/ruff-pre-commit 11 | # Ruff version. 12 | rev: v0.11.7 13 | hooks: 14 | # Run the linter. 15 | - id: ruff 16 | args: [ weaviate, integration, test, mock_tests, journey_tests, --fix ] 17 | # Run the formatter. 18 | - id: ruff-format 19 | args: [ weaviate, integration, test, mock_tests, journey_tests ] 20 | 21 | - repo: https://github.com/PyCQA/flake8 22 | rev: 7.1.0 23 | hooks: 24 | - id: flake8 25 | name: linting 26 | additional_dependencies: [ 27 | 'flake8-bugbear==22.10.27', 28 | 'flake8-comprehensions==3.10.1', 29 | 'flake8-builtins==2.0.1' 30 | ] 31 | - id: flake8 32 | name: docstrings 33 | additional_dependencies: [ 34 | 'flake8-docstrings==1.7.0', 35 | 'pydoclint==0.6.5', 36 | ] 37 | 38 | - repo: https://github.com/pre-commit/pre-commit-hooks 39 | rev: v4.6.0 40 | hooks: 41 | - id: no-commit-to-branch 42 | - id: trailing-whitespace 43 | 44 | - repo: local 45 | hooks: 46 | - id: pyright 47 | name: pyright 48 | entry: pyright 49 | language: node 50 | pass_filenames: false 51 | types: [python] 52 | additional_dependencies: [pyright@1.1.398] 53 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | # Build from the docs/ directory with Sphinx 4 | sphinx: 5 | configuration: docs/conf.py 6 | fail_on_warning: false 7 | 8 | # Explicitly set the version of Python and its requirements 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.12" 13 | jobs: 14 | pre_build: 15 | - git clone -b main --depth=1 https://github.com/weaviate/weaviate-agents-python-client.git docs/weaviate-agents-python-client 16 | 17 | python: 18 | install: 19 | - requirements: requirements-devel.txt -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2023, Weaviate B.V. (registered @ Dutch Chamber of Commerce no 75231824) 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of Weaviate nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /ci/compose.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | function ls_compose { 6 | ls ci | grep 'docker-compose' 7 | } 8 | 9 | function exec_all { 10 | for file in $(ls_compose); do 11 | docker compose -f $(echo "ci/${file} ${1}") 12 | done 13 | } 14 | 15 | function compose_up_all { 16 | exec_all "up -d" 17 | } 18 | 19 | function compose_down_all { 20 | exec_all "down --remove-orphans" 21 | } 22 | 23 | function all_weaviate_ports { 24 | echo "8090 8081 8087 8088 8089 8086 8082 8083 8075 8092 8085 8080" # in alphabetic order of appearance in docker-compose files 25 | } 26 | 27 | function wait(){ 28 | MAX_WAIT_SECONDS=60 29 | ALREADY_WAITING=0 30 | 31 | echo "Waiting for $1" 32 | while true; do 33 | # first check if weaviate already responds 34 | if ! curl -s $1 > /dev/null; then 35 | continue 36 | fi 37 | 38 | # endpoint available, check if it is ready 39 | HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$1/v1/.well-known/ready") 40 | 41 | if [ "$HTTP_STATUS" -eq 200 ]; then 42 | break 43 | else 44 | echo "Weaviate is not up yet. (waited for ${ALREADY_WAITING}s)" 45 | if [ $ALREADY_WAITING -gt $MAX_WAIT_SECONDS ]; then 46 | echo "Weaviate did not start up in $MAX_WAIT_SECONDS." 47 | exit 1 48 | else 49 | sleep 2 50 | let ALREADY_WAITING=$ALREADY_WAITING+2 51 | fi 52 | fi 53 | done 54 | 55 | echo "Weaviate is up and running!" 56 | } -------------------------------------------------------------------------------- /ci/docker-compose-async.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate_async: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8090' 10 | - --scheme 11 | - http 12 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 13 | ports: 14 | - "8090:8090" 15 | - "50061:50051" 16 | restart: on-failure:0 17 | environment: 18 | QUERY_DEFAULTS_LIMIT: 25 19 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' 20 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 21 | CLUSTER_HOSTNAME: 'node1' 22 | ASYNC_INDEXING: 'true' 23 | DISABLE_TELEMETRY: 'true' 24 | -------------------------------------------------------------------------------- /ci/docker-compose-azure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-auth-azure: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8081' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - 8081:8081 16 | restart: on-failure:0 17 | environment: 18 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 19 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false' 20 | AUTHENTICATION_OIDC_ENABLED: 'true' 21 | AUTHENTICATION_OIDC_CLIENT_ID: '4706508f-30c2-469b-8b12-ad272b3de864' 22 | AUTHENTICATION_OIDC_ISSUER: 'https://login.microsoftonline.com/36c47fb4-f57c-4e1c-8760-d42293932cc2/v2.0' 23 | AUTHENTICATION_OIDC_USERNAME_CLAIM: 'oid' 24 | AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups' 25 | AUTHORIZATION_ADMINLIST_ENABLED: 'true' 26 | AUTHORIZATION_ADMINLIST_USERS: 'b6bf8e1d-d398-4e5d-8f1b-50fda9146a64' 27 | DISABLE_TELEMETRY: 'true' 28 | ... 29 | -------------------------------------------------------------------------------- /ci/docker-compose-modules.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate_modules: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8086' 10 | - --scheme 11 | - http 12 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 13 | ports: 14 | - 8086:8086 15 | - "50057:50051" 16 | restart: on-failure:0 17 | environment: 18 | QUERY_DEFAULTS_LIMIT: 25 19 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' 20 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 21 | DEFAULT_VECTORIZER_MODULE: 'text2vec-openai' 22 | ENABLE_MODULES: 'text2colbert-jinaai,text2vec-openai,generative-openai,text2vec-cohere,generative-cohere,reranker-cohere' 23 | CLUSTER_HOSTNAME: 'node1' 24 | DISABLE_TELEMETRY: 'true' 25 | -------------------------------------------------------------------------------- /ci/docker-compose-okta-cc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-auth-okta-cc: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8082' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - 8082:8082 16 | restart: on-failure:0 17 | environment: 18 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 19 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false' 20 | AUTHENTICATION_OIDC_ENABLED: 'true' 21 | AUTHENTICATION_OIDC_CLIENT_ID: '0oa7e9ipdkVZRUcxo5d7' 22 | AUTHENTICATION_OIDC_ISSUER: 'https://dev-32300990.okta.com/oauth2/aus7e9kxbwYQB0eht5d7' 23 | AUTHENTICATION_OIDC_USERNAME_CLAIM: 'cid' 24 | AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups' 25 | AUTHORIZATION_ADMINLIST_ENABLED: 'true' 26 | AUTHORIZATION_ADMINLIST_USERS: '0oa7e9ipdkVZRUcxo5d7' 27 | DISABLE_TELEMETRY: 'true' 28 | ... 29 | -------------------------------------------------------------------------------- /ci/docker-compose-okta-users.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-auth-okta-users: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8083' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - 8083:8083 16 | restart: on-failure:0 17 | environment: 18 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 19 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false' 20 | AUTHENTICATION_OIDC_ENABLED: 'true' 21 | AUTHENTICATION_OIDC_CLIENT_ID: '0oa7iz2g41rNxv95B5d7' 22 | AUTHENTICATION_OIDC_ISSUER: 'https://dev-32300990.okta.com/oauth2/aus7iz3tna3kckRWS5d7' 23 | AUTHENTICATION_OIDC_USERNAME_CLAIM: 'sub' 24 | AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups' 25 | AUTHORIZATION_ADMINLIST_ENABLED: 'true' 26 | AUTHORIZATION_ADMINLIST_USERS: 'test@test.de' 27 | AUTHENTICATION_OIDC_SCOPES: 'openid,email' 28 | DISABLE_TELEMETRY: 'true' 29 | ... 30 | -------------------------------------------------------------------------------- /ci/docker-compose-proxy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-proxy: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8080' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | ports: 14 | - 8075:8080 15 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 16 | restart: on-failure:0 17 | environment: 18 | CONTEXTIONARY_URL: contextionary:9999 19 | QUERY_DEFAULTS_LIMIT: 25 20 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' 21 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 22 | DEFAULT_VECTORIZER_MODULE: 'text2vec-contextionary' 23 | ENABLE_MODULES: text2vec-contextionary 24 | BACKUP_FILESYSTEM_PATH: "/tmp/backups" 25 | CLUSTER_GOSSIP_BIND_PORT: "7100" 26 | CLUSTER_DATA_BIND_PORT: "7101" 27 | CLUSTER_HOSTNAME: "node1" 28 | AUTOSCHEMA_ENABLED: 'false' 29 | DISABLE_TELEMETRY: 'true' 30 | contextionary: 31 | environment: 32 | OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75 33 | EXTENSIONS_STORAGE_MODE: weaviate 34 | EXTENSIONS_STORAGE_ORIGIN: http://weaviate-proxy:8080 35 | NEIGHBOR_OCCURRENCE_IGNORE_PERCENTILE: 5 36 | ENABLE_COMPOUND_SPLITTING: 'false' 37 | image: semitechnologies/contextionary:en0.16.0-v1.2.0 38 | proxy: 39 | image: envoyproxy/envoy:v1.29-latest 40 | ports: 41 | - 10000:10000 42 | volumes: 43 | - ./proxy:/etc/envoy 44 | ... 45 | -------------------------------------------------------------------------------- /ci/docker-compose-rbac.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-rbac: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8085' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - 8092:8085 16 | - "50063:50051" 17 | restart: on-failure:0 18 | environment: 19 | ENABLE_MODULES: "generative-dummy,reranker-dummy" 20 | AUTHENTICATION_APIKEY_ENABLED: "true" 21 | AUTHENTICATION_APIKEY_ALLOWED_KEYS: "admin-key,custom-key" 22 | AUTHENTICATION_APIKEY_USERS: "admin-user,custom-user" 23 | AUTHORIZATION_ADMIN_USERS: "admin-user" 24 | PERSISTENCE_DATA_PATH: "./data-weaviate-0" 25 | CLUSTER_IN_LOCALHOST: "true" 26 | CLUSTER_GOSSIP_BIND_PORT: "7100" 27 | CLUSTER_DATA_BIND_PORT: "7101" 28 | RAFT_BOOTSTRAP_EXPECT: "1" 29 | AUTHORIZATION_ENABLE_RBAC: "true" 30 | AUTHENTICATION_DB_USERS_ENABLED: "true" 31 | AUTHENTICATION_OIDC_ENABLED: 'true' 32 | AUTHENTICATION_OIDC_CLIENT_ID: 'wcs' 33 | AUTHENTICATION_OIDC_ISSUER: 'https://auth.wcs.api.weaviate.io/auth/realms/SeMI' 34 | AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email' 35 | AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups' 36 | ... 37 | -------------------------------------------------------------------------------- /ci/docker-compose-wcs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate-auth-wcs: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8085' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - 8085:8085 16 | - "50056:50051" 17 | restart: on-failure:0 18 | environment: 19 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 20 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false' 21 | AUTHENTICATION_OIDC_ENABLED: 'true' 22 | AUTHENTICATION_OIDC_CLIENT_ID: 'wcs' 23 | AUTHENTICATION_OIDC_ISSUER: 'https://auth.wcs.api.weaviate.io/auth/realms/SeMI' 24 | AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email' 25 | AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups' 26 | AUTHORIZATION_ADMINLIST_ENABLED: 'true' 27 | AUTHORIZATION_ADMINLIST_USERS: 'oidc-test-user@weaviate.io' 28 | AUTHENTICATION_OIDC_SCOPES: 'openid,email' 29 | AUTHENTICATION_APIKEY_ENABLED: 'true' 30 | AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'my-secret-key' 31 | AUTHENTICATION_APIKEY_USERS: 'oidc-test-user@weaviate.io' 32 | DISABLE_TELEMETRY: 'true' 33 | ... 34 | -------------------------------------------------------------------------------- /ci/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.4' 3 | services: 4 | weaviate: 5 | command: 6 | - --host 7 | - 0.0.0.0 8 | - --port 9 | - '8080' 10 | - --scheme 11 | - http 12 | - --write-timeout=600s 13 | image: semitechnologies/weaviate:${WEAVIATE_VERSION} 14 | ports: 15 | - "8080:8080" 16 | - "50051:50051" 17 | restart: on-failure:0 18 | environment: 19 | CONTEXTIONARY_URL: contextionary:9999 20 | QUERY_DEFAULTS_LIMIT: 25 21 | AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' 22 | PERSISTENCE_DATA_PATH: '/var/lib/weaviate' 23 | DEFAULT_VECTORIZER_MODULE: 'text2vec-contextionary' 24 | ENABLE_MODULES: text2vec-contextionary,backup-filesystem,generative-dummy,generative-anyscale,reranker-dummy,reranker-cohere 25 | BACKUP_FILESYSTEM_PATH: "/tmp/backups" 26 | CLUSTER_GOSSIP_BIND_PORT: "7100" 27 | CLUSTER_DATA_BIND_PORT: "7101" 28 | CLUSTER_HOSTNAME: "node1" 29 | AUTOSCHEMA_ENABLED: 'false' 30 | DISABLE_TELEMETRY: 'true' 31 | DISABLE_LAZY_LOAD_SHARDS: 'true' 32 | GRPC_MAX_MESSAGE_SIZE: 100000000 # 100mb 33 | contextionary: 34 | environment: 35 | OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75 36 | EXTENSIONS_STORAGE_MODE: weaviate 37 | EXTENSIONS_STORAGE_ORIGIN: http://weaviate:8080 38 | NEIGHBOR_OCCURRENCE_IGNORE_PERCENTILE: 5 39 | ENABLE_COMPOUND_SPLITTING: 'false' 40 | image: semitechnologies/contextionary:en0.16.0-v1.2.0 41 | ports: 42 | - 9999:9999 43 | ... 44 | -------------------------------------------------------------------------------- /ci/start_weaviate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | export WEAVIATE_VERSION=$1 6 | 7 | source ./ci/compose.sh 8 | 9 | echo "Stop existing session if running" 10 | compose_down_all 11 | rm -rf weaviate-data || true 12 | 13 | echo "Run Docker compose" 14 | compose_up_all 15 | 16 | echo "Wait until all containers are up" 17 | 18 | for port in $(all_weaviate_ports); do 19 | wait "http://localhost:$port" 20 | done 21 | 22 | echo "All containers running" 23 | -------------------------------------------------------------------------------- /ci/start_weaviate_jt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | export WEAVIATE_VERSION=$1 6 | 7 | source ./ci/compose.sh 8 | 9 | echo "Stop existing session if running" 10 | docker compose -f ci/docker-compose-async.yml down --remove-orphans 11 | rm -rf weaviate-data || true 12 | 13 | echo "Run Docker compose" 14 | docker compose -f ci/docker-compose-async.yml up -d 15 | 16 | echo "Wait until the container is up" 17 | 18 | wait "http://localhost:8090" 19 | 20 | echo "All containers running" 21 | -------------------------------------------------------------------------------- /ci/stop_weaviate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | export WEAVIATE_VERSION=$1 6 | 7 | source ./ci/compose.sh 8 | 9 | compose_down_all 10 | rm -rf weaviate-data || true -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* Change the color of deprecated function messages */ 2 | .deprecated { 3 | color: red !important; 4 | font-weight: bold; 5 | } -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/modules.rst: -------------------------------------------------------------------------------- 1 | Weaviate Library 2 | ================ 3 | 4 | .. toctree:: 5 | :maxdepth: 3 6 | 7 | weaviate 8 | -------------------------------------------------------------------------------- /docs/weaviate.backup.rst: -------------------------------------------------------------------------------- 1 | weaviate.backup 2 | =============== 3 | 4 | .. automodule:: weaviate.backup 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.backup.backup 11 | ^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.backup.backup 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.backup.backup_location 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.backup.backup_location 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.cluster.rst: -------------------------------------------------------------------------------- 1 | weaviate.cluster 2 | ================ 3 | 4 | .. automodule:: weaviate.cluster 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.cluster.types 11 | ^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.cluster.types 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | -------------------------------------------------------------------------------- /docs/weaviate.collections.aggregations.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.aggregations 2 | ================================= 3 | 4 | .. automodule:: weaviate.collections.aggregations 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.collections.aggregations.aggregate 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.collections.aggregations.aggregate 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.collections.aggregations.hybrid 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.collections.aggregations.hybrid 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | weaviate.collections.aggregations.near\_image 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.collections.aggregations.near_image 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | 37 | weaviate.collections.aggregations.near\_object 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. automodule:: weaviate.collections.aggregations.near_object 41 | :members: 42 | :undoc-members: 43 | :show-inheritance: 44 | :private-members: 45 | 46 | weaviate.collections.aggregations.near\_text 47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. automodule:: weaviate.collections.aggregations.near_text 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | :private-members: 54 | 55 | weaviate.collections.aggregations.near\_vector 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. automodule:: weaviate.collections.aggregations.near_vector 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | :private-members: 63 | 64 | weaviate.collections.aggregations.over\_all 65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 66 | 67 | .. automodule:: weaviate.collections.aggregations.over_all 68 | :members: 69 | :undoc-members: 70 | :show-inheritance: 71 | :private-members: 72 | -------------------------------------------------------------------------------- /docs/weaviate.collections.backups.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.backups 2 | ============================ 3 | 4 | .. automodule:: weaviate.collections.backups 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.collections.backups.backups 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.collections.backups.backups 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | -------------------------------------------------------------------------------- /docs/weaviate.collections.batch.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.batch 2 | ========================== 3 | 4 | .. automodule:: weaviate.collections.batch 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.collections.batch.base 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.collections.batch.base 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.collections.batch.batch\_wrapper 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.collections.batch.batch_wrapper 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | weaviate.collections.batch.client 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.collections.batch.client 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | 37 | weaviate.collections.batch.collection 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. automodule:: weaviate.collections.batch.collection 41 | :members: 42 | :undoc-members: 43 | :show-inheritance: 44 | :private-members: 45 | 46 | weaviate.collections.batch.grpc\_batch\_delete 47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. automodule:: weaviate.collections.batch.grpc_batch_delete 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | :private-members: 54 | 55 | weaviate.collections.batch.grpc\_batch\_objects 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. automodule:: weaviate.collections.batch.grpc_batch_objects 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | :private-members: 63 | 64 | weaviate.collections.batch.rest 65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 66 | 67 | .. automodule:: weaviate.collections.batch.rest 68 | :members: 69 | :undoc-members: 70 | :show-inheritance: 71 | :private-members: 72 | -------------------------------------------------------------------------------- /docs/weaviate.collections.cluster.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.cluster 2 | ============================ 3 | 4 | .. automodule:: weaviate.collections.cluster 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.cluster.cluster 11 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. .. automodule:: weaviate.collections.cluster.cluster 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.cluster.sync 20 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. .. automodule:: weaviate.collections.cluster.sync 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.collection.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.collection 2 | =============================== 3 | 4 | .. automodule:: weaviate.collections.collection 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.collection.async\_ 11 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. .. automodule:: weaviate.collections.collection.async_ 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.collection.base 20 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. .. automodule:: weaviate.collections.collection.base 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | 28 | .. weaviate.collections.collection.sync 29 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. .. automodule:: weaviate.collections.collection.sync 32 | .. :members: 33 | .. :undoc-members: 34 | .. :show-inheritance: 35 | .. :private-members: 36 | -------------------------------------------------------------------------------- /docs/weaviate.collections.collections.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.collections 2 | ================================ 3 | 4 | .. automodule:: weaviate.collections.collections 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.collections.collections.async\_ 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.collections.collections.async_ 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.collections.collections.base 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.collections.collections.base 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | weaviate.collections.collections.sync 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.collections.collections.sync 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | -------------------------------------------------------------------------------- /docs/weaviate.collections.config.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.config 2 | =========================== 3 | 4 | .. automodule:: weaviate.collections.config 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.config.config 11 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. .. automodule:: weaviate.collections.config.config 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.config.sync 20 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. .. automodule:: weaviate.collections.config.sync 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.data.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.data 2 | ========================= 3 | 4 | .. automodule:: weaviate.collections.data 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.data.data 11 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. .. automodule:: weaviate.collections.data.data 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.data.sync 20 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. .. automodule:: weaviate.collections.data.sync 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.grpc.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.grpc 2 | ========================= 3 | 4 | .. automodule:: weaviate.collections.grpc 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.collections.grpc.aggregate 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.collections.grpc.aggregate 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.collections.grpc.query 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.collections.grpc.query 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | weaviate.collections.grpc.retry 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.collections.grpc.retry 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | 37 | weaviate.collections.grpc.shared 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. automodule:: weaviate.collections.grpc.shared 41 | :members: 42 | :undoc-members: 43 | :show-inheritance: 44 | :private-members: 45 | 46 | weaviate.collections.grpc.tenants 47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. automodule:: weaviate.collections.grpc.tenants 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | :private-members: 54 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.bm25.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.bm25 2 | ================================= 3 | 4 | .. automodule:: weaviate.collections.queries.bm25 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.bm25.generate module 11 | .. ------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.bm25.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.bm25.query module 20 | .. ---------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.bm25.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.fetch_object_by_id.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.fetch\_object\_by\_id 2 | ================================================== 3 | 4 | .. automodule:: weaviate.collections.queries.fetch_object_by_id 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.fetch\_object\_by\_id.query module 11 | .. --------------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.fetch_object_by_id.query 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.fetch_objects.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.fetch\_objects 2 | =========================================== 3 | 4 | .. automodule:: weaviate.collections.queries.fetch_objects 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.fetch\_objects.generate module 11 | .. ----------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.fetch_objects.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.fetch\_objects.query module 20 | .. -------------------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.fetch_objects.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.fetch_objects_by_ids.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.fetch\_objects\_by\_ids 2 | ==================================================== 3 | 4 | .. automodule:: weaviate.collections.queries.fetch_objects_by_ids 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.fetch\_objects\_by\_ids.generate module 11 | .. -------------------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.fetch_objects_by_ids.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.fetch\_objects\_by\_ids.query module 20 | .. ----------------------------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.fetch_objects_by_ids.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.hybrid.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.hybrid 2 | =================================== 3 | 4 | .. automodule:: weaviate.collections.queries.hybrid 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.hybrid.generate module 11 | .. --------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.hybrid.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.hybrid.query module 20 | .. ------------------------------------------------ 21 | 22 | .. .. automodule:: weaviate.collections.queries.hybrid.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.near_image.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.near\_image 2 | ======================================== 3 | 4 | .. automodule:: weaviate.collections.queries.near_image 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.near\_image.generate module 11 | .. -------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.near_image.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.near\_image.query module 20 | .. ----------------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.near_image.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.near_media.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.near\_media 2 | ======================================== 3 | 4 | .. automodule:: weaviate.collections.queries.near_media 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.near\_media.generate module 11 | .. -------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.near_media.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.near\_media.query module 20 | .. ----------------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.near_media.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.near_object.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.near\_object 2 | ========================================= 3 | 4 | .. automodule:: weaviate.collections.queries.near_object 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.near\_object.generate module 11 | .. --------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.near_object.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.near\_object.query module 20 | .. ------------------------------------------------------ 21 | 22 | .. .. automodule:: weaviate.collections.queries.near_object.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.near_text.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.near\_text 2 | ======================================= 3 | 4 | .. automodule:: weaviate.collections.queries.near_text 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.near\_text.generate module 11 | .. ------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.near_text.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.near\_text.query module 20 | .. ---------------------------------------------------- 21 | 22 | .. .. automodule:: weaviate.collections.queries.near_text.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.near_vector.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries.near\_vector 2 | ========================================= 3 | 4 | .. automodule:: weaviate.collections.queries.near_vector 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.queries.near\_vector.generate module 11 | .. --------------------------------------------------------- 12 | 13 | .. .. automodule:: weaviate.collections.queries.near_vector.generate 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.queries.near\_vector.query module 20 | .. ------------------------------------------------------ 21 | 22 | .. .. automodule:: weaviate.collections.queries.near_vector.query 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.collections.queries.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.queries 2 | ============================ 3 | 4 | .. automodule:: weaviate.collections.queries 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | weaviate.collections.queries.bm25 14 | weaviate.collections.queries.fetch_object_by_id 15 | weaviate.collections.queries.fetch_objects 16 | weaviate.collections.queries.fetch_objects_by_ids 17 | weaviate.collections.queries.hybrid 18 | weaviate.collections.queries.near_image 19 | weaviate.collections.queries.near_media 20 | weaviate.collections.queries.near_object 21 | weaviate.collections.queries.near_text 22 | weaviate.collections.queries.near_vector 23 | 24 | Submodules 25 | ---------- 26 | 27 | weaviate.collections.queries.base 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | 30 | .. automodule:: weaviate.collections.queries.base 31 | :members: 32 | :undoc-members: 33 | :show-inheritance: 34 | :private-members: 35 | -------------------------------------------------------------------------------- /docs/weaviate.collections.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections 2 | ==================== 3 | 4 | .. automodule:: weaviate.collections 5 | :members: 6 | :undoc-members: 7 | 8 | Subpackages 9 | ----------- 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | 14 | weaviate.collections.aggregations 15 | weaviate.collections.backups 16 | weaviate.collections.batch 17 | weaviate.collections.classes 18 | weaviate.collections.cluster 19 | weaviate.collections.collection 20 | weaviate.collections.collections 21 | weaviate.collections.config 22 | weaviate.collections.data 23 | weaviate.collections.grpc 24 | weaviate.collections.queries 25 | weaviate.collections.tenants 26 | 27 | 28 | weaviate.collections.aggregate 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.collections.aggregate 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | 37 | weaviate.collections.filters 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. automodule:: weaviate.collections.filters 41 | :members: 42 | :undoc-members: 43 | :show-inheritance: 44 | :private-members: 45 | 46 | weaviate.collections.generate 47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. automodule:: weaviate.collections.generate 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | :private-members: 54 | 55 | weaviate.collections.iterator 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. automodule:: weaviate.collections.iterator 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | :private-members: 63 | 64 | weaviate.collections.orm 65 | ^^^^^^^^^^^^^^^^^^^^^^^^ 66 | 67 | .. automodule:: weaviate.collections.orm 68 | :members: 69 | :undoc-members: 70 | :show-inheritance: 71 | :private-members: 72 | 73 | weaviate.collections.query 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 75 | 76 | .. automodule:: weaviate.collections.query 77 | :members: 78 | :undoc-members: 79 | :show-inheritance: 80 | :private-members: 81 | -------------------------------------------------------------------------------- /docs/weaviate.collections.tenants.rst: -------------------------------------------------------------------------------- 1 | weaviate.collections.tenants 2 | ============================ 3 | 4 | .. automodule:: weaviate.collections.tenants 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | .. weaviate.collections.tenants.sync 11 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. .. automodule:: weaviate.collections.tenants.sync 14 | .. :members: 15 | .. :undoc-members: 16 | .. :show-inheritance: 17 | .. :private-members: 18 | 19 | .. weaviate.collections.tenants.tenants 20 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. .. automodule:: weaviate.collections.tenants.tenants 23 | .. :members: 24 | .. :undoc-members: 25 | .. :show-inheritance: 26 | .. :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.connect.rst: -------------------------------------------------------------------------------- 1 | weaviate.connect 2 | ================ 3 | 4 | .. automodule:: weaviate.connect 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. weaviate.connect.authentication\_async 10 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | 12 | .. .. automodule:: weaviate.connect.authentication_async 13 | .. :members: 14 | .. :undoc-members: 15 | .. :show-inheritance: 16 | .. :private-members: 17 | 18 | .. weaviate.connect.base 19 | .. ^^^^^^^^^^^^^^^^^^^^^ 20 | 21 | .. .. automodule:: weaviate.connect.base 22 | .. :members: 23 | .. :undoc-members: 24 | .. :show-inheritance: 25 | .. :private-members: 26 | 27 | .. weaviate.connect.helpers 28 | .. ^^^^^^^^^^^^^^^^^^^^^^^^ 29 | 30 | .. .. automodule:: weaviate.connect.helpers 31 | .. :members: 32 | .. :undoc-members: 33 | .. :show-inheritance: 34 | .. :private-members: 35 | 36 | .. weaviate.connect.integrations 37 | .. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 38 | 39 | .. .. automodule:: weaviate.connect.integrations 40 | .. :members: 41 | .. :undoc-members: 42 | .. :show-inheritance: 43 | .. :private-members: 44 | 45 | .. weaviate.connect.v4 46 | .. ^^^^^^^^^^^^^^^^^^^ 47 | 48 | .. .. automodule:: weaviate.connect.v4 49 | .. :members: 50 | .. :undoc-members: 51 | .. :show-inheritance: 52 | .. :private-members: 53 | -------------------------------------------------------------------------------- /docs/weaviate.debug.rst: -------------------------------------------------------------------------------- 1 | weaviate.debug 2 | ============== 3 | 4 | .. automodule:: weaviate.debug 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | 11 | weaviate.debug.types 12 | ^^^^^^^^^^^^^^^^^^^^ 13 | 14 | .. automodule:: weaviate.debug.types 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | :private-members: 19 | -------------------------------------------------------------------------------- /docs/weaviate.exceptions.rst: -------------------------------------------------------------------------------- 1 | Weaviate Exceptions 2 | =================== 3 | 4 | .. automodule:: weaviate.exceptions 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/weaviate.gql.rst: -------------------------------------------------------------------------------- 1 | weaviate.gql 2 | ============ 3 | 4 | .. automodule:: weaviate.gql 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.gql.aggregate 11 | ^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.gql.aggregate 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.gql.filter 20 | ^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.gql.filter 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | -------------------------------------------------------------------------------- /docs/weaviate.outputs.rst: -------------------------------------------------------------------------------- 1 | weaviate.outputs 2 | ================ 3 | 4 | .. automodule:: weaviate.outputs 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.outputs.aggregate 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.outputs.aggregate 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.outputs.backup 20 | ^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.outputs.backup 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | weaviate.outputs.batch 29 | ^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.outputs.batch 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | :private-members: 36 | 37 | weaviate.outputs.cluster 38 | ^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. automodule:: weaviate.outputs.cluster 41 | :members: 42 | :undoc-members: 43 | :show-inheritance: 44 | :private-members: 45 | 46 | weaviate.outputs.config 47 | ^^^^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. automodule:: weaviate.outputs.config 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | :private-members: 54 | 55 | weaviate.outputs.data 56 | ^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. automodule:: weaviate.outputs.data 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | :private-members: 63 | 64 | weaviate.outputs.query 65 | ^^^^^^^^^^^^^^^^^^^^^^ 66 | 67 | .. automodule:: weaviate.outputs.query 68 | :members: 69 | :undoc-members: 70 | :show-inheritance: 71 | :private-members: 72 | 73 | weaviate.outputs.rbac 74 | ^^^^^^^^^^^^^^^^^^^^^ 75 | 76 | .. automodule:: weaviate.outputs.rbac 77 | :members: 78 | :undoc-members: 79 | :show-inheritance: 80 | :private-members: 81 | 82 | weaviate.outputs.tenants 83 | ^^^^^^^^^^^^^^^^^^^^^^^^ 84 | 85 | .. automodule:: weaviate.outputs.tenants 86 | :members: 87 | :undoc-members: 88 | :show-inheritance: 89 | :private-members: 90 | -------------------------------------------------------------------------------- /docs/weaviate.rbac.rst: -------------------------------------------------------------------------------- 1 | weaviate.rbac 2 | ============= 3 | 4 | .. automodule:: weaviate.rbac 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | 10 | weaviate.rbac.models 11 | ^^^^^^^^^^^^^^^^^^^^ 12 | 13 | .. automodule:: weaviate.rbac.models 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | :private-members: 18 | 19 | weaviate.rbac.roles 20 | ^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. automodule:: weaviate.rbac.roles 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | :private-members: 27 | 28 | .. weaviate.rbac.sync 29 | .. ^^^^^^^^^^^^^^^^^^ 30 | 31 | .. .. automodule:: weaviate.rbac.sync 32 | .. :members: 33 | .. :undoc-members: 34 | .. :show-inheritance: 35 | .. :private-members: 36 | -------------------------------------------------------------------------------- /docs/weaviate.rst: -------------------------------------------------------------------------------- 1 | weaviate 2 | -------- 3 | 4 | .. automodule:: weaviate 5 | :members: 6 | :exclude-members: Client,BatchClient,ClientBatchingContextManager 7 | :undoc-members: 8 | :inherited-members: 9 | 10 | Subpackages 11 | ----------- 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | weaviate.backup 17 | weaviate.classes 18 | weaviate.cluster 19 | weaviate.collections 20 | weaviate.connect 21 | weaviate.debug 22 | weaviate.gql 23 | weaviate.outputs 24 | weaviate.rbac 25 | weaviate.users 26 | 27 | 28 | weaviate.auth 29 | ^^^^^^^^^^^^^ 30 | 31 | .. automodule:: weaviate.auth 32 | :members: 33 | :undoc-members: 34 | :private-members: 35 | 36 | weaviate.config 37 | ^^^^^^^^^^^^^^^ 38 | 39 | .. automodule:: weaviate.config 40 | :members: 41 | :undoc-members: 42 | 43 | weaviate.embedded 44 | ^^^^^^^^^^^^^^^^^ 45 | 46 | .. automodule:: weaviate.embedded 47 | :members: 48 | :undoc-members: 49 | -------------------------------------------------------------------------------- /docs/weaviate.users.rst: -------------------------------------------------------------------------------- 1 | weaviate.users 2 | ============== 3 | 4 | .. automodule:: weaviate.users 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | :private-members: 9 | -------------------------------------------------------------------------------- /integration/1234.3gp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/integration/1234.3gp -------------------------------------------------------------------------------- /integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/integration/__init__.py -------------------------------------------------------------------------------- /integration/hobbits.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/integration/hobbits.mp4 -------------------------------------------------------------------------------- /integration/test_collection_multi_node.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from integration.conftest import CollectionFactory 4 | from weaviate.collections.classes.config import ( 5 | Configure, 6 | ConsistencyLevel, 7 | DataType, 8 | Property, 9 | ) 10 | from weaviate.collections.classes.data import DataObject 11 | from weaviate.collections.classes.grpc import MetadataQuery 12 | 13 | 14 | @pytest.mark.parametrize( 15 | "level", [ConsistencyLevel.ONE, ConsistencyLevel.ALL, ConsistencyLevel.QUORUM] 16 | ) 17 | def test_consistency_on_multinode( 18 | collection_factory: CollectionFactory, level: ConsistencyLevel 19 | ) -> None: 20 | collection = collection_factory( 21 | vectorizer_config=Configure.Vectorizer.none(), 22 | properties=[ 23 | Property(name="name", data_type=DataType.TEXT), 24 | ], 25 | replication_config=Configure.replication(factor=2, async_enabled=False), 26 | ports=(8087, 50058), 27 | ).with_consistency_level(level) 28 | 29 | collection.data.insert({"name": "first"}) 30 | ret = collection.data.insert_many( 31 | [DataObject(properties={"name": "second"}), DataObject(properties={"name": "third"})] 32 | ) 33 | assert not ret.has_errors 34 | 35 | objects = collection.query.fetch_objects( 36 | return_metadata=MetadataQuery(is_consistent=True) 37 | ).objects 38 | for obj in objects: 39 | assert obj.metadata.is_consistent 40 | -------------------------------------------------------------------------------- /integration/test_collections_sorting.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from integration.conftest import ClientFactory 4 | 5 | 6 | @pytest.fixture 7 | def sorting_test_client(client_factory: ClientFactory): 8 | client = client_factory() 9 | try: 10 | yield client 11 | finally: 12 | client.close() 13 | 14 | 15 | def test_collections_list_all_sorting(sorting_test_client): 16 | """Test that collections.list_all() returns collections sorted alphabetically by key.""" 17 | client = sorting_test_client 18 | 19 | try: 20 | # Create collections with names in non-alphabetical order 21 | client.collections.create(name="SortingTestCollectionC") 22 | client.collections.create(name="SortingTestCollectionA") 23 | client.collections.create(name="SortingTestCollectionB") 24 | 25 | # Get all collections 26 | collections = client.collections.list_all() 27 | 28 | # Get the keys and filter only our test collections 29 | collection_keys = list(collections.keys()) 30 | test_collections = [k for k in collection_keys if k.startswith("SortingTestCollection")] 31 | 32 | # Verify they are in alphabetical order 33 | assert test_collections == sorted(test_collections) 34 | 35 | # Test with simple=False as well 36 | collections = client.collections.list_all(simple=False) 37 | collection_keys = list(collections.keys()) 38 | test_collections = [k for k in collection_keys if k.startswith("SortingTestCollection")] 39 | assert test_collections == sorted(test_collections) 40 | 41 | finally: 42 | # Clean up 43 | client.collections.delete( 44 | ["SortingTestCollectionA", "SortingTestCollectionB", "SortingTestCollectionC"] 45 | ) 46 | -------------------------------------------------------------------------------- /integration/test_gql_raw_v4.py: -------------------------------------------------------------------------------- 1 | import weaviate 2 | from weaviate.client import WeaviateClient 3 | from weaviate.collections.classes.config import Configure, DataType, Property 4 | 5 | 6 | def test_raw_gql_v4() -> None: 7 | name = "RawGraphQlTest" 8 | number = 20 9 | client: WeaviateClient = weaviate.connect_to_local() 10 | collection = client.collections.create( 11 | name=name, 12 | properties=[Property(name="Name", data_type=DataType.TEXT)], 13 | vectorizer_config=Configure.Vectorizer.none(), 14 | ) 15 | try: 16 | collection.data.insert_many([{"Name": f"name {i}"} for i in range(number)]) 17 | 18 | response = client.graphql_raw_query( 19 | """{ 20 | Aggregate {RawGraphQlTest{meta {count}}} 21 | Get{RawGraphQlTest{name}} 22 | }""" 23 | ) 24 | 25 | assert response.errors is None 26 | assert response.aggregate[name][0]["meta"]["count"] == number 27 | assert len(response.get[name]) == number 28 | finally: 29 | client.collections.delete(name) 30 | client.close() 31 | 32 | 33 | def test_raw_gql_v4_error() -> None: 34 | with weaviate.connect_to_local() as client: 35 | try: 36 | client.collections.create(name="dummy") 37 | response = client.graphql_raw_query( 38 | """{ 39 | Get{IDoNotExist{name}} 40 | }""" 41 | ) 42 | 43 | assert response.errors is not None 44 | assert len(response.get) == 0 45 | assert len(response.aggregate) == 0 46 | assert len(response.explore) == 0 47 | finally: 48 | client.collections.delete("dummy") 49 | -------------------------------------------------------------------------------- /integration/weaviate-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/integration/weaviate-logo.png -------------------------------------------------------------------------------- /integration_embedded/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/integration_embedded/__init__.py -------------------------------------------------------------------------------- /journey_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/journey_tests/__init__.py -------------------------------------------------------------------------------- /journey_tests/gunicorn/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/journey_tests/gunicorn/__init__.py -------------------------------------------------------------------------------- /journey_tests/gunicorn/asgi.py: -------------------------------------------------------------------------------- 1 | from contextlib import asynccontextmanager 2 | from typing import TypedDict 3 | 4 | from fastapi import FastAPI 5 | from fastapi.responses import JSONResponse 6 | 7 | import weaviate 8 | from journey_tests.journeys import AsyncJourneys, SyncJourneys 9 | 10 | # some dependency instantiate a sync client on import/file root 11 | client = weaviate.connect_to_local(port=8090, grpc_port=50061) 12 | client.close() 13 | 14 | 15 | class Journeys(TypedDict): 16 | sync: SyncJourneys 17 | async_: AsyncJourneys 18 | 19 | 20 | journeys: Journeys = {} 21 | 22 | 23 | @asynccontextmanager 24 | async def lifespan(app: FastAPI): 25 | journeys["async_"] = await AsyncJourneys.use() 26 | journeys["sync"] = SyncJourneys.use() 27 | try: 28 | yield 29 | finally: 30 | await journeys["async_"].close() 31 | journeys["sync"].close() 32 | 33 | 34 | app = FastAPI(lifespan=lifespan) 35 | 36 | 37 | @app.get("/sync-in-sync") 38 | def sync_in_sync() -> JSONResponse: 39 | return JSONResponse(content=journeys["sync"].simple()) 40 | 41 | 42 | @app.get("/sync-in-async") 43 | async def sync_in_async() -> JSONResponse: 44 | return JSONResponse(content=journeys["sync"].simple()) 45 | 46 | 47 | @app.get("/async-in-async") 48 | async def async_in_async() -> JSONResponse: 49 | return JSONResponse(content=await journeys["async_"].simple()) 50 | 51 | 52 | @app.get("/health") 53 | def health() -> JSONResponse: 54 | return JSONResponse(content={"status": "ok"}) 55 | 56 | 57 | if __name__ == "__main__": 58 | import uvicorn 59 | 60 | uvicorn.run(app, host="0.0.0.0", port=8000) 61 | -------------------------------------------------------------------------------- /journey_tests/gunicorn/test.py: -------------------------------------------------------------------------------- 1 | import httpx 2 | 3 | 4 | def test_sync_in_sync() -> None: 5 | res = httpx.get("http://localhost:8000/sync-in-sync") 6 | assert res.status_code == 200 7 | assert len(res.json()) == 100 8 | 9 | 10 | def test_sync_in_async() -> None: 11 | res = httpx.get("http://localhost:8000/sync-in-async") 12 | assert res.status_code == 200 13 | assert len(res.json()) == 100 14 | 15 | 16 | def test_async_in_async() -> None: 17 | res = httpx.get("http://localhost:8000/async-in-async") 18 | assert res.status_code == 200 19 | assert len(res.json()) == 100 20 | -------------------------------------------------------------------------------- /journey_tests/gunicorn/wsgi.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from flask import Flask, g 4 | 5 | from journey_tests.journeys import SyncJourneys 6 | 7 | app = Flask(__name__) 8 | 9 | 10 | def get_sync_client() -> SyncJourneys: 11 | if "sync" not in g: 12 | g.sync = SyncJourneys.use() 13 | return g.sync 14 | 15 | 16 | @app.route("/sync-in-sync") 17 | def sync() -> List[dict]: 18 | return get_sync_client().simple() 19 | 20 | 21 | if __name__ == "__main__": 22 | app.run(debug=False, host="0.0.0.0") 23 | -------------------------------------------------------------------------------- /journey_tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function wait(){ 4 | MAX_WAIT_SECONDS=60 5 | ALREADY_WAITING=0 6 | 7 | echo "Waiting for $1" 8 | while true; do 9 | # first check if weaviate already responds 10 | if ! curl -s $1 > /dev/null; then 11 | continue 12 | fi 13 | 14 | # endpoint available, check if it is ready 15 | HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$1/health") 16 | 17 | if [ "$HTTP_STATUS" -eq 200 ]; then 18 | break 19 | else 20 | echo "testing app is not up yet. (waited for ${ALREADY_WAITING}s)" 21 | if [ $ALREADY_WAITING -gt $MAX_WAIT_SECONDS ]; then 22 | echo "testing app did not start up in $MAX_WAIT_SECONDS." 23 | exit 1 24 | else 25 | sleep 2 26 | let ALREADY_WAITING=$ALREADY_WAITING+2 27 | fi 28 | fi 29 | done 30 | 31 | echo "testing app is up and running!" 32 | } 33 | 34 | pytest ./journey_tests 35 | 36 | pip install gunicorn 37 | pip install uvicorn 38 | 39 | nohup gunicorn --bind=0.0.0.0:8000 --workers=2 --worker-class "uvicorn.workers.UvicornWorker" --preload journey_tests.gunicorn.asgi:app & 40 | echo $! > gunicorn_pid.txt 41 | wait "http://localhost:8000" 42 | 43 | pytest ./journey_tests/gunicorn/test.py 44 | kill -9 $(cat gunicorn_pid.txt) 45 | rm gunicorn_pid.txt 46 | 47 | nohup gunicorn --bind=0.0.0.0:8000 --workers=2 --worker-class "gevent" --preload journey_tests.gunicorn.wsgi:app & 48 | echo $! > gunicorn_pid.txt 49 | wait "http://localhost:8000" 50 | 51 | pytest ./journey_tests/gunicorn/test.py 52 | kill -9 $(cat gunicorn_pid.txt) 53 | rm gunicorn_pid.txt 54 | 55 | -------------------------------------------------------------------------------- /journey_tests/test_fastapi.py: -------------------------------------------------------------------------------- 1 | from contextlib import asynccontextmanager 2 | from typing import TypedDict 3 | 4 | from fastapi import FastAPI 5 | from fastapi.responses import JSONResponse 6 | from fastapi.testclient import TestClient 7 | 8 | from journey_tests.journeys import AsyncJourneys, SyncJourneys 9 | 10 | 11 | class Journeys(TypedDict): 12 | sync: SyncJourneys 13 | async_: AsyncJourneys 14 | 15 | 16 | journeys: Journeys = {} 17 | 18 | 19 | @asynccontextmanager 20 | async def lifespan(app: FastAPI): 21 | journeys["async_"] = await AsyncJourneys.use() 22 | journeys["sync"] = SyncJourneys.use() 23 | try: 24 | yield 25 | finally: 26 | await journeys["async_"].close() 27 | journeys["sync"].close() 28 | 29 | 30 | app = FastAPI(lifespan=lifespan) 31 | 32 | 33 | @app.get("/sync-in-sync") 34 | def sync_in_sync() -> JSONResponse: 35 | return JSONResponse(content=journeys["sync"].simple()) 36 | 37 | 38 | @app.get("/sync-in-async") 39 | async def sync_in_async() -> JSONResponse: 40 | return JSONResponse(content=journeys["sync"].simple()) 41 | 42 | 43 | @app.get("/async-in-async") 44 | async def async_in_async() -> JSONResponse: 45 | return JSONResponse(content=await journeys["async_"].simple()) 46 | 47 | 48 | def test_sync_in_sync() -> None: 49 | with TestClient(app) as client: 50 | res = client.get("/sync-in-sync") 51 | assert res.status_code == 200 52 | assert len(res.json()) == 100 53 | 54 | 55 | def test_sync_in_async() -> None: 56 | with TestClient(app) as client: 57 | res = client.get("/sync-in-async") 58 | assert res.status_code == 200 59 | assert len(res.json()) == 100 60 | 61 | 62 | def test_async_in_async() -> None: 63 | with TestClient(app) as client: 64 | res = client.get("/async-in-async") 65 | assert res.status_code == 200 66 | assert len(res.json()) == 100 67 | -------------------------------------------------------------------------------- /journey_tests/test_flask.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from flask import Flask, g 4 | 5 | from journey_tests.journeys import AsyncJourneys, SyncJourneys 6 | 7 | app = Flask(__name__) 8 | 9 | 10 | def get_sync_client() -> SyncJourneys: 11 | if "sync" not in g: 12 | g.sync = SyncJourneys.use() 13 | return g.sync 14 | 15 | 16 | async def get_async_client() -> AsyncJourneys: 17 | if "async" not in g: 18 | g.async_ = await AsyncJourneys.use() 19 | return g.async_ 20 | 21 | 22 | @app.route("/sync-in-sync") 23 | def sync() -> List[dict]: 24 | return get_sync_client().simple() 25 | 26 | 27 | @app.route("/sync-in-async") 28 | async def sync_() -> List[dict]: 29 | return get_sync_client().simple() 30 | 31 | 32 | @app.route("/async-in-async") 33 | async def async_() -> List[dict]: 34 | return await (await get_async_client()).simple() 35 | 36 | 37 | def test_sync_in_sync() -> None: 38 | res = app.test_client().get("/sync-in-sync") 39 | assert res.status_code == 200 40 | assert len(res.json) == 100 41 | 42 | 43 | def test_sync_in_async() -> None: 44 | res = app.test_client().get("/sync-in-async") 45 | assert res.status_code == 200 46 | assert len(res.json) == 100 47 | 48 | 49 | def test_async_in_async() -> None: 50 | res = app.test_client().get("/async-in-async") 51 | assert res.status_code == 200 52 | assert len(res.json) == 100 53 | -------------------------------------------------------------------------------- /journey_tests/test_litestar.py: -------------------------------------------------------------------------------- 1 | from contextlib import asynccontextmanager 2 | from typing import List 3 | 4 | from litestar import Litestar, get 5 | from litestar.datastructures import State 6 | from litestar.testing import TestClient 7 | 8 | from journey_tests.journeys import AsyncJourneys, SyncJourneys 9 | 10 | 11 | class MyState(State): 12 | sync: SyncJourneys 13 | async_: AsyncJourneys 14 | 15 | 16 | @asynccontextmanager 17 | async def lifespan(app: Litestar): 18 | sync = SyncJourneys.use() 19 | async_ = await AsyncJourneys.use() 20 | app.state.sync = sync 21 | app.state.async_ = async_ 22 | try: 23 | yield 24 | finally: 25 | sync.close() 26 | await async_.close() 27 | 28 | 29 | @get("/sync-in-sync", sync_to_thread=True) 30 | def sync_in_sync(state: MyState) -> List[dict]: 31 | return state.sync.simple() 32 | 33 | 34 | @get("/sync-in-async", sync_to_thread=True) 35 | async def sync_in_async(state: MyState) -> List[dict]: 36 | return state.sync.simple() 37 | 38 | 39 | @get("/async-in-async") 40 | async def async_in_async(state: MyState) -> List[dict]: 41 | return await state.async_.simple() 42 | 43 | 44 | app = Litestar(route_handlers=[sync_in_sync, sync_in_async, async_in_async], lifespan=[lifespan]) 45 | 46 | 47 | def test_sync_in_sync() -> None: 48 | with TestClient(app=app) as client: 49 | res = client.get("/sync-in-sync") 50 | assert res.status_code == 200 51 | assert len(res.json()) == 100 52 | 53 | 54 | def test_sync_in_async() -> None: 55 | with TestClient(app=app) as client: 56 | res = client.get("/sync-in-async") 57 | assert res.status_code == 200 58 | assert len(res.json()) == 100 59 | 60 | 61 | def test_async_in_async() -> None: 62 | with TestClient(app=app) as client: 63 | res = client.get("/async-in-async") 64 | assert res.status_code == 200 65 | assert len(res.json()) == 100 66 | -------------------------------------------------------------------------------- /mock_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/mock_tests/__init__.py -------------------------------------------------------------------------------- /mock_tests/test_tenants_get.py: -------------------------------------------------------------------------------- 1 | import weaviate 2 | from weaviate.classes.tenants import TenantActivityStatus 3 | 4 | 5 | def test_tenants_get(tenants_collection: weaviate.collections.Collection) -> None: 6 | tenants = list(tenants_collection.tenants.get().values()) 7 | assert len(tenants) == 10 8 | 9 | assert tenants[0].name == "tenant1" 10 | assert tenants[0].activity_status == TenantActivityStatus.ACTIVE 11 | 12 | assert tenants[1].name == "tenant2" 13 | assert tenants[1].activity_status == TenantActivityStatus.INACTIVE 14 | 15 | assert tenants[2].name == "tenant3" 16 | assert tenants[2].activity_status == TenantActivityStatus.OFFLOADED 17 | 18 | assert tenants[3].name == "tenant4" 19 | assert tenants[3].activity_status == TenantActivityStatus.OFFLOADING 20 | 21 | assert tenants[4].name == "tenant5" 22 | assert tenants[4].activity_status == TenantActivityStatus.ONLOADING 23 | 24 | assert tenants[5].name == "tenant6" 25 | assert tenants[5].activity_status == TenantActivityStatus.ACTIVE 26 | 27 | assert tenants[6].name == "tenant7" 28 | assert tenants[6].activity_status == TenantActivityStatus.INACTIVE 29 | 30 | assert tenants[7].name == "tenant8" 31 | assert tenants[7].activity_status == TenantActivityStatus.OFFLOADED 32 | 33 | assert tenants[8].name == "tenant9" 34 | assert tenants[8].activity_status == TenantActivityStatus.OFFLOADING 35 | 36 | assert tenants[9].name == "tenant10" 37 | assert tenants[9].activity_status == TenantActivityStatus.ONLOADING 38 | -------------------------------------------------------------------------------- /mock_tests/test_timeouts.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import weaviate 4 | from weaviate.exceptions import WeaviateQueryError, WeaviateTimeoutError 5 | 6 | 7 | def test_timeout_rest_query(timeouts_collection: weaviate.collections.Collection): 8 | with pytest.raises(WeaviateTimeoutError): 9 | timeouts_collection.config.get() 10 | 11 | 12 | def test_timeout_rest_insert(timeouts_collection: weaviate.collections.Collection): 13 | with pytest.raises(WeaviateTimeoutError): 14 | timeouts_collection.data.insert(properties={"what": "ever"}) 15 | 16 | 17 | def test_timeout_grpc_query(timeouts_collection: weaviate.collections.Collection): 18 | with pytest.raises(WeaviateQueryError) as recwarn: 19 | timeouts_collection.query.fetch_objects() 20 | assert "DEADLINE_EXCEEDED" in str(recwarn) 21 | 22 | 23 | def test_timeout_grpc_insert(timeouts_collection: weaviate.collections.Collection): 24 | with pytest.raises(WeaviateQueryError) as recwarn: 25 | timeouts_collection.data.insert_many([{"what": "ever"}]) 26 | assert "DEADLINE_EXCEEDED" in str(recwarn) 27 | -------------------------------------------------------------------------------- /profiling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/profiling/__init__.py -------------------------------------------------------------------------------- /publishing.md: -------------------------------------------------------------------------------- 1 | 1. Set the new version in the `weaviate/version.py` and `test/test_version.py`. 2 | 2. Run all tests. (Check `test/README.md`) 3 | 3. Then build the new package:\ 4 | `python setup.py sdist bdist_wheel` 5 | 4. And check it:\ 6 | `twine check dist/*` 7 | 5. Check if you are on correct **GitBranch**. 8 | 6. **Commit** the most current version to GitHub if this has not been done yet. 9 | 7. Check TravisCI status to be `OK!`, if not `OK!` fix it. 10 | 8. Give the commit of the current version a proper tag:\ 11 | `git tag -a '' -m '' && git push --tags` 12 | tags are either in the form of `v0.2.5` or `v0.2.5rc0`. 13 | 9. Optional: install package locally by running `pip install .` and check if the version is set correctly. 14 | 10. Finally publish:\ 15 | `twine upload dist/*` 16 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools >= 65", 4 | "setuptools_scm[toml] >6.2", 5 | "wheel >= 0.38.1", 6 | ] 7 | build-backend = 'setuptools.build_meta' 8 | 9 | [tool.setuptools_scm] 10 | 11 | [tool.pydoclint] 12 | style = "google" -------------------------------------------------------------------------------- /pyrightconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "weaviate", "integration" 4 | ], 5 | 6 | "exclude": [ 7 | "**integration**","**/tests","weaviate/proto/**", 8 | ], 9 | 10 | "stubPath": ".", 11 | 12 | "reportUnusedVariable": true, 13 | "reportMissingTypeStubs": false, 14 | "reportGeneralTypeIssues": false, 15 | "reportInvalidTypeVarUse": true, 16 | "reportOptionalMemberAccess": true, 17 | "reportPropertyTypeMismatch": false, 18 | "reportMissingModuleSource": false, 19 | "reportMissingImports": false 20 | } 21 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = -m 'not profiling' --benchmark-skip -l 3 | markers = 4 | profiling: marks tests that can be profiled 5 | asyncio_default_fixture_loop_scope = function -------------------------------------------------------------------------------- /requirements-devel.txt: -------------------------------------------------------------------------------- 1 | httpx==0.26.0 2 | validators==0.34.0 3 | authlib==1.3.1 4 | grpcio==1.66.2 5 | grpcio-tools==1.66.2 6 | grpcio-health-checking==1.66.2 7 | pydantic==2.8.0 8 | deprecation==2.1.0 9 | 10 | build 11 | twine 12 | wheel 13 | importlib_metadata==8.6.1 14 | setuptools_scm 15 | Sphinx>=7.0.0 16 | sphinx-rtd-theme==3.0.2 17 | autodoc-pydantic==2.2.0 18 | importlib_metadata==8.6.1 19 | 20 | pytest==8.3.4 21 | pytest-cov==6.0.0 22 | pytest-asyncio==0.25.3 23 | pytest-benchmark==5.1.0 24 | pytest-profiling==1.8.1 25 | coverage==7.6.10 26 | pytest-xdist==3.6.1 27 | werkzeug==3.1.3 28 | pytest-httpserver==1.1.1 29 | py-spy==0.4.0 30 | 31 | numpy>=1.24.4,<3.0.0 32 | pandas>=2.0.3,<3.0.0 33 | polars>=0.20.26,<1.18.0 34 | 35 | fastapi>=0.111.0,<1.0.0 36 | flask[async]>=2.0.0,<4.0.0 37 | litestar>=2.14.0,<3.0.0 38 | 39 | mypy==1.14.1 40 | mypy-extensions==1.0.0 41 | tomli==2.2.1 42 | types-protobuf==5.28.3.20241203 43 | types-urllib3==1.26.25.14 44 | typing_extensions==4.12.2 45 | 46 | pre-commit 47 | flake8 48 | flake8-bugbear==24.12.12 49 | flake8-comprehensions==3.16.0 50 | flake8-builtins==2.5.0 51 | flake8-docstrings==1.7.0 52 | pydoclint==0.6.5 53 | ruff==0.11.7 54 | 55 | weaviate-agents>=0.3.0,<1.0.0 56 | -------------------------------------------------------------------------------- /ruff.toml: -------------------------------------------------------------------------------- 1 | line-length = 100 2 | exclude = [ 3 | ".git", 4 | ".github", 5 | ".pytest_cache", 6 | ".venv", 7 | "venv", 8 | "build", 9 | "dist", 10 | "docs", 11 | "weaviate/proto" 12 | ] 13 | -------------------------------------------------------------------------------- /run-mypy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | python3 -m venv venv 4 | source venv/bin/activate 5 | pip install -r requirements-devel.txt >/dev/null 2>&1 6 | 7 | echo "Static checking ./weaviate:" 8 | mypy --config-file ./pyproject.toml ./weaviate 9 | echo "Static checking ./integration:" 10 | mypy --config-file ./pyproject.toml --warn-unused-ignores ./weaviate 11 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = weaviate-client 3 | description = A python native Weaviate client 4 | long_description = file: README.rst 5 | long_description_content_type = text/x-rst; charset=UTF-8 6 | url = https://github.com/weaviate/weaviate-python-client 7 | author = Weaviate 8 | author_email = hello@weaviate.io, 9 | license_files = LICENSE 10 | license = BSD 3-clause 11 | project_urls = 12 | Documentation = https://weaviate-python-client.readthedocs.io 13 | Source = https://github.com/weaviate/weaviate-python-client 14 | Tracker = https://github.com/weaviate/weaviate-python-client/issues 15 | dynamic = ["version"] 16 | 17 | [options] 18 | zip_safe = False 19 | packages = 20 | weaviate 21 | weaviate.backup 22 | weaviate.classes 23 | weaviate.cluster 24 | weaviate.collections 25 | weaviate.connect 26 | weaviate.debug 27 | weaviate.gql 28 | weaviate.outputs 29 | weaviate.proto 30 | weaviate.proto.v1 31 | weaviate.rbac 32 | weaviate.users 33 | 34 | platforms = any 35 | include_package_data = True 36 | install_requires = 37 | httpx>=0.26.0,<0.29.0 38 | validators==0.34.0 39 | authlib>=1.2.1,<1.3.2 40 | pydantic>=2.8.0,<3.0.0 41 | grpcio>=1.66.2,<2.0.0 42 | grpcio-tools>=1.66.2,<2.0.0 43 | grpcio-health-checking>=1.66.2,<2.0.0 44 | deprecation>=2.1.0,<3.0.0 45 | python_requires = >=3.9 46 | 47 | [options.extras_require] 48 | agents = 49 | weaviate-agents >=0.3.0, <1.0.0 50 | 51 | [options.package_data] 52 | # If any package or subpackage contains *.txt, *.rst or *.md files, include them: 53 | *: ["*.txt", "*.rst", "*.md", LICENSE], 54 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | if __name__ == "__main__": 4 | setup() 5 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/test/__init__.py -------------------------------------------------------------------------------- /test/collection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/test/collection/__init__.py -------------------------------------------------------------------------------- /test/collection/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from weaviate.config import ConnectionConfig 4 | from weaviate.connect import ConnectionParams, ConnectionV4 5 | 6 | 7 | @pytest.fixture 8 | def connection() -> ConnectionV4: 9 | con = ConnectionV4( 10 | ConnectionParams.from_url("http://localhost:8080", 50051), 11 | None, 12 | (10, 60), 13 | None, 14 | True, 15 | None, 16 | ConnectionConfig(), 17 | None, 18 | ) 19 | con._Connection__connected = True 20 | return con 21 | -------------------------------------------------------------------------------- /test/collection/test_aggregates.py: -------------------------------------------------------------------------------- 1 | from typing import Awaitable, Callable 2 | 3 | import pytest 4 | 5 | from weaviate.collections.aggregate import _AggregateCollectionAsync 6 | from weaviate.connect import ConnectionV4 7 | from weaviate.exceptions import WeaviateInvalidInputError 8 | 9 | 10 | async def _test_aggregate(aggregate: Callable[[], Awaitable]) -> None: 11 | with pytest.raises(WeaviateInvalidInputError): 12 | await aggregate() 13 | 14 | 15 | @pytest.mark.asyncio 16 | async def test_bad_aggregate_inputs(connection: ConnectionV4) -> None: 17 | aggregate = _AggregateCollectionAsync(connection, "dummy", None, None, False) 18 | # over_all 19 | await _test_aggregate(lambda: aggregate.over_all(filters="wrong")) 20 | await _test_aggregate(lambda: aggregate.over_all(group_by=42)) 21 | await _test_aggregate(lambda: aggregate.over_all(total_count="wrong")) 22 | await _test_aggregate(lambda: aggregate.over_all(return_metrics="wrong")) 23 | 24 | # near text 25 | await _test_aggregate(lambda: aggregate.near_text(42)) 26 | await _test_aggregate(lambda: aggregate.near_text("hi", certainty="wrong")) 27 | await _test_aggregate(lambda: aggregate.near_text("hi", distance="wrong")) 28 | await _test_aggregate(lambda: aggregate.near_text("hi", move_to="wrong")) 29 | await _test_aggregate(lambda: aggregate.near_text("hi", move_away="wrong")) 30 | await _test_aggregate(lambda: aggregate.near_text("hi", object_limit="wrong")) 31 | 32 | # near object 33 | await _test_aggregate(lambda: aggregate.near_object(42)) 34 | 35 | # near vector 36 | await _test_aggregate(lambda: aggregate.near_vector(42)) 37 | 38 | # near image 39 | await _test_aggregate(lambda: aggregate.near_image(42)) 40 | -------------------------------------------------------------------------------- /test/collection/test_batch.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from weaviate.collections.classes.batch import MAX_STORED_RESULTS, BatchObjectReturn 4 | 5 | 6 | def test_batch_object_return_add() -> None: 7 | lhs_uuids = [uuid.uuid4() for _ in range(MAX_STORED_RESULTS)] 8 | lhs = BatchObjectReturn( 9 | _all_responses=lhs_uuids, 10 | elapsed_seconds=0.1, 11 | errors={}, 12 | has_errors=False, 13 | uuids=dict(e for e in enumerate(lhs_uuids)), 14 | ) 15 | rhs_uuids = [uuid.uuid4() for _ in range(2)] 16 | rhs = BatchObjectReturn( 17 | _all_responses=rhs_uuids, 18 | elapsed_seconds=0.1, 19 | errors={}, 20 | has_errors=False, 21 | uuids={ 22 | MAX_STORED_RESULTS: rhs_uuids[0], 23 | MAX_STORED_RESULTS + 1: rhs_uuids[1], 24 | }, 25 | ) 26 | result = lhs + rhs 27 | assert len(result.all_responses) == MAX_STORED_RESULTS 28 | assert len(result.uuids) == MAX_STORED_RESULTS 29 | assert result.uuids == { 30 | idx + len(rhs_uuids): v 31 | for idx, v in enumerate(lhs_uuids[len(rhs_uuids) : MAX_STORED_RESULTS] + rhs_uuids) 32 | } 33 | -------------------------------------------------------------------------------- /test/collection/test_byteops.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.grpc.shared import _ByteOps 2 | 3 | 4 | def test_decode_float32s(): 5 | assert _ByteOps.decode_float32s(b"") == [] 6 | assert _ByteOps.decode_float32s(b"\x00\x00\x80?\x00\x00\x00@\x00\x00\x00\x00") == [ 7 | 1.0, 8 | 2.0, 9 | 0.0, 10 | ] 11 | 12 | 13 | def test_decode_float64s(): 14 | assert _ByteOps.decode_float64s(b"") == [] 15 | assert _ByteOps.decode_float64s( 16 | b"\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00" 17 | ) == [1.0, 2.0, 0.0] 18 | 19 | 20 | def test_decode_int64s(): 21 | assert _ByteOps.decode_int64s(b"") == [] 22 | assert _ByteOps.decode_int64s( 23 | b"\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00" 24 | ) == [1, 2] 25 | -------------------------------------------------------------------------------- /test/collection/test_classes.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pydantic import ValidationError 3 | 4 | from weaviate.collections.classes.filters import Filter 5 | from weaviate.collections.classes.grpc import ( 6 | QueryReference, 7 | Sort, 8 | _QueryReference, 9 | _QueryReferenceMultiTarget, 10 | ) 11 | 12 | 13 | def test_link_to_errors_on_extra_variable() -> None: 14 | with pytest.raises(ValidationError): 15 | QueryReference(link_on="ref", return_property="name") 16 | 17 | 18 | def test_link_to_multi_target_errors_on_extra_variable() -> None: 19 | with pytest.raises(ValidationError): 20 | _QueryReferenceMultiTarget(link_on="ref", target_colection="Test") 21 | 22 | 23 | def test_link_to_multi_target_is_link_to() -> None: 24 | link_to = _QueryReferenceMultiTarget(link_on="ref", target_collection="Test") 25 | assert isinstance(link_to, _QueryReference) 26 | 27 | 28 | def test_direct_init_filter() -> None: 29 | with pytest.raises(TypeError): 30 | Filter() 31 | 32 | 33 | def test_direct_init_sort() -> None: 34 | with pytest.raises(TypeError): 35 | Sort() 36 | -------------------------------------------------------------------------------- /test/collection/test_client.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import weaviate 4 | from weaviate.exceptions import WeaviateInvalidInputError 5 | 6 | 7 | def test_client_no_connection_params_nor_embedded_options() -> None: 8 | with pytest.raises(TypeError): 9 | weaviate.client.WeaviateClient() 10 | 11 | 12 | def test_client_both_connection_params_and_embedded_options() -> None: 13 | with pytest.raises(TypeError): 14 | weaviate.client.WeaviateClient( 15 | connection_params=weaviate.connect.ConnectionParams.from_url( 16 | "http://localhost:8080", 50051 17 | ), 18 | embedded_options=weaviate.embedded.EmbeddedOptions(), 19 | ) 20 | 21 | 22 | def test_client_bad_connection_params() -> None: 23 | with pytest.raises(TypeError): 24 | weaviate.client.WeaviateClient(connection_params="http://localhost:8080") 25 | 26 | 27 | def test_client_bad_embedded_options() -> None: 28 | with pytest.raises(WeaviateInvalidInputError): 29 | weaviate.client.WeaviateClient(embedded_options="bad") 30 | 31 | 32 | def test_connect_to_wcs_failes_with_null_cluster_url() -> None: 33 | with pytest.raises(WeaviateInvalidInputError): 34 | weaviate.connect_to_wcs(None, None) # type: ignore 35 | -------------------------------------------------------------------------------- /test/collection/test_collection_model.py: -------------------------------------------------------------------------------- 1 | import pytest as pytest 2 | 3 | pytest.skip("Not implemented yet", allow_module_level=True) 4 | 5 | # import sys 6 | # from typing import List, Optional 7 | 8 | # if sys.version_info < (3, 9): 9 | # from typing_extensions import Annotated 10 | # else: 11 | # from typing import Annotated 12 | 13 | # from weaviate.collections.classes.config import _PropertyConfig 14 | # from weaviate.collections.classes.orm import BaseProperty, Reference 15 | # from weaviate.types import UUIDS 16 | 17 | 18 | # class Group(BaseProperty): 19 | # name: str 20 | 21 | 22 | # @pytest.mark.parametrize( 23 | # "member_type,expected", 24 | # [ 25 | # (str, "text"), 26 | # (int, "int"), 27 | # (float, "number"), 28 | # (List[str], "text[]"), 29 | # (List[int], "int[]"), 30 | # (List[float], "number[]"), 31 | # ], 32 | # ) 33 | # @pytest.mark.parametrize("optional", [True, False]) 34 | # def test_types(member_type, expected: str, optional: bool): 35 | # if optional: 36 | # member_type = Optional[member_type] 37 | 38 | # class ModelTypes(BaseProperty): 39 | # name: member_type 40 | 41 | # non_optional_types = ModelTypes.type_to_dict(ModelTypes) 42 | # assert non_optional_types[0]["dataType"][0] == expected 43 | 44 | 45 | # @pytest.mark.parametrize( 46 | # "member_type, annotation ,expected", 47 | # [ 48 | # (str, _PropertyConfig(index_filterable=False), "text"), 49 | # (UUIDS, Reference(Group), "Group"), 50 | # (Optional[UUIDS], Reference(Group), "Group"), 51 | # ], 52 | # ) 53 | # def test_types_annotation(member_type, annotation, expected: str): 54 | # member_type = Annotated[member_type, annotation] 55 | 56 | # class ModelTypes(BaseProperty): 57 | # name: member_type 58 | 59 | # non_optional_types = ModelTypes.type_to_dict(ModelTypes) 60 | # assert non_optional_types[0]["dataType"][0] == expected 61 | -------------------------------------------------------------------------------- /test/collection/test_validator.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | import numpy as np 4 | import pandas as pd 5 | import polars as pl 6 | import pytest 7 | 8 | from weaviate.exceptions import WeaviateInvalidInputError 9 | from weaviate.validator import _ExtraTypes, _validate_input, _ValidateArgument 10 | 11 | 12 | @pytest.mark.parametrize( 13 | "inputs,expected,error", 14 | [ 15 | (1, [int], False), 16 | (1.0, [int], True), 17 | ([1, 1], [List], False), 18 | (np.array([1, 2, 3]), [_ExtraTypes.NUMPY], False), 19 | (np.array([1, 2, 3]), [_ExtraTypes.NUMPY, List], False), 20 | (np.array([1, 2, 3]), [List], True), 21 | ([1, 1], [List, _ExtraTypes.NUMPY], False), 22 | (pd.array([1, 1]), [_ExtraTypes.PANDAS, List], False), 23 | (pd.Series([1, 1]), [_ExtraTypes.PANDAS, List], False), 24 | (pl.Series([1, 1]), [_ExtraTypes.POLARS, List], False), 25 | ( 26 | pl.Series([1, 1]), 27 | [_ExtraTypes.POLARS, _ExtraTypes.PANDAS, _ExtraTypes.NUMPY, List], 28 | False, 29 | ), 30 | (pl.Series([1, 1]), [_ExtraTypes.PANDAS, _ExtraTypes.NUMPY, List], True), 31 | ], 32 | ) 33 | def test_validator(inputs: Any, expected: List[Any], error: bool) -> None: 34 | if error: 35 | with pytest.raises(WeaviateInvalidInputError): 36 | _validate_input(_ValidateArgument(expected=expected, name="test", value=inputs)) 37 | else: 38 | _validate_input(_ValidateArgument(expected=expected, name="test", value=inputs)) 39 | -------------------------------------------------------------------------------- /test/collection/test_vectorizer.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.config import Configure 2 | 3 | 4 | def test_multi2vec_clip() -> None: 5 | Configure.Vectorizer.multi2vec_clip(image_fields=["test"]) 6 | -------------------------------------------------------------------------------- /test/collection/weaviate-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/test/collection/weaviate-logo.png -------------------------------------------------------------------------------- /test/test_auth.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import weaviate.classes as wvc 4 | 5 | 6 | @pytest.mark.parametrize("expires_in,warning", [(-1, True), (5, False)]) 7 | def test_bearer_validation( 8 | recwarn: pytest.WarningsRecorder, expires_in: int, warning: bool 9 | ) -> None: 10 | wvc.init.Auth.bearer_token( 11 | access_token="Doesn't matter", 12 | refresh_token="Doesn't matter", 13 | expires_in=expires_in, 14 | ) 15 | 16 | if warning: 17 | assert len(recwarn) == 1 18 | w = recwarn.pop() 19 | assert issubclass(w.category, UserWarning) 20 | assert str(w.message).startswith("Auth003") 21 | else: 22 | assert len(recwarn) == 0 23 | -------------------------------------------------------------------------------- /test/test_client.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import weaviate 4 | 5 | 6 | def test_none_api_key_header() -> None: 7 | with pytest.raises(weaviate.exceptions.WeaviateInvalidInputError) as e: 8 | weaviate.use_async_with_local(headers={"X-OpenAI-Api-Key": None}) 9 | assert "X-OpenAI-Api-Key" in e.value.message 10 | -------------------------------------------------------------------------------- /test/test_get_vector_v4.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import polars as pl 4 | 5 | from weaviate.util import _get_vector_v4 6 | 7 | # Don't need to test `tf` or `torch` tensors since `_get_vector_v4`` converts them to `np` first 8 | 9 | 10 | def test_get_vector_v4_with_np_array_and_np_float() -> None: 11 | # Assert that np.array[np.float32] -> list[float] 12 | vec = _get_vector_v4(np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=np.float32)) 13 | assert isinstance(vec, list) 14 | assert all(isinstance(e, float) for e in vec) 15 | 16 | 17 | def test_get_vector_v4_with_list_and_np_float() -> None: 18 | # Assert that list[np.float32] -> list[np.float32] 19 | vec = _get_vector_v4(list(np.array([0.12345] * 1536, dtype=np.float32))) 20 | assert isinstance(vec, list) 21 | assert all(isinstance(e, np.float32) for e in vec) 22 | 23 | 24 | def test_get_vector_v4_with_list() -> None: 25 | # Assert that list[float] -> list[float] 26 | vec = _get_vector_v4([1.0, 2.0, 3.0, 4.0, 5.0]) 27 | assert isinstance(vec, list) 28 | assert all(isinstance(e, float) for e in vec) 29 | 30 | 31 | def test_get_vector_v4_with_pd() -> None: 32 | # Assert that pd.Series[pd.Float32Dtype] -> list[float] 33 | vec = _get_vector_v4(pd.Series([1.0, 2.0, 3.0, 4.0, 5.0], dtype="Float32")) 34 | assert isinstance(vec, list) 35 | assert all(isinstance(e, float) for e in vec) 36 | 37 | 38 | def test_get_vector_v4_with_pl() -> None: 39 | # Assert that pl.Series[pl.Float32] -> list[float] 40 | vec = _get_vector_v4(pl.Series("a", [1.0, 2.0, 3.0, 4.0, 5.0], pl.Float32)) 41 | assert isinstance(vec, list) 42 | assert all(isinstance(e, float) for e in vec) 43 | -------------------------------------------------------------------------------- /test/test_rbac.py: -------------------------------------------------------------------------------- 1 | from weaviate.classes.rbac import Permissions 2 | 3 | 4 | def test_permissions_roles_only_manage_false() -> None: 5 | permissions = Permissions.roles(read=False, role="*") 6 | assert len(permissions) == 0 7 | 8 | 9 | def test_permissions_roles_only_manage_true() -> None: 10 | permissions = Permissions.roles(read=True, role="*") 11 | assert len(permissions) == 1 12 | assert len(permissions[0].actions) == 1 13 | 14 | 15 | def test_permissions_roles() -> None: 16 | permissions = Permissions.roles(read=True, create=False, role="*") 17 | assert len(permissions) == 1 18 | assert len(permissions[0].actions) == 1 19 | -------------------------------------------------------------------------------- /tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/tools/__init__.py -------------------------------------------------------------------------------- /tools/proto_regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | branchOrTag="${1:-main}" 4 | dir="tools" 5 | out="weaviate/proto" 6 | mkdir -p ${dir} 7 | curl -LkSs https://api.github.com/repos/weaviate/weaviate/tarball/${branchOrTag} -o ${dir}/weaviate.tar.gz 8 | tar --strip-components=3 -C ${dir} -xvf ${dir}/weaviate.tar.gz $(tar -tf ${dir}/weaviate.tar.gz | grep '^weaviate-weaviate-[^/]\+/grpc/proto/v1') 9 | 10 | python3 -m grpc_tools.protoc -I ${dir} --python_out="./${out}" --pyi_out="./${out}" --grpc_python_out="./${out}" ${dir}/v1/*.proto 11 | 12 | rm ${dir}/weaviate.tar.gz 13 | 14 | sed -i '' 's/from v1/from weaviate.proto.v1/g' ${out}/v1/*.py 15 | sed -i '' 's/from v1/from weaviate.proto.v1/g' ${out}/v1/*.pyi 16 | 17 | rm -rf ${dir}/v1 18 | 19 | echo "done" -------------------------------------------------------------------------------- /tools/stubs_regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Regenerating stubs..." 4 | 5 | python3 -m tools.stubs 6 | ruff check ./weaviate --select F401 --select I --fix # only fix unused/sorted imports 7 | ruff format ./weaviate 8 | 9 | echo "done" -------------------------------------------------------------------------------- /weaviate/.gitignore: -------------------------------------------------------------------------------- 1 | _version.py 2 | -------------------------------------------------------------------------------- /weaviate/agents/__init__.py: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents import * # type: ignore # noqa: F403, F401 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/__init__.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/base.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.base import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/classes/__init__.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.classes import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/personalization/__init__.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.personalization import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/query/__init__.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.query import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/transformation/__init__.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.transformation import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/agents/utils.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.exceptions import WeaviateAgentsNotInstalledError 2 | 3 | try: 4 | from weaviate_agents.utils import * # noqa: F403 5 | except ImportError: 6 | raise WeaviateAgentsNotInstalledError 7 | -------------------------------------------------------------------------------- /weaviate/backup/__init__.py: -------------------------------------------------------------------------------- 1 | """Module for backup/restore operations.""" 2 | 3 | from .async_ import _BackupAsync 4 | from .executor import BackupStorage 5 | from .sync import _Backup 6 | 7 | __all__ = ["BackupStorage", "_BackupAsync", "_Backup"] 8 | -------------------------------------------------------------------------------- /weaviate/backup/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.backup.executor import _BackupExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _BackupAsync(_BackupExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/backup/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Optional, Union 2 | 3 | from weaviate.backup.backup import ( 4 | BackupConfigCreate, 5 | BackupConfigRestore, 6 | BackupReturn, 7 | BackupStatusReturn, 8 | BackupStorage, 9 | ) 10 | from weaviate.backup.backup_location import BackupLocationType 11 | from weaviate.connect.v4 import ConnectionAsync 12 | 13 | from .executor import _BackupExecutor 14 | 15 | class _BackupAsync(_BackupExecutor[ConnectionAsync]): 16 | async def create( 17 | self, 18 | backup_id: str, 19 | backend: BackupStorage, 20 | include_collections: Union[List[str], str, None] = None, 21 | exclude_collections: Union[List[str], str, None] = None, 22 | wait_for_completion: bool = False, 23 | config: Optional[BackupConfigCreate] = None, 24 | backup_location: Optional[BackupLocationType] = None, 25 | ) -> BackupReturn: ... 26 | async def get_create_status( 27 | self, 28 | backup_id: str, 29 | backend: BackupStorage, 30 | backup_location: Optional[BackupLocationType] = None, 31 | ) -> BackupStatusReturn: ... 32 | async def restore( 33 | self, 34 | backup_id: str, 35 | backend: BackupStorage, 36 | include_collections: Union[List[str], str, None] = None, 37 | exclude_collections: Union[List[str], str, None] = None, 38 | wait_for_completion: bool = False, 39 | config: Optional[BackupConfigRestore] = None, 40 | backup_location: Optional[BackupLocationType] = None, 41 | ) -> BackupReturn: ... 42 | async def get_restore_status( 43 | self, 44 | backup_id: str, 45 | backend: BackupStorage, 46 | backup_location: Optional[BackupLocationType] = None, 47 | ) -> BackupStatusReturn: ... 48 | async def cancel( 49 | self, 50 | backup_id: str, 51 | backend: BackupStorage, 52 | backup_location: Optional[BackupLocationType] = None, 53 | ) -> bool: ... 54 | -------------------------------------------------------------------------------- /weaviate/backup/backup_location.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Union, cast 2 | 3 | from pydantic import BaseModel 4 | 5 | 6 | class _BackupLocationConfig(BaseModel): 7 | """The dynamic location of a backup.""" 8 | 9 | def _to_dict(self) -> Dict[str, Any]: 10 | ret = cast(dict, self.model_dump(exclude_none=True)) 11 | 12 | return ret 13 | 14 | 15 | class _BackupLocationFilesystem(_BackupLocationConfig): 16 | """The dynamic location of a backup for filesystem.""" 17 | 18 | path: str 19 | 20 | 21 | class _BackupLocationS3(_BackupLocationConfig): 22 | """The dynamic location of a backup for S3.""" 23 | 24 | path: str 25 | bucket: str 26 | 27 | 28 | class _BackupLocationGCP(_BackupLocationConfig): 29 | """The dynamic location of a backup for GCP.""" 30 | 31 | path: str 32 | bucket: str 33 | 34 | 35 | class _BackupLocationAzure(_BackupLocationConfig): 36 | """The dynamic location of a backup for Azure.""" 37 | 38 | path: str 39 | bucket: str 40 | 41 | 42 | BackupLocationType = Union[ 43 | _BackupLocationFilesystem, 44 | _BackupLocationS3, 45 | _BackupLocationGCP, 46 | _BackupLocationAzure, 47 | ] 48 | 49 | 50 | class BackupLocation: 51 | """The dynamic path of a backup.""" 52 | 53 | FileSystem = _BackupLocationFilesystem 54 | S3 = _BackupLocationS3 55 | GCP = _BackupLocationGCP 56 | Azure = _BackupLocationAzure 57 | -------------------------------------------------------------------------------- /weaviate/backup/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.backup.executor import _BackupExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Backup(_BackupExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/backup/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Optional, Union 2 | 3 | from weaviate.backup.backup import ( 4 | BackupConfigCreate, 5 | BackupConfigRestore, 6 | BackupReturn, 7 | BackupStatusReturn, 8 | BackupStorage, 9 | ) 10 | from weaviate.backup.backup_location import BackupLocationType 11 | from weaviate.connect.v4 import ConnectionSync 12 | 13 | from .executor import _BackupExecutor 14 | 15 | class _Backup(_BackupExecutor[ConnectionSync]): 16 | def create( 17 | self, 18 | backup_id: str, 19 | backend: BackupStorage, 20 | include_collections: Union[List[str], str, None] = None, 21 | exclude_collections: Union[List[str], str, None] = None, 22 | wait_for_completion: bool = False, 23 | config: Optional[BackupConfigCreate] = None, 24 | backup_location: Optional[BackupLocationType] = None, 25 | ) -> BackupReturn: ... 26 | def get_create_status( 27 | self, 28 | backup_id: str, 29 | backend: BackupStorage, 30 | backup_location: Optional[BackupLocationType] = None, 31 | ) -> BackupStatusReturn: ... 32 | def restore( 33 | self, 34 | backup_id: str, 35 | backend: BackupStorage, 36 | include_collections: Union[List[str], str, None] = None, 37 | exclude_collections: Union[List[str], str, None] = None, 38 | wait_for_completion: bool = False, 39 | config: Optional[BackupConfigRestore] = None, 40 | backup_location: Optional[BackupLocationType] = None, 41 | ) -> BackupReturn: ... 42 | def get_restore_status( 43 | self, 44 | backup_id: str, 45 | backend: BackupStorage, 46 | backup_location: Optional[BackupLocationType] = None, 47 | ) -> BackupStatusReturn: ... 48 | def cancel( 49 | self, 50 | backup_id: str, 51 | backend: BackupStorage, 52 | backup_location: Optional[BackupLocationType] = None, 53 | ) -> bool: ... 54 | -------------------------------------------------------------------------------- /weaviate/classes/__init__.py: -------------------------------------------------------------------------------- 1 | # make sure to import all classes that should be available in the weaviate module 2 | from . import ( 3 | aggregate, 4 | backup, 5 | batch, 6 | config, 7 | data, 8 | generate, 9 | generics, 10 | init, 11 | query, 12 | rbac, 13 | tenants, 14 | ) # noqa: F401 15 | from .config import ConsistencyLevel 16 | 17 | __all__ = [ 18 | "aggregate", 19 | "backup", 20 | "batch", 21 | "config", 22 | "ConsistencyLevel", 23 | "data", 24 | "generate", 25 | "generics", 26 | "init", 27 | "query", 28 | "tenants", 29 | "rbac", 30 | ] 31 | -------------------------------------------------------------------------------- /weaviate/classes/aggregate.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.aggregate import GroupByAggregate, Metrics 2 | 3 | __all__ = ["GroupByAggregate", "Metrics"] 4 | -------------------------------------------------------------------------------- /weaviate/classes/backup.py: -------------------------------------------------------------------------------- 1 | from weaviate.backup.backup import ( 2 | BackupCompressionLevel, 3 | BackupConfigCreate, 4 | BackupConfigRestore, 5 | BackupStorage, 6 | ) 7 | from weaviate.backup.backup_location import BackupLocation, BackupLocationType 8 | 9 | __all__ = [ 10 | "BackupCompressionLevel", 11 | "BackupConfigCreate", 12 | "BackupConfigRestore", 13 | "BackupStorage", 14 | "BackupLocation", 15 | "BackupLocationType", 16 | ] 17 | -------------------------------------------------------------------------------- /weaviate/classes/batch.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.batch import Shard 2 | 3 | __all__ = [ 4 | "Shard", 5 | ] 6 | -------------------------------------------------------------------------------- /weaviate/classes/config.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.config import ( 2 | Configure, 3 | ConsistencyLevel, 4 | DataType, 5 | GenerativeSearches, 6 | MultiVectorAggregation, 7 | PQEncoderDistribution, 8 | PQEncoderType, 9 | Property, 10 | Reconfigure, 11 | ReferenceProperty, 12 | ReplicationDeletionStrategy, 13 | Rerankers, 14 | StopwordsPreset, 15 | Tokenization, 16 | VectorDistances, 17 | ) 18 | from weaviate.collections.classes.config_vector_index import VectorFilterStrategy 19 | from weaviate.collections.classes.config_vectorizers import Multi2VecField, Vectorizers 20 | from weaviate.connect.integrations import Integrations 21 | 22 | __all__ = [ 23 | "Configure", 24 | "ConsistencyLevel", 25 | "Reconfigure", 26 | "DataType", 27 | "GenerativeSearches", 28 | "Integrations", 29 | "Multi2VecField", 30 | "MultiVectorAggregation", 31 | "ReplicationDeletionStrategy", 32 | "Property", 33 | "PQEncoderDistribution", 34 | "PQEncoderType", 35 | "ReferenceProperty", 36 | "Rerankers", 37 | "StopwordsPreset", 38 | "Tokenization", 39 | "Vectorizers", 40 | "VectorDistances", 41 | "VectorFilterStrategy", 42 | ] 43 | -------------------------------------------------------------------------------- /weaviate/classes/data.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.data import DataObject, DataReference 2 | from weaviate.collections.classes.types import GeoCoordinate, PhoneNumber 3 | 4 | __all__ = [ 5 | "DataObject", 6 | "DataReference", 7 | "GeoCoordinate", 8 | "PhoneNumber", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/classes/debug.py: -------------------------------------------------------------------------------- 1 | from weaviate.debug.types import DebugRESTObject 2 | 3 | __all__ = [ 4 | "DebugRESTObject", 5 | ] 6 | -------------------------------------------------------------------------------- /weaviate/classes/generate.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.generative import ( 2 | GenerativeConfig, 3 | GenerativeParameters, 4 | ) 5 | 6 | __all__ = [ 7 | "GenerativeParameters", 8 | "GenerativeConfig", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/classes/generics.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.internal import ( 2 | CrossReference, 3 | CrossReferenceAnnotation, 4 | Nested, 5 | ) 6 | 7 | __all__ = ["CrossReference", "Nested", "CrossReferenceAnnotation"] 8 | -------------------------------------------------------------------------------- /weaviate/classes/init.py: -------------------------------------------------------------------------------- 1 | from weaviate.auth import Auth 2 | from weaviate.config import AdditionalConfig, Proxies, Timeout 3 | 4 | __all__ = ["Auth", "AdditionalConfig", "Proxies", "Timeout"] 5 | -------------------------------------------------------------------------------- /weaviate/classes/query.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.aggregate import Metrics 2 | from weaviate.collections.classes.filters import Filter 3 | from weaviate.collections.classes.generative import GenerativeConfig 4 | from weaviate.collections.classes.grpc import ( 5 | BM25OperatorFactory as BM25Operator, 6 | ) 7 | from weaviate.collections.classes.grpc import ( 8 | GroupBy, 9 | HybridFusion, 10 | HybridVector, 11 | MetadataQuery, 12 | Move, 13 | NearMediaType, 14 | NearVector, 15 | QueryNested, 16 | QueryReference, 17 | Rerank, 18 | Sort, 19 | TargetVectors, 20 | ) 21 | from weaviate.collections.classes.types import GeoCoordinate 22 | 23 | __all__ = [ 24 | "Filter", 25 | "GeoCoordinate", 26 | "GenerativeConfig", 27 | "GroupBy", 28 | "HybridFusion", 29 | "HybridVector", 30 | "BM25Operator", 31 | "MetadataQuery", 32 | "Metrics", 33 | "Move", 34 | "NearMediaType", 35 | "QueryNested", 36 | "QueryReference", 37 | "NearVector", 38 | "Rerank", 39 | "Sort", 40 | "TargetVectors", 41 | ] 42 | -------------------------------------------------------------------------------- /weaviate/classes/rbac.py: -------------------------------------------------------------------------------- 1 | from weaviate.rbac.models import Actions, Permissions, PermissionsInputType, RoleScope 2 | 3 | __all__ = ["Actions", "Permissions", "PermissionsInputType", "RoleScope"] 4 | -------------------------------------------------------------------------------- /weaviate/classes/tenants.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.tenants import ( 2 | Tenant, 3 | TenantActivityStatus, 4 | TenantCreate, 5 | TenantCreateActivityStatus, 6 | TenantUpdate, 7 | TenantUpdateActivityStatus, 8 | ) 9 | from weaviate.collections.tenants import TenantCreateInputType, TenantUpdateInputType 10 | 11 | __all__ = [ 12 | "Tenant", 13 | "TenantCreate", 14 | "TenantUpdate", 15 | "TenantActivityStatus", 16 | "TenantCreateActivityStatus", 17 | "TenantUpdateActivityStatus", 18 | "TenantCreateInputType", 19 | "TenantUpdateInputType", 20 | ] 21 | -------------------------------------------------------------------------------- /weaviate/cluster/__init__.py: -------------------------------------------------------------------------------- 1 | """Module for interacting with Weaviate cluster information.""" 2 | -------------------------------------------------------------------------------- /weaviate/cluster/types.py: -------------------------------------------------------------------------------- 1 | from typing import List, Literal, Optional, TypedDict 2 | 3 | 4 | class BatchStats(TypedDict): 5 | queueLength: int 6 | ratePerSecond: int 7 | 8 | 9 | # must use functional syntax because class is a keyword 10 | Shard = TypedDict( 11 | "Shard", 12 | { 13 | "name": str, 14 | "class": str, 15 | "objectCount": int, 16 | "vectorIndexingStatus": Literal["READONLY", "INDEXING", "READY"], 17 | "vectorQueueLength": int, 18 | "compressed": bool, 19 | "loaded": Optional[bool], 20 | }, 21 | ) 22 | 23 | 24 | class Stats(TypedDict): 25 | objectCount: int 26 | shardCount: int 27 | 28 | 29 | class Node(TypedDict): 30 | batchStats: BatchStats 31 | gitHash: str 32 | name: str 33 | shards: Optional[List[Shard]] 34 | stats: Stats 35 | status: str 36 | version: str 37 | 38 | 39 | Verbosity = Literal["minimal", "verbose"] 40 | -------------------------------------------------------------------------------- /weaviate/collections/__init__.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.batch.collection import ( 2 | BatchCollection, 3 | CollectionBatchingContextManager, 4 | ) 5 | from weaviate.collections.collection import Collection, CollectionAsync 6 | 7 | __all__ = [ 8 | "BatchCollection", 9 | "Collection", 10 | "CollectionAsync", 11 | "CollectionBatchingContextManager", 12 | ] 13 | -------------------------------------------------------------------------------- /weaviate/collections/aggregate.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.hybrid import _Hybrid, _HybridAsync 2 | from weaviate.collections.aggregations.near_image import _NearImage, _NearImageAsync 3 | from weaviate.collections.aggregations.near_object import _NearObject, _NearObjectAsync 4 | from weaviate.collections.aggregations.near_text import _NearText, _NearTextAsync 5 | from weaviate.collections.aggregations.near_vector import _NearVector, _NearVectorAsync 6 | from weaviate.collections.aggregations.over_all import _OverAll, _OverAllAsync 7 | 8 | 9 | class _AggregateCollectionAsync( 10 | _HybridAsync, 11 | _NearImageAsync, 12 | _NearObjectAsync, 13 | _NearTextAsync, 14 | _NearVectorAsync, 15 | _OverAllAsync, 16 | ): 17 | pass 18 | 19 | 20 | class _AggregateCollection(_Hybrid, _NearImage, _NearObject, _NearText, _NearVector, _OverAll): 21 | pass 22 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/weaviate/collections/aggregations/__init__.py -------------------------------------------------------------------------------- /weaviate/collections/aggregations/hybrid/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _HybridAsync 2 | from .sync import _Hybrid 3 | 4 | __all__ = ["_Hybrid", "_HybridAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/hybrid/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.hybrid.executor import _HybridExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _HybridAsync(_HybridExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/hybrid/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.hybrid.executor import _HybridExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Hybrid(_HybridExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_image/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearImageAsync 2 | from .sync import _NearImage 3 | 4 | __all__ = ["_NearImage", "_NearImageAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_image/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_image.executor import _NearImageExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _NearImageAsync(_NearImageExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_image/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_image.executor import _NearImageExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _NearImage(_NearImageExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_object/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearObjectAsync 2 | from .sync import _NearObject 3 | 4 | __all__ = ["_NearObject", "_NearObjectAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_object/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_object.executor import _NearObjectExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _NearObjectAsync(_NearObjectExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_object/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_object.executor import _NearObjectExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _NearObject(_NearObjectExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_text/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearTextAsync 2 | from .sync import _NearText 3 | 4 | __all__ = ["_NearText", "_NearTextAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_text/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_text.executor import _NearTextExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _NearTextAsync(_NearTextExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_text/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_text.executor import _NearTextExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _NearText(_NearTextExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_vector/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearVectorAsync 2 | from .sync import _NearVector 3 | 4 | __all__ = ["_NearVector", "_NearVectorAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_vector/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_vector.executor import _NearVectorExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _NearVectorAsync(_NearVectorExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/near_vector/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.near_vector.executor import _NearVectorExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _NearVector(_NearVectorExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/over_all/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _OverAllAsync 2 | from .sync import _OverAll 3 | 4 | __all__ = ["_OverAll", "_OverAllAsync"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/over_all/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.over_all.executor import _OverAllExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _OverAllAsync(_OverAllExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/over_all/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, Optional, Union, overload 2 | 3 | from weaviate.collections.classes.aggregate import ( 4 | AggregateGroupByReturn, 5 | AggregateReturn, 6 | GroupByAggregate, 7 | PropertiesMetrics, 8 | ) 9 | from weaviate.collections.classes.filters import _Filters 10 | from weaviate.connect.v4 import ConnectionAsync 11 | 12 | from .executor import _OverAllExecutor 13 | 14 | class _OverAllAsync(_OverAllExecutor[ConnectionAsync]): 15 | @overload 16 | async def over_all( 17 | self, 18 | *, 19 | filters: Optional[_Filters] = None, 20 | group_by: Literal[None] = None, 21 | total_count: bool = True, 22 | return_metrics: Optional[PropertiesMetrics] = None, 23 | ) -> AggregateReturn: ... 24 | @overload 25 | async def over_all( 26 | self, 27 | *, 28 | filters: Optional[_Filters] = None, 29 | group_by: Union[str, GroupByAggregate], 30 | total_count: bool = True, 31 | return_metrics: Optional[PropertiesMetrics] = None, 32 | ) -> AggregateGroupByReturn: ... 33 | @overload 34 | async def over_all( 35 | self, 36 | *, 37 | filters: Optional[_Filters] = None, 38 | group_by: Optional[Union[str, GroupByAggregate]] = None, 39 | total_count: bool = True, 40 | return_metrics: Optional[PropertiesMetrics] = None, 41 | ) -> Union[AggregateReturn, AggregateGroupByReturn]: ... 42 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/over_all/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.aggregations.over_all.executor import _OverAllExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _OverAll(_OverAllExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/aggregations/over_all/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, Optional, Union, overload 2 | 3 | from weaviate.collections.classes.aggregate import ( 4 | AggregateGroupByReturn, 5 | AggregateReturn, 6 | GroupByAggregate, 7 | PropertiesMetrics, 8 | ) 9 | from weaviate.collections.classes.filters import _Filters 10 | from weaviate.connect.v4 import ConnectionSync 11 | 12 | from .executor import _OverAllExecutor 13 | 14 | class _OverAll(_OverAllExecutor[ConnectionSync]): 15 | @overload 16 | def over_all( 17 | self, 18 | *, 19 | filters: Optional[_Filters] = None, 20 | group_by: Literal[None] = None, 21 | total_count: bool = True, 22 | return_metrics: Optional[PropertiesMetrics] = None, 23 | ) -> AggregateReturn: ... 24 | @overload 25 | def over_all( 26 | self, 27 | *, 28 | filters: Optional[_Filters] = None, 29 | group_by: Union[str, GroupByAggregate], 30 | total_count: bool = True, 31 | return_metrics: Optional[PropertiesMetrics] = None, 32 | ) -> AggregateGroupByReturn: ... 33 | @overload 34 | def over_all( 35 | self, 36 | *, 37 | filters: Optional[_Filters] = None, 38 | group_by: Optional[Union[str, GroupByAggregate]] = None, 39 | total_count: bool = True, 40 | return_metrics: Optional[PropertiesMetrics] = None, 41 | ) -> Union[AggregateReturn, AggregateGroupByReturn]: ... 42 | -------------------------------------------------------------------------------- /weaviate/collections/backups/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _CollectionBackupAsync 2 | from .sync import _CollectionBackup 3 | 4 | __all__ = [ 5 | "_CollectionBackup", 6 | "_CollectionBackupAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/backups/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.backups.executor import _CollectionBackupExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _CollectionBackupAsync(_CollectionBackupExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/backups/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from weaviate.backup.backup_location import BackupLocationType 4 | from weaviate.backup.executor import ( 5 | BackupConfigCreate, 6 | BackupConfigRestore, 7 | BackupStatusReturn, 8 | BackupStorage, 9 | ) 10 | from weaviate.connect.v4 import ConnectionAsync 11 | 12 | from .executor import _CollectionBackupExecutor 13 | 14 | class _CollectionBackupAsync(_CollectionBackupExecutor[ConnectionAsync]): 15 | async def create( 16 | self, 17 | backup_id: str, 18 | backend: BackupStorage, 19 | wait_for_completion: bool = False, 20 | config: Optional[BackupConfigCreate] = None, 21 | backup_location: Optional[BackupLocationType] = None, 22 | ) -> BackupStatusReturn: ... 23 | async def restore( 24 | self, 25 | backup_id: str, 26 | backend: BackupStorage, 27 | wait_for_completion: bool = False, 28 | config: Optional[BackupConfigRestore] = None, 29 | backup_location: Optional[BackupLocationType] = None, 30 | ) -> BackupStatusReturn: ... 31 | async def get_create_status( 32 | self, 33 | backup_id: str, 34 | backend: BackupStorage, 35 | backup_location: Optional[BackupLocationType] = None, 36 | ) -> BackupStatusReturn: ... 37 | async def get_restore_status( 38 | self, 39 | backup_id: str, 40 | backend: BackupStorage, 41 | backup_location: Optional[BackupLocationType] = None, 42 | ) -> BackupStatusReturn: ... 43 | -------------------------------------------------------------------------------- /weaviate/collections/backups/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.backups.executor import _CollectionBackupExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _CollectionBackup(_CollectionBackupExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/backups/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from weaviate.backup.backup_location import BackupLocationType 4 | from weaviate.backup.executor import ( 5 | BackupConfigCreate, 6 | BackupConfigRestore, 7 | BackupStatusReturn, 8 | BackupStorage, 9 | ) 10 | from weaviate.connect.v4 import ConnectionSync 11 | 12 | from .executor import _CollectionBackupExecutor 13 | 14 | class _CollectionBackup(_CollectionBackupExecutor[ConnectionSync]): 15 | def create( 16 | self, 17 | backup_id: str, 18 | backend: BackupStorage, 19 | wait_for_completion: bool = False, 20 | config: Optional[BackupConfigCreate] = None, 21 | backup_location: Optional[BackupLocationType] = None, 22 | ) -> BackupStatusReturn: ... 23 | def restore( 24 | self, 25 | backup_id: str, 26 | backend: BackupStorage, 27 | wait_for_completion: bool = False, 28 | config: Optional[BackupConfigRestore] = None, 29 | backup_location: Optional[BackupLocationType] = None, 30 | ) -> BackupStatusReturn: ... 31 | def get_create_status( 32 | self, 33 | backup_id: str, 34 | backend: BackupStorage, 35 | backup_location: Optional[BackupLocationType] = None, 36 | ) -> BackupStatusReturn: ... 37 | def get_restore_status( 38 | self, 39 | backup_id: str, 40 | backend: BackupStorage, 41 | backup_location: Optional[BackupLocationType] = None, 42 | ) -> BackupStatusReturn: ... 43 | -------------------------------------------------------------------------------- /weaviate/collections/batch/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["_BatchClient", "_BatchCollection", "_BatchGRPC", "_BatchREST"] 2 | 3 | from .client import _BatchClient 4 | from .collection import _BatchCollection 5 | from .grpc_batch_objects import _BatchGRPC 6 | from .rest import _BatchREST 7 | -------------------------------------------------------------------------------- /weaviate/collections/classes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/weaviate/collections/classes/__init__.py -------------------------------------------------------------------------------- /weaviate/collections/cluster/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _ClusterAsync 2 | from .sync import _Cluster 3 | 4 | __all__ = [ 5 | "_ClusterAsync", 6 | "_Cluster", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/cluster/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.cluster.executor import _ClusterExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _ClusterAsync(_ClusterExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/cluster/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Literal, Optional, Union, overload 2 | 3 | from weaviate.cluster.types import Verbosity 4 | from weaviate.collections.classes.cluster import Node, Shards, Stats 5 | from weaviate.connect.v4 import ConnectionAsync 6 | 7 | from .executor import _ClusterExecutor 8 | 9 | class _ClusterAsync(_ClusterExecutor[ConnectionAsync]): 10 | @overload 11 | async def nodes( 12 | self, collection: Optional[str] = None, *, output: Literal[None] = None 13 | ) -> List[Node[None, None]]: ... 14 | @overload 15 | async def nodes( 16 | self, collection: Optional[str] = None, *, output: Literal["minimal"] 17 | ) -> List[Node[None, None]]: ... 18 | @overload 19 | async def nodes( 20 | self, collection: Optional[str] = None, *, output: Literal["verbose"] 21 | ) -> List[Node[Shards, Stats]]: ... 22 | @overload 23 | async def nodes( 24 | self, collection: Optional[str] = None, *, output: Optional[Verbosity] = None 25 | ) -> Union[List[Node[None, None]], List[Node[Shards, Stats]]]: ... 26 | -------------------------------------------------------------------------------- /weaviate/collections/cluster/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.cluster.executor import _ClusterExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Cluster(_ClusterExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/cluster/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Literal, Optional, Union, overload 2 | 3 | from weaviate.cluster.types import Verbosity 4 | from weaviate.collections.classes.cluster import Node, Shards, Stats 5 | from weaviate.connect.v4 import ConnectionSync 6 | 7 | from .executor import _ClusterExecutor 8 | 9 | class _Cluster(_ClusterExecutor[ConnectionSync]): 10 | @overload 11 | def nodes( 12 | self, collection: Optional[str] = None, *, output: Literal[None] = None 13 | ) -> List[Node[None, None]]: ... 14 | @overload 15 | def nodes( 16 | self, collection: Optional[str] = None, *, output: Literal["minimal"] 17 | ) -> List[Node[None, None]]: ... 18 | @overload 19 | def nodes( 20 | self, collection: Optional[str] = None, *, output: Literal["verbose"] 21 | ) -> List[Node[Shards, Stats]]: ... 22 | @overload 23 | def nodes( 24 | self, collection: Optional[str] = None, *, output: Optional[Verbosity] = None 25 | ) -> Union[List[Node[None, None]], List[Node[Shards, Stats]]]: ... 26 | -------------------------------------------------------------------------------- /weaviate/collections/collection/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import CollectionAsync 2 | from .sync import Collection 3 | 4 | __all__ = ["CollectionAsync", "Collection"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/collection/base.py: -------------------------------------------------------------------------------- 1 | from typing import Generic, Optional 2 | 3 | from weaviate.collections.classes.config import ConsistencyLevel 4 | from weaviate.connect.v4 import ConnectionType 5 | from weaviate.util import _capitalize_first_letter 6 | 7 | 8 | class _CollectionBase(Generic[ConnectionType]): 9 | def __init__( 10 | self, 11 | connection: ConnectionType, 12 | name: str, 13 | validate_arguments: bool, 14 | consistency_level: Optional[ConsistencyLevel] = None, 15 | tenant: Optional[str] = None, 16 | ) -> None: 17 | self._connection = connection 18 | self.name = _capitalize_first_letter(name) 19 | self._validate_arguments = validate_arguments 20 | 21 | self.__tenant = tenant 22 | self.__consistency_level = consistency_level 23 | 24 | @property 25 | def tenant(self) -> Optional[str]: 26 | """The tenant of this collection object.""" 27 | return self.__tenant 28 | 29 | @property 30 | def consistency_level(self) -> Optional[ConsistencyLevel]: 31 | """The consistency level of this collection object.""" 32 | return self.__consistency_level 33 | -------------------------------------------------------------------------------- /weaviate/collections/collections/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _CollectionsAsync 2 | from .sync import _Collections 3 | 4 | __all__ = [ 5 | "_CollectionsAsync", 6 | "_Collections", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/collections/async_.py: -------------------------------------------------------------------------------- 1 | from typing import ( 2 | Optional, 3 | Type, 4 | ) 5 | 6 | from weaviate.collections.classes.config import ( 7 | CollectionConfig, 8 | ) 9 | from weaviate.collections.classes.internal import References 10 | from weaviate.collections.classes.types import ( 11 | Properties, 12 | ) 13 | from weaviate.collections.collection import CollectionAsync 14 | from weaviate.collections.collections.base import _CollectionsBase 15 | from weaviate.connect import executor 16 | from weaviate.connect.v4 import ConnectionAsync 17 | 18 | 19 | @executor.wrap("async") 20 | class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): 21 | @executor.no_wrapping 22 | def use( 23 | self, 24 | name: str, 25 | data_model_properties: Optional[Type[Properties]] = None, 26 | data_model_references: Optional[Type[References]] = None, 27 | skip_argument_validation: bool = False, 28 | ) -> CollectionAsync[Properties, References]: 29 | collection = self._use( 30 | name=name, 31 | data_model_properties=data_model_properties, 32 | data_model_references=data_model_references, 33 | skip_argument_validation=skip_argument_validation, 34 | ) 35 | assert isinstance(collection, CollectionAsync) 36 | return collection 37 | 38 | @executor.no_wrapping 39 | async def create_from_dict(self, config: dict) -> CollectionAsync: 40 | collection = await executor.aresult(self._create_from_dict(config)) 41 | assert isinstance(collection, CollectionAsync) 42 | return collection 43 | 44 | @executor.no_wrapping 45 | async def create_from_config(self, config: CollectionConfig) -> CollectionAsync: 46 | collection = await executor.aresult(self._create_from_config(config)) 47 | assert isinstance(collection, CollectionAsync) 48 | return collection 49 | -------------------------------------------------------------------------------- /weaviate/collections/collections/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Optional, Type 2 | 3 | from weaviate.collections.classes.config import CollectionConfig 4 | from weaviate.collections.classes.internal import Properties, References 5 | from weaviate.collections.collection.sync import Collection 6 | from weaviate.collections.collections.base import _CollectionsBase 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _Collections(_CollectionsBase[ConnectionSync]): 13 | @executor.no_wrapping 14 | def use( 15 | self, 16 | name: str, 17 | data_model_properties: Optional[Type[Properties]] = None, 18 | data_model_references: Optional[Type[References]] = None, 19 | skip_argument_validation: bool = False, 20 | ) -> Collection[Properties, References]: 21 | collection = self._use( 22 | name=name, 23 | data_model_properties=data_model_properties, 24 | data_model_references=data_model_references, 25 | skip_argument_validation=skip_argument_validation, 26 | ) 27 | assert isinstance(collection, Collection) 28 | return collection 29 | 30 | @executor.no_wrapping 31 | def create_from_dict(self, config: dict) -> Collection: 32 | collection = executor.result(self._create_from_dict(config)) 33 | assert isinstance(collection, Collection) 34 | return collection 35 | 36 | @executor.no_wrapping 37 | def create_from_config(self, config: CollectionConfig) -> Collection: 38 | collection = executor.result(self._create_from_config(config)) 39 | assert isinstance(collection, Collection) 40 | return collection 41 | -------------------------------------------------------------------------------- /weaviate/collections/config/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _ConfigCollectionAsync 2 | from .sync import _ConfigCollection 3 | 4 | __all__ = [ 5 | "_ConfigCollection", 6 | "_ConfigCollectionAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/config/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.config.executor import _ConfigCollectionExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _ConfigCollectionAsync(_ConfigCollectionExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/config/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.config.executor import _ConfigCollectionExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _ConfigCollection(_ConfigCollectionExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/data/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _DataCollectionAsync 2 | from .sync import _DataCollection 3 | 4 | __all__ = ["_DataCollectionAsync", "_DataCollection"] 5 | -------------------------------------------------------------------------------- /weaviate/collections/data/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic, Type 2 | 3 | from weaviate.collections.classes.internal import Properties, TProperties 4 | from weaviate.collections.classes.types import _check_properties_generic 5 | from weaviate.collections.data.executor import _DataCollectionExecutor 6 | from weaviate.connect import executor 7 | from weaviate.connect.v4 import ConnectionAsync 8 | 9 | 10 | @executor.wrap("async") 11 | class _DataCollectionAsync(Generic[Properties], _DataCollectionExecutor[ConnectionAsync]): 12 | def with_data_model(self, data_model: Type[TProperties]) -> "_DataCollectionAsync[TProperties]": 13 | _check_properties_generic(data_model) 14 | return _DataCollectionAsync[TProperties]( 15 | self._connection, 16 | self.name, 17 | self._consistency_level, 18 | self._tenant, 19 | self._validate_arguments, 20 | data_model, 21 | ) 22 | -------------------------------------------------------------------------------- /weaviate/collections/data/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic, Type 2 | 3 | from weaviate.collections.classes.internal import Properties, TProperties 4 | from weaviate.collections.classes.types import _check_properties_generic 5 | from weaviate.collections.data.executor import _DataCollectionExecutor 6 | from weaviate.connect import executor 7 | from weaviate.connect.v4 import ConnectionSync 8 | 9 | 10 | @executor.wrap("sync") 11 | class _DataCollection(Generic[Properties], _DataCollectionExecutor[ConnectionSync]): 12 | def with_data_model(self, data_model: Type[TProperties]) -> "_DataCollection[TProperties]": 13 | _check_properties_generic(data_model) 14 | return _DataCollection[TProperties]( 15 | self._connection, 16 | self.name, 17 | self._consistency_level, 18 | self._tenant, 19 | self._validate_arguments, 20 | data_model, 21 | ) 22 | -------------------------------------------------------------------------------- /weaviate/collections/grpc/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["_BaseGRPC", "_QueryGRPC"] 2 | 3 | from .query import _QueryGRPC 4 | from .shared import _BaseGRPC 5 | -------------------------------------------------------------------------------- /weaviate/collections/queries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/weaviate/collections/queries/__init__.py -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _BM25Generate, _BM25GenerateAsync 2 | from .query import _BM25Query, _BM25QueryAsync 3 | 4 | __all__ = [ 5 | "_BM25GenerateAsync", 6 | "_BM25QueryAsync", 7 | "_BM25Generate", 8 | "_BM25Query", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _BM25GenerateAsync 2 | from .sync import _BM25Generate 3 | 4 | __all__ = [ 5 | "_BM25GenerateAsync", 6 | "_BM25Generate", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.bm25.generate.executor import _BM25GenerateExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionAsync 7 | 8 | 9 | @executor.wrap("async") 10 | class _BM25GenerateAsync( 11 | Generic[Properties, References], 12 | _BM25GenerateExecutor[ConnectionAsync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.bm25.generate.executor import _BM25GenerateExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionSync 7 | 8 | 9 | @executor.wrap("sync") 10 | class _BM25Generate( 11 | Generic[Properties, References], 12 | _BM25GenerateExecutor[ConnectionSync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _BM25QueryAsync 2 | from .sync import _BM25Query 3 | 4 | __all__ = [ 5 | "_BM25Query", 6 | "_BM25QueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.bm25.query.executor import _BM25QueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionAsync 7 | 8 | 9 | @executor.wrap("async") 10 | class _BM25QueryAsync( 11 | Generic[Properties, References], 12 | _BM25QueryExecutor[ConnectionAsync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/bm25/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.bm25.query.executor import _BM25QueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionSync 7 | 8 | 9 | @executor.wrap("sync") 10 | class _BM25Query( 11 | Generic[Properties, References], 12 | _BM25QueryExecutor[ConnectionSync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_object_by_id/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _FetchObjectByIDQueryAsync 2 | from .sync import _FetchObjectByIDQuery 3 | 4 | __all__ = [ 5 | "_FetchObjectByIDQuery", 6 | "_FetchObjectByIDQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_object_by_id/async_.py: -------------------------------------------------------------------------------- 1 | from typing import ( 2 | Generic, 3 | ) 4 | 5 | from weaviate.collections.classes.types import Properties, References 6 | from weaviate.collections.queries.fetch_object_by_id.executor import ( 7 | _FetchObjectByIDQueryExecutor, 8 | ) 9 | from weaviate.connect import executor 10 | from weaviate.connect.v4 import ConnectionAsync 11 | 12 | 13 | @executor.wrap("async") 14 | class _FetchObjectByIDQueryAsync( 15 | Generic[Properties, References], 16 | _FetchObjectByIDQueryExecutor[ConnectionAsync, Properties, References], 17 | ): 18 | pass 19 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_object_by_id/sync.py: -------------------------------------------------------------------------------- 1 | from typing import ( 2 | Generic, 3 | ) 4 | 5 | from weaviate.collections.classes.types import Properties, References 6 | from weaviate.collections.queries.fetch_object_by_id.executor import ( 7 | _FetchObjectByIDQueryExecutor, 8 | ) 9 | from weaviate.connect import executor 10 | from weaviate.connect.v4 import ConnectionSync 11 | 12 | 13 | @executor.wrap("sync") 14 | class _FetchObjectByIDQuery( 15 | Generic[Properties, References], 16 | _FetchObjectByIDQueryExecutor[ConnectionSync, Properties, References], 17 | ): 18 | pass 19 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _FetchObjectsGenerate, _FetchObjectsGenerateAsync 2 | from .query import _FetchObjectsQuery, _FetchObjectsQueryAsync 3 | 4 | __all__ = [ 5 | "_FetchObjectsGenerate", 6 | "_FetchObjectsGenerateAsync", 7 | "_FetchObjectsQuery", 8 | "_FetchObjectsQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _FetchObjectsGenerateAsync 2 | from .sync import _FetchObjectsGenerate 3 | 4 | __all__ = [ 5 | "_FetchObjectsGenerate", 6 | "_FetchObjectsGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects.generate.executor import ( 5 | _FetchObjectsGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _FetchObjectsGenerateAsync( 13 | Generic[Properties, References], 14 | _FetchObjectsGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects.generate.executor import ( 5 | _FetchObjectsGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _FetchObjectsGenerate( 13 | Generic[Properties, References], 14 | _FetchObjectsGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _FetchObjectsQueryAsync 2 | from .sync import _FetchObjectsQuery 3 | 4 | __all__ = [ 5 | "_FetchObjectsQuery", 6 | "_FetchObjectsQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects.query.executor import ( 5 | _FetchObjectsQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _FetchObjectsQueryAsync( 13 | Generic[Properties, References], 14 | _FetchObjectsQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects.query.executor import ( 5 | _FetchObjectsQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _FetchObjectsQuery( 13 | Generic[Properties, References], 14 | _FetchObjectsQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _FetchObjectsByIDsGenerate, _FetchObjectsByIDsGenerateAsync 2 | from .query import _FetchObjectsByIDsQuery, _FetchObjectsByIDsQueryAsync 3 | 4 | __all__ = [ 5 | "_FetchObjectsByIDsGenerate", 6 | "_FetchObjectsByIDsGenerateAsync", 7 | "_FetchObjectsByIDsQuery", 8 | "_FetchObjectsByIDsQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _FetchObjectsByIDsGenerateAsync 2 | from .sync import _FetchObjectsByIDsGenerate 3 | 4 | __all__ = [ 5 | "_FetchObjectsByIDsGenerate", 6 | "_FetchObjectsByIDsGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects_by_ids.generate.executor import ( 5 | _FetchObjectsByIDsGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _FetchObjectsByIDsGenerateAsync( 13 | Generic[Properties, References], 14 | _FetchObjectsByIDsGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects_by_ids.generate.executor import ( 5 | _FetchObjectsByIDsGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _FetchObjectsByIDsGenerate( 13 | Generic[Properties, References], 14 | _FetchObjectsByIDsGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _FetchObjectsByIDsQueryAsync 2 | from .sync import _FetchObjectsByIDsQuery 3 | 4 | __all__ = [ 5 | "_FetchObjectsByIDsQuery", 6 | "_FetchObjectsByIDsQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects_by_ids.query.executor import ( 5 | _FetchObjectsByIDsQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _FetchObjectsByIDsQueryAsync( 13 | Generic[Properties, References], 14 | _FetchObjectsByIDsQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/fetch_objects_by_ids/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.fetch_objects_by_ids.query.executor import ( 5 | _FetchObjectsByIDsQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _FetchObjectsByIDsQuery( 13 | Generic[Properties, References], 14 | _FetchObjectsByIDsQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _HybridGenerate, _HybridGenerateAsync 2 | from .query import _HybridQuery, _HybridQueryAsync 3 | 4 | __all__ = [ 5 | "_HybridGenerate", 6 | "_HybridGenerateAsync", 7 | "_HybridQuery", 8 | "_HybridQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _HybridGenerateAsync 2 | from .sync import _HybridGenerate 3 | 4 | __all__ = [ 5 | "_HybridGenerate", 6 | "_HybridGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.hybrid.generate.executor import ( 5 | _HybridGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _HybridGenerateAsync( 13 | Generic[Properties, References], 14 | _HybridGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.hybrid.generate.executor import ( 5 | _HybridGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _HybridGenerate( 13 | Generic[Properties, References], 14 | _HybridGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _HybridQueryAsync 2 | from .sync import _HybridQuery 3 | 4 | __all__ = [ 5 | "_HybridQuery", 6 | "_HybridQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.hybrid.query.executor import _HybridQueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionAsync 7 | 8 | 9 | @executor.wrap("async") 10 | class _HybridQueryAsync( 11 | Generic[Properties, References], 12 | _HybridQueryExecutor[ConnectionAsync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/hybrid/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.hybrid.query.executor import _HybridQueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionSync 7 | 8 | 9 | @executor.wrap("sync") 10 | class _HybridQuery( 11 | Generic[Properties, References], 12 | _HybridQueryExecutor[ConnectionSync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _NearImageGenerate, _NearImageGenerateAsync 2 | from .query import _NearImageQuery, _NearImageQueryAsync 3 | 4 | __all__ = [ 5 | "_NearImageGenerate", 6 | "_NearImageQuery", 7 | "_NearImageGenerateAsync", 8 | "_NearImageQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearImageGenerateAsync 2 | from .sync import _NearImageGenerate 3 | 4 | __all__ = [ 5 | "_NearImageGenerate", 6 | "_NearImageGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_image.generate.executor import ( 5 | _NearImageGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearImageGenerateAsync( 13 | Generic[Properties, References], 14 | _NearImageGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_image.generate.executor import ( 5 | _NearImageGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearImageGenerate( 13 | Generic[Properties, References], 14 | _NearImageGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearImageQueryAsync 2 | from .sync import _NearImageQuery 3 | 4 | __all__ = [ 5 | "_NearImageQuery", 6 | "_NearImageQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_image.query.executor import ( 5 | _NearImageQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearImageQueryAsync( 13 | Generic[Properties, References], 14 | _NearImageQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_image/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_image.query.executor import ( 5 | _NearImageQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearImageQuery( 13 | Generic[Properties, References], 14 | _NearImageQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _NearMediaGenerate, _NearMediaGenerateAsync 2 | from .query import _NearMediaQuery, _NearMediaQueryAsync 3 | 4 | __all__ = [ 5 | "_NearMediaGenerate", 6 | "_NearMediaQuery", 7 | "_NearMediaGenerateAsync", 8 | "_NearMediaQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearMediaGenerateAsync 2 | from .sync import _NearMediaGenerate 3 | 4 | __all__ = [ 5 | "_NearMediaGenerate", 6 | "_NearMediaGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_media.generate.executor import ( 5 | _NearMediaGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearMediaGenerateAsync( 13 | Generic[Properties, References], 14 | _NearMediaGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_media.generate.executor import ( 5 | _NearMediaGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearMediaGenerate( 13 | Generic[Properties, References], 14 | _NearMediaGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearMediaQueryAsync 2 | from .sync import _NearMediaQuery 3 | 4 | __all__ = [ 5 | "_NearMediaQuery", 6 | "_NearMediaQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_media.query.executor import ( 5 | _NearMediaQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearMediaQueryAsync( 13 | Generic[Properties, References], 14 | _NearMediaQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_media/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_media.query.executor import ( 5 | _NearMediaQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearMediaQuery( 13 | Generic[Properties, References], 14 | _NearMediaQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _NearObjectGenerate, _NearObjectGenerateAsync 2 | from .query import _NearObjectQuery, _NearObjectQueryAsync 3 | 4 | __all__ = [ 5 | "_NearObjectGenerate", 6 | "_NearObjectGenerateAsync", 7 | "_NearObjectQuery", 8 | "_NearObjectQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearObjectGenerateAsync 2 | from .sync import _NearObjectGenerate 3 | 4 | __all__ = [ 5 | "_NearObjectGenerate", 6 | "_NearObjectGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_object.generate.executor import ( 5 | _NearObjectGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearObjectGenerateAsync( 13 | Generic[Properties, References], 14 | _NearObjectGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_object.generate.executor import ( 5 | _NearObjectGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearObjectGenerate( 13 | Generic[Properties, References], 14 | _NearObjectGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearObjectQueryAsync 2 | from .sync import _NearObjectQuery 3 | 4 | __all__ = [ 5 | "_NearObjectQuery", 6 | "_NearObjectQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_object.query.executor import ( 5 | _NearObjectQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearObjectQueryAsync( 13 | Generic[Properties, References], 14 | _NearObjectQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_object/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_object.query.executor import ( 5 | _NearObjectQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearObjectQuery( 13 | Generic[Properties, References], 14 | _NearObjectQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _NearTextGenerate, _NearTextGenerateAsync 2 | from .query import _NearTextQuery, _NearTextQueryAsync 3 | 4 | __all__ = [ 5 | "_NearTextGenerate", 6 | "_NearTextQuery", 7 | "_NearTextGenerateAsync", 8 | "_NearTextQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearTextGenerateAsync 2 | from .sync import _NearTextGenerate 3 | 4 | __all__ = [ 5 | "_NearTextGenerate", 6 | "_NearTextGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_text.generate.executor import ( 5 | _NearTextGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearTextGenerateAsync( 13 | Generic[Properties, References], 14 | _NearTextGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_text.generate.executor import ( 5 | _NearTextGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearTextGenerate( 13 | Generic[Properties, References], 14 | _NearTextGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearTextQueryAsync 2 | from .sync import _NearTextQuery 3 | 4 | __all__ = [ 5 | "_NearTextQuery", 6 | "_NearTextQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_text.query.executor import _NearTextQueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionAsync 7 | 8 | 9 | @executor.wrap("async") 10 | class _NearTextQueryAsync( 11 | Generic[Properties, References], 12 | _NearTextQueryExecutor[ConnectionAsync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_text/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_text.query.executor import _NearTextQueryExecutor 5 | from weaviate.connect import executor 6 | from weaviate.connect.v4 import ConnectionSync 7 | 8 | 9 | @executor.wrap("sync") 10 | class _NearTextQuery( 11 | Generic[Properties, References], 12 | _NearTextQueryExecutor[ConnectionSync, Properties, References], 13 | ): 14 | pass 15 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/__init__.py: -------------------------------------------------------------------------------- 1 | from .generate import _NearVectorGenerate, _NearVectorGenerateAsync 2 | from .query import _NearVectorQuery, _NearVectorQueryAsync 3 | 4 | __all__ = [ 5 | "_NearVectorGenerate", 6 | "_NearVectorQuery", 7 | "_NearVectorGenerateAsync", 8 | "_NearVectorQueryAsync", 9 | ] 10 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearVectorGenerateAsync 2 | from .sync import _NearVectorGenerate 3 | 4 | __all__ = [ 5 | "_NearVectorGenerate", 6 | "_NearVectorGenerateAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/generate/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_vector.generate.executor import ( 5 | _NearVectorGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearVectorGenerateAsync( 13 | Generic[Properties, References], 14 | _NearVectorGenerateExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/generate/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_vector.generate.executor import ( 5 | _NearVectorGenerateExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearVectorGenerate( 13 | Generic[Properties, References], 14 | _NearVectorGenerateExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/query/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _NearVectorQueryAsync 2 | from .sync import _NearVectorQuery 3 | 4 | __all__ = [ 5 | "_NearVectorQuery", 6 | "_NearVectorQueryAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/query/async_.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_vector.query.executor import ( 5 | _NearVectorQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionAsync 9 | 10 | 11 | @executor.wrap("async") 12 | class _NearVectorQueryAsync( 13 | Generic[Properties, References], 14 | _NearVectorQueryExecutor[ConnectionAsync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/queries/near_vector/query/sync.py: -------------------------------------------------------------------------------- 1 | from typing import Generic 2 | 3 | from weaviate.collections.classes.types import Properties, References 4 | from weaviate.collections.queries.near_vector.query.executor import ( 5 | _NearVectorQueryExecutor, 6 | ) 7 | from weaviate.connect import executor 8 | from weaviate.connect.v4 import ConnectionSync 9 | 10 | 11 | @executor.wrap("sync") 12 | class _NearVectorQuery( 13 | Generic[Properties, References], 14 | _NearVectorQueryExecutor[ConnectionSync, Properties, References], 15 | ): 16 | pass 17 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import ( 2 | _TenantsAsync, 3 | ) 4 | from .executor import ( 5 | TenantCreateInputType, 6 | TenantOutputType, 7 | TenantUpdateInputType, 8 | ) 9 | from .sync import _Tenants 10 | 11 | __all__ = [ 12 | "_Tenants", 13 | "_TenantsAsync", 14 | "TenantCreateInputType", 15 | "TenantOutputType", 16 | "TenantUpdateInputType", 17 | ] 18 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.tenants.executor import _TenantsExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionAsync 4 | 5 | 6 | @executor.wrap("async") 7 | class _TenantsAsync(_TenantsExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, Optional, Sequence, Union 2 | 3 | from weaviate.collections.classes.tenants import Tenant 4 | from weaviate.collections.tenants.types import ( 5 | TenantCreateInputType, 6 | TenantOutputType, 7 | TenantUpdateInputType, 8 | ) 9 | from weaviate.connect.v4 import ConnectionAsync 10 | 11 | from .executor import _TenantsExecutor 12 | 13 | class _TenantsAsync(_TenantsExecutor[ConnectionAsync]): 14 | async def create( 15 | self, tenants: Union[TenantCreateInputType, Sequence[TenantCreateInputType]] 16 | ) -> None: ... 17 | async def remove(self, tenants: Union[str, Tenant, Sequence[Union[str, Tenant]]]) -> None: ... 18 | async def get(self) -> Dict[str, TenantOutputType]: ... 19 | async def get_by_names( 20 | self, tenants: Sequence[Union[str, Tenant]] 21 | ) -> Dict[str, TenantOutputType]: ... 22 | async def get_by_name(self, tenant: Union[str, Tenant]) -> Optional[TenantOutputType]: ... 23 | async def update( 24 | self, tenants: Union[TenantUpdateInputType, Sequence[TenantUpdateInputType]] 25 | ) -> None: ... 26 | async def exists(self, tenant: Union[str, Tenant]) -> bool: ... 27 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.tenants.executor import _TenantsExecutor 2 | from weaviate.connect import executor 3 | from weaviate.connect.v4 import ConnectionSync 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Tenants(_TenantsExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, Optional, Sequence, Union 2 | 3 | from weaviate.collections.classes.tenants import Tenant 4 | from weaviate.collections.tenants.types import ( 5 | TenantCreateInputType, 6 | TenantOutputType, 7 | TenantUpdateInputType, 8 | ) 9 | from weaviate.connect.v4 import ConnectionSync 10 | 11 | from .executor import _TenantsExecutor 12 | 13 | class _Tenants(_TenantsExecutor[ConnectionSync]): 14 | def create( 15 | self, tenants: Union[TenantCreateInputType, Sequence[TenantCreateInputType]] 16 | ) -> None: ... 17 | def remove(self, tenants: Union[str, Tenant, Sequence[Union[str, Tenant]]]) -> None: ... 18 | def get(self) -> Dict[str, TenantOutputType]: ... 19 | def get_by_names( 20 | self, tenants: Sequence[Union[str, Tenant]] 21 | ) -> Dict[str, TenantOutputType]: ... 22 | def get_by_name(self, tenant: Union[str, Tenant]) -> Optional[TenantOutputType]: ... 23 | def update( 24 | self, tenants: Union[TenantUpdateInputType, Sequence[TenantUpdateInputType]] 25 | ) -> None: ... 26 | def exists(self, tenant: Union[str, Tenant]) -> bool: ... 27 | -------------------------------------------------------------------------------- /weaviate/collections/tenants/types.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from weaviate.collections.classes.tenants import Tenant, TenantCreate, TenantUpdate 4 | 5 | TenantCreateInputType = Union[str, Tenant, TenantCreate] 6 | TenantUpdateInputType = Union[Tenant, TenantUpdate] 7 | TenantOutputType = Tenant 8 | -------------------------------------------------------------------------------- /weaviate/conftest.py: -------------------------------------------------------------------------------- 1 | from xdist.scheduler.loadscope import LoadScopeScheduling # type: ignore 2 | 3 | 4 | class MyScheduler(LoadScopeScheduling): 5 | def _split_scope(self, nodeid: str) -> str: 6 | # certain tests cannot run in parallel, so we need to make sure they are assigned to the same node 7 | if "mock_test/" in nodeid: 8 | return "mock_test" 9 | return nodeid 10 | 11 | 12 | def pytest_xdist_make_scheduler(config: object, log: object) -> MyScheduler: 13 | return MyScheduler(config, log) # pyright: ignore 14 | -------------------------------------------------------------------------------- /weaviate/connect/__init__.py: -------------------------------------------------------------------------------- 1 | """Module communication to a Weaviate instance. Used to connect to Weaviate and run REST requests.""" 2 | 3 | from .base import ConnectionParams, ProtocolParams 4 | from .v4 import ConnectionV4 5 | 6 | __all__ = [ 7 | "ConnectionV4", 8 | "ConnectionParams", 9 | "ProtocolParams", 10 | ] 11 | -------------------------------------------------------------------------------- /weaviate/debug/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _DebugAsync 2 | from .sync import _Debug 3 | 4 | __all__ = [ 5 | "_Debug", 6 | "_DebugAsync", 7 | ] 8 | -------------------------------------------------------------------------------- /weaviate/debug/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionAsync 3 | from weaviate.debug.executor import _DebugExecutor 4 | 5 | 6 | @executor.wrap("async") 7 | class _DebugAsync(_DebugExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/debug/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from weaviate.classes.config import ConsistencyLevel 4 | from weaviate.connect.v4 import ConnectionAsync 5 | from weaviate.debug.types import DebugRESTObject 6 | from weaviate.types import UUID 7 | 8 | from .executor import _DebugExecutor 9 | 10 | class _DebugAsync(_DebugExecutor[ConnectionAsync]): 11 | async def get_object_over_rest( 12 | self, 13 | collection: str, 14 | uuid: UUID, 15 | *, 16 | consistency_level: Optional[ConsistencyLevel] = None, 17 | node_name: Optional[str] = None, 18 | tenant: Optional[str] = None, 19 | ) -> Optional[DebugRESTObject]: ... 20 | -------------------------------------------------------------------------------- /weaviate/debug/executor.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Generic, Optional 2 | 3 | from httpx import Response 4 | 5 | from weaviate.classes.config import ConsistencyLevel 6 | from weaviate.connect import executor 7 | from weaviate.connect.v4 import ConnectionType, _ExpectedStatusCodes 8 | from weaviate.debug.types import DebugRESTObject 9 | from weaviate.types import UUID 10 | 11 | 12 | class _DebugExecutor(Generic[ConnectionType]): 13 | def __init__(self, connection: ConnectionType): 14 | self._connection = connection 15 | 16 | def get_object_over_rest( 17 | self, 18 | collection: str, 19 | uuid: UUID, 20 | *, 21 | consistency_level: Optional[ConsistencyLevel] = None, 22 | node_name: Optional[str] = None, 23 | tenant: Optional[str] = None, 24 | ) -> executor.Result[Optional[DebugRESTObject]]: 25 | """Use the REST API endpoint /objects/{className}/{id} to retrieve an object directly from the database without search. 26 | 27 | The key difference between `debug.get_object_over_rest` and `query.fetch_object_by_id` is the underlying protocol. 28 | This method uses REST while that method uses gRPC. 29 | """ 30 | path = f"/objects/{collection}/{str(uuid)}" 31 | 32 | params: Dict[str, str] = {} 33 | if consistency_level is not None: 34 | params["consistency"] = consistency_level.value 35 | if node_name is not None: 36 | params["node_name"] = node_name 37 | if tenant is not None: 38 | params["tenant"] = tenant 39 | 40 | def resp(response: Response) -> Optional[DebugRESTObject]: 41 | if response.status_code == 404: 42 | return None 43 | return DebugRESTObject(**response.json()) 44 | 45 | return executor.execute( 46 | response_callback=resp, 47 | method=self._connection.get, 48 | path=path, 49 | params=params, 50 | error_msg="Object was not retrieved", 51 | status_codes=_ExpectedStatusCodes(ok_in=[200, 404], error="get object"), 52 | ) 53 | -------------------------------------------------------------------------------- /weaviate/debug/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionSync 3 | from weaviate.debug.executor import _DebugExecutor 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Debug(_DebugExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/debug/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from weaviate.classes.config import ConsistencyLevel 4 | from weaviate.connect.v4 import ConnectionSync 5 | from weaviate.debug.types import DebugRESTObject 6 | from weaviate.types import UUID 7 | 8 | from .executor import _DebugExecutor 9 | 10 | class _Debug(_DebugExecutor[ConnectionSync]): 11 | def get_object_over_rest( 12 | self, 13 | collection: str, 14 | uuid: UUID, 15 | *, 16 | consistency_level: Optional[ConsistencyLevel] = None, 17 | node_name: Optional[str] = None, 18 | tenant: Optional[str] = None, 19 | ) -> Optional[DebugRESTObject]: ... 20 | -------------------------------------------------------------------------------- /weaviate/debug/types.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import Any, Dict, Optional 3 | 4 | from pydantic import BaseModel, Field 5 | 6 | from weaviate.types import uuid_package 7 | 8 | 9 | class DebugRESTObject(BaseModel): 10 | collection: str = Field(..., alias="class") 11 | creation_time: datetime = Field(..., alias="creationTimeUnix") 12 | last_update_time: datetime = Field(..., alias="lastUpdateTimeUnix") 13 | properties: Dict[str, Any] = Field(...) 14 | tenant: Optional[str] = Field(None) 15 | uuid: uuid_package.UUID = Field(..., alias="id") 16 | vector: Optional[list[float]] = Field(None) 17 | vectors: Optional[Dict[str, list[float]]] = Field(None) 18 | -------------------------------------------------------------------------------- /weaviate/gql/__init__.py: -------------------------------------------------------------------------------- 1 | """GraphQL module used to create `get` and/or `aggregate` GraphQL requests from Weaviate.""" 2 | -------------------------------------------------------------------------------- /weaviate/integrations.py: -------------------------------------------------------------------------------- 1 | from typing import List, Union 2 | 3 | from weaviate.connect.integrations import _IntegrationConfig 4 | from weaviate.connect.v4 import Connection 5 | 6 | 7 | class _Integrations: 8 | def __init__(self, connection: Connection) -> None: 9 | self.__connection = connection 10 | 11 | def configure( 12 | self, integrations_config: Union[_IntegrationConfig, List[_IntegrationConfig]] 13 | ) -> None: 14 | if isinstance(integrations_config, _IntegrationConfig): 15 | integrations_config = [integrations_config] 16 | self.__connection.set_integrations(integrations_config) 17 | self.__connection._prepare_grpc_headers() 18 | -------------------------------------------------------------------------------- /weaviate/logger.py: -------------------------------------------------------------------------------- 1 | import os 2 | from logging import getLogger 3 | 4 | logger = getLogger("weaviate-client") 5 | logger.setLevel(os.getenv("WEAVIATE_LOG_LEVEL", "INFO")) 6 | -------------------------------------------------------------------------------- /weaviate/outputs/__init__.py: -------------------------------------------------------------------------------- 1 | from . import aggregate, backup, batch, cluster, config, data, query, tenants, users 2 | 3 | __all__ = [ 4 | "aggregate", 5 | "backup", 6 | "batch", 7 | "cluster", 8 | "config", 9 | "data", 10 | "query", 11 | "tenants", 12 | "users", 13 | ] 14 | -------------------------------------------------------------------------------- /weaviate/outputs/aggregate.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.aggregate import ( 2 | AggregateBoolean, 3 | AggregateDate, 4 | AggregateGroup, 5 | AggregateGroupByReturn, 6 | AggregateInteger, 7 | AggregateNumber, 8 | # AggregateReference, # Aggregate references currently bugged on Weaviate's side 9 | AggregateResult, 10 | AggregateReturn, 11 | AggregateText, 12 | GroupedBy, 13 | ) 14 | 15 | __all__ = [ 16 | "AggregateBoolean", 17 | "AggregateDate", 18 | "AggregateGroup", 19 | "AggregateGroupByReturn", 20 | "AggregateInteger", 21 | "AggregateNumber", 22 | # "AggregateReference", 23 | "AggregateResult", 24 | "AggregateReturn", 25 | "AggregateText", 26 | "GroupedBy", 27 | ] 28 | -------------------------------------------------------------------------------- /weaviate/outputs/backup.py: -------------------------------------------------------------------------------- 1 | from weaviate.backup.backup import ( 2 | BackupReturn, 3 | BackupStatus, 4 | BackupStatusReturn, 5 | BackupStorage, 6 | ) 7 | 8 | __all__ = [ 9 | "BackupStatus", 10 | "BackupStatusReturn", 11 | "BackupStorage", 12 | "BackupReturn", 13 | ] 14 | -------------------------------------------------------------------------------- /weaviate/outputs/batch.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.batch import ( 2 | BatchObjectReturn, 3 | BatchReferenceReturn, 4 | BatchResult, 5 | ErrorObject, 6 | ErrorReference, 7 | ) 8 | 9 | __all__ = [ 10 | "BatchObjectReturn", 11 | "BatchReferenceReturn", 12 | "BatchResult", 13 | "ErrorObject", 14 | "ErrorReference", 15 | ] 16 | -------------------------------------------------------------------------------- /weaviate/outputs/cluster.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.cluster import ( 2 | Node, 3 | Shard, 4 | Shards, 5 | ) 6 | 7 | __all__ = [ 8 | "Node", 9 | "Shard", 10 | "Shards", 11 | ] 12 | -------------------------------------------------------------------------------- /weaviate/outputs/config.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.config import ( 2 | BM25Config, 3 | CollectionConfig, 4 | CollectionConfigSimple, 5 | GenerativeConfig, 6 | GenerativeSearches, 7 | InvertedIndexConfig, 8 | MultiTenancyConfig, 9 | PQConfig, 10 | PQEncoderConfig, 11 | PQEncoderDistribution, 12 | PQEncoderType, 13 | PropertyConfig, 14 | PropertyType, 15 | ReferencePropertyConfig, 16 | ReplicationConfig, 17 | ReplicationDeletionStrategy, 18 | RerankerConfig, 19 | Rerankers, 20 | ShardingConfig, 21 | ShardStatus, 22 | ShardTypes, 23 | VectorDistances, 24 | VectorIndexConfigFlat, 25 | VectorIndexConfigHNSW, 26 | VectorIndexType, 27 | VectorizerConfig, 28 | Vectorizers, 29 | ) 30 | 31 | __all__ = [ 32 | "BM25Config", 33 | "CollectionConfig", 34 | "CollectionConfigSimple", 35 | "GenerativeConfig", 36 | "GenerativeSearches", 37 | "InvertedIndexConfig", 38 | "MultiTenancyConfig", 39 | "ReplicationDeletionStrategy", 40 | "PQConfig", 41 | "PQEncoderConfig", 42 | "PQEncoderDistribution", 43 | "PQEncoderType", 44 | "PropertyConfig", 45 | "PropertyType", 46 | "ReferencePropertyConfig", 47 | "ReplicationConfig", 48 | "Rerankers", 49 | "RerankerConfig", 50 | "ShardingConfig", 51 | "ShardStatus", 52 | "ShardTypes", 53 | "VectorDistances", 54 | "VectorIndexConfigHNSW", 55 | "VectorIndexConfigFlat", 56 | "VectorIndexType", 57 | "Vectorizers", 58 | "VectorizerConfig", 59 | ] 60 | -------------------------------------------------------------------------------- /weaviate/outputs/data.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.batch import ( 2 | DeleteManyObject, 3 | DeleteManyReturn, 4 | ) 5 | from weaviate.collections.classes.data import Error, RefError 6 | 7 | __all__ = [ 8 | "DeleteManyObject", 9 | "DeleteManyReturn", 10 | "Error", 11 | "RefError", 12 | ] 13 | -------------------------------------------------------------------------------- /weaviate/outputs/generate.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.generative import ( 2 | GenerativeConfigRuntime, 3 | GroupedTask, 4 | SinglePrompt, 5 | ) 6 | 7 | __all__ = [ 8 | "GenerativeConfigRuntime", 9 | "GroupedTask", 10 | "SinglePrompt", 11 | ] 12 | -------------------------------------------------------------------------------- /weaviate/outputs/rbac.py: -------------------------------------------------------------------------------- 1 | from weaviate.rbac.models import ( 2 | BackupsPermissionOutput, 3 | ClusterPermissionOutput, 4 | CollectionsPermissionOutput, 5 | DataPermissionOutput, 6 | NodesPermissionOutput, 7 | PermissionsOutputType, 8 | RoleScope, 9 | RolesPermissionOutput, 10 | UserAssignment, 11 | UsersPermissionOutput, 12 | ) 13 | 14 | __all__ = [ 15 | "PermissionsOutputType", 16 | "BackupsPermissionOutput", 17 | "ClusterPermissionOutput", 18 | "CollectionsPermissionOutput", 19 | "DataPermissionOutput", 20 | "NodesPermissionOutput", 21 | "RolesPermissionOutput", 22 | "RoleScope", 23 | "UsersPermissionOutput", 24 | "UserAssignment", 25 | ] 26 | -------------------------------------------------------------------------------- /weaviate/outputs/tenants.py: -------------------------------------------------------------------------------- 1 | from weaviate.collections.classes.tenants import Tenant, TenantActivityStatus 2 | from weaviate.collections.tenants import TenantOutputType 3 | 4 | __all__ = ["Tenant", "TenantActivityStatus", "TenantOutputType"] 5 | -------------------------------------------------------------------------------- /weaviate/outputs/users.py: -------------------------------------------------------------------------------- 1 | from weaviate.users.users import OwnUser, UserDB, UserTypes 2 | 3 | __all__ = ["OwnUser", "UserDB", "UserTypes"] 4 | -------------------------------------------------------------------------------- /weaviate/proto/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/weaviate/proto/__init__.py -------------------------------------------------------------------------------- /weaviate/proto/v1/__init__.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | warnings.filterwarnings( 4 | "ignore", 5 | r"(?=.*5\.27\.\d+)(?=.*5\.28\.\d+)(?=.*obsolete)", 6 | UserWarning, 7 | "google.protobuf.runtime_version", 8 | ) 9 | # ref: https://github.com/grpc/grpc/issues/37609 and https://github.com/protocolbuffers/protobuf/pull/17241 10 | -------------------------------------------------------------------------------- /weaviate/proto/v1/aggregate_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/base_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the Protocol Buffers compiler. DO NOT EDIT! 2 | # source: v1/base.proto 3 | # plugin: grpclib.plugin.main 4 | -------------------------------------------------------------------------------- /weaviate/proto/v1/base_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/base_search_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/batch_delete_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/batch_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/generative_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/properties_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "this script assumes that you have checked out weaviate next to the client" 4 | cd "${0%/*}/.." 5 | 6 | 7 | python3 -m grpc_tools.protoc -I ../../../weaviate/grpc/proto --python_out=./ --pyi_out=./ --grpc_python_out=./ ../../../weaviate/grpc/proto/v1/*.proto 8 | 9 | sed -i '' 's/from v1/from weaviate.proto.v1/g' v1/*.py 10 | sed -i '' 's/from v1/from weaviate.proto.v1/g' v1/*.pyi 11 | 12 | echo "done" -------------------------------------------------------------------------------- /weaviate/proto/v1/search_get_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/tenants_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | import grpc 4 | 5 | -------------------------------------------------------------------------------- /weaviate/proto/v1/weaviate_pb2.pyi: -------------------------------------------------------------------------------- 1 | from weaviate.proto.v1 import aggregate_pb2 as _aggregate_pb2 2 | from weaviate.proto.v1 import batch_pb2 as _batch_pb2 3 | from weaviate.proto.v1 import batch_delete_pb2 as _batch_delete_pb2 4 | from weaviate.proto.v1 import search_get_pb2 as _search_get_pb2 5 | from weaviate.proto.v1 import tenants_pb2 as _tenants_pb2 6 | from google.protobuf import descriptor as _descriptor 7 | from typing import ClassVar as _ClassVar 8 | 9 | DESCRIPTOR: _descriptor.FileDescriptor 10 | -------------------------------------------------------------------------------- /weaviate/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weaviate/weaviate-python-client/1edf12e6fa2dc1204545ebca6e1369b4fb70be0b/weaviate/py.typed -------------------------------------------------------------------------------- /weaviate/rbac/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _RolesAsync 2 | from .sync import _Roles 3 | 4 | __all__ = ["_RolesAsync", "_Roles"] 5 | -------------------------------------------------------------------------------- /weaviate/rbac/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionAsync 3 | from weaviate.rbac.executor import _RolesExecutor 4 | 5 | 6 | @executor.wrap("async") 7 | class _RolesAsync(_RolesExecutor[ConnectionAsync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/rbac/async_.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional, Sequence, Union 2 | 3 | from typing_extensions import deprecated 4 | 5 | from weaviate.connect.v4 import ConnectionAsync 6 | from weaviate.rbac.models import PermissionsInputType, PermissionsOutputType, Role, UserAssignment 7 | 8 | from .executor import _RolesExecutor 9 | 10 | class _RolesAsync(_RolesExecutor[ConnectionAsync]): 11 | async def list_all(self) -> Dict[str, Role]: ... 12 | async def get_current_roles(self) -> List[Role]: ... 13 | async def exists(self, role_name: str) -> bool: ... 14 | async def get(self, role_name: str) -> Optional[Role]: ... 15 | async def create(self, *, role_name: str, permissions: PermissionsInputType) -> Role: ... 16 | async def get_user_assignments(self, role_name: str) -> List[UserAssignment]: ... 17 | @deprecated( 18 | "This method is deprecated and will be removed in Q4 25. Please use `roles.get_user_assignments` instead." 19 | ) 20 | async def get_assigned_user_ids(self, role_name: str) -> List[str]: ... 21 | async def delete(self, role_name: str) -> None: ... 22 | async def add_permissions( 23 | self, *, permissions: PermissionsInputType, role_name: str 24 | ) -> None: ... 25 | async def remove_permissions( 26 | self, *, permissions: PermissionsInputType, role_name: str 27 | ) -> None: ... 28 | async def has_permissions( 29 | self, 30 | *, 31 | permissions: Union[ 32 | PermissionsInputType, PermissionsOutputType, Sequence[PermissionsOutputType] 33 | ], 34 | role: str, 35 | ) -> bool: ... 36 | -------------------------------------------------------------------------------- /weaviate/rbac/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionSync 3 | from weaviate.rbac.executor import _RolesExecutor 4 | 5 | 6 | @executor.wrap("sync") 7 | class _Roles(_RolesExecutor[ConnectionSync]): 8 | pass 9 | -------------------------------------------------------------------------------- /weaviate/rbac/sync.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional, Sequence, Union 2 | 3 | from typing_extensions import deprecated 4 | 5 | from weaviate.connect.v4 import ConnectionSync 6 | from weaviate.rbac.models import PermissionsInputType, PermissionsOutputType, Role, UserAssignment 7 | 8 | from .executor import _RolesExecutor 9 | 10 | class _Roles(_RolesExecutor[ConnectionSync]): 11 | def list_all(self) -> Dict[str, Role]: ... 12 | def get_current_roles(self) -> List[Role]: ... 13 | def exists(self, role_name: str) -> bool: ... 14 | def get(self, role_name: str) -> Optional[Role]: ... 15 | def create(self, *, role_name: str, permissions: PermissionsInputType) -> Role: ... 16 | def get_user_assignments(self, role_name: str) -> List[UserAssignment]: ... 17 | @deprecated( 18 | "This method is deprecated and will be removed in Q4 25. Please use `roles.get_user_assignments` instead." 19 | ) 20 | def get_assigned_user_ids(self, role_name: str) -> List[str]: ... 21 | def delete(self, role_name: str) -> None: ... 22 | def add_permissions(self, *, permissions: PermissionsInputType, role_name: str) -> None: ... 23 | def remove_permissions(self, *, permissions: PermissionsInputType, role_name: str) -> None: ... 24 | def has_permissions( 25 | self, 26 | *, 27 | permissions: Union[ 28 | PermissionsInputType, PermissionsOutputType, Sequence[PermissionsOutputType] 29 | ], 30 | role: str, 31 | ) -> bool: ... 32 | -------------------------------------------------------------------------------- /weaviate/str_enum.py: -------------------------------------------------------------------------------- 1 | # MetaEnum and BaseEnum are required to support `in` statements: 2 | # 'ALL' in ConsistencyLevel == True 3 | # 12345 in ConsistencyLevel == False 4 | from enum import Enum, EnumMeta 5 | from typing import Any 6 | 7 | 8 | class MetaEnum(EnumMeta): 9 | def __contains__(cls, item: Any) -> bool: 10 | try: 11 | # when item is type ConsistencyLevel 12 | return item.name in cls.__members__.keys() 13 | except AttributeError: 14 | # when item is type str 15 | return item in cls.__members__.keys() 16 | 17 | 18 | class BaseEnum(Enum, metaclass=MetaEnum): 19 | pass 20 | -------------------------------------------------------------------------------- /weaviate/types.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import uuid as uuid_package 3 | from io import BufferedReader 4 | from pathlib import Path 5 | from typing import Dict, List, Mapping, Sequence, Tuple, Union 6 | 7 | DATE = datetime.datetime 8 | UUID = Union[str, uuid_package.UUID] 9 | UUIDS = Union[Sequence[UUID], UUID] 10 | NUMBER = Union[int, float] 11 | GEO_COORDINATES = Tuple[float, float] 12 | VECTORS = Union[Mapping[str, Union[Sequence[NUMBER], Sequence[Sequence[NUMBER]]]], Sequence[NUMBER]] 13 | INCLUDE_VECTOR = Union[bool, str, List[str]] 14 | BLOB_INPUT = Union[str, Path, BufferedReader] 15 | 16 | BEACON = "weaviate://localhost/" 17 | 18 | PRIMITIVE = Union[str, int, float, bool, datetime.datetime, uuid_package.UUID] 19 | 20 | DATATYPE_TO_PYTHON_TYPE = { 21 | "text": str, 22 | "int": int, 23 | "text[]": List[str], 24 | "int[]": List[int], 25 | "boolean": bool, 26 | "boolean[]": List[bool], 27 | "number": float, 28 | "number[]": List[float], 29 | "date": datetime.datetime, 30 | "date[]": List[datetime.datetime], 31 | "geoCoordinates": GEO_COORDINATES, 32 | "object": Dict[str, PRIMITIVE], 33 | "object[]": List[Dict[str, PRIMITIVE]], 34 | } 35 | PYTHON_TYPE_TO_DATATYPE = {val: key for key, val in DATATYPE_TO_PYTHON_TYPE.items()} 36 | TIME = datetime.datetime 37 | -------------------------------------------------------------------------------- /weaviate/users/__init__.py: -------------------------------------------------------------------------------- 1 | from .async_ import _UsersAsync 2 | from .sync import _Users 3 | 4 | __all__ = ["_UsersAsync", "_Users"] 5 | -------------------------------------------------------------------------------- /weaviate/users/async_.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionAsync 3 | from weaviate.users.base import ( 4 | _UsersDBExecutor, 5 | _UsersExecutor, 6 | _UsersOIDCExecutor, 7 | ) 8 | 9 | 10 | @executor.wrap("async") 11 | class _UsersDBAsync(_UsersDBExecutor[ConnectionAsync]): 12 | pass 13 | 14 | 15 | @executor.wrap("async") 16 | class _UsersOIDCAsync(_UsersOIDCExecutor[ConnectionAsync]): 17 | pass 18 | 19 | 20 | @executor.wrap("async") 21 | class _UsersAsync(_UsersExecutor[ConnectionAsync]): 22 | def __init__(self, connection: ConnectionAsync): 23 | super().__init__(connection) 24 | self.db = _UsersDBAsync(connection) 25 | self.oidc = _UsersOIDCAsync(connection) 26 | -------------------------------------------------------------------------------- /weaviate/users/sync.py: -------------------------------------------------------------------------------- 1 | from weaviate.connect import executor 2 | from weaviate.connect.v4 import ConnectionSync 3 | from weaviate.users.base import ( 4 | _UsersDBExecutor, 5 | _UsersExecutor, 6 | _UsersOIDCExecutor, 7 | ) 8 | 9 | 10 | @executor.wrap("sync") 11 | class _UsersDB(_UsersDBExecutor[ConnectionSync]): 12 | pass 13 | 14 | 15 | @executor.wrap("sync") 16 | class _UsersOIDC(_UsersOIDCExecutor[ConnectionSync]): 17 | pass 18 | 19 | 20 | @executor.wrap("sync") 21 | class _Users(_UsersExecutor[ConnectionSync]): 22 | def __init__(self, connection: ConnectionSync): 23 | super().__init__(connection) 24 | self.db = _UsersDB(connection) 25 | self.oidc = _UsersOIDC(connection) 26 | -------------------------------------------------------------------------------- /weaviate/users/users.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Dict, Final, List, Literal 3 | 4 | from weaviate.rbac.models import ( 5 | Role, 6 | UserTypes, 7 | ) 8 | 9 | USER_TYPE_DB: Final = "db" 10 | USER_TYPE_OIDC: Final = "oidc" 11 | USER_TYPE = Literal["db", "oidc"] 12 | 13 | 14 | @dataclass 15 | class OwnUser: 16 | user_id: str 17 | roles: Dict[str, Role] 18 | 19 | 20 | @dataclass 21 | class UserBase: 22 | user_id: str 23 | role_names: List[str] 24 | user_type: UserTypes 25 | 26 | 27 | @dataclass 28 | class UserDB(UserBase): 29 | user_type: UserTypes 30 | active: bool 31 | 32 | 33 | @dataclass 34 | class UserOIDC(UserBase): 35 | user_type: UserTypes = UserTypes.OIDC 36 | --------------------------------------------------------------------------------