Python bindings for QueryMT
Project description
querymt
Python bindings for QueryMT.
Install
From the repository root:
python -m venv .venv
source .venv/bin/activate
pip install maturin
maturin develop --manifest-path crates/py/querymt-py/Cargo.toml
Then verify the module imports:
python -c "import querymt; print(querymt.__all__)"
Quick Start
import asyncio
import querymt
async def main() -> None:
registry = await querymt.Registry.default()
provider = await registry.provider("openai", model="gpt-4o-mini")
response = await provider.chat([
{"role": "user", "content": "Say hello briefly."}
])
print(response.text)
asyncio.run(main())
Examples
crates/py/querymt-py/examples/chat.pycrates/py/querymt-py/examples/stream_chat.pycrates/py/querymt-py/examples/tools_chat.pycrates/py/querymt-py/examples/tools_stream_chat.pycrates/py/querymt-py/examples/share_provider.pycrates/py/querymt-py/examples/remote_chat.py
Tool Calling
You can pass tool definitions as plain Python dictionaries matching QueryMT's Tool schema:
TOOLS = [
{
"type": "function",
"function": {
"name": "lookup_weather",
"description": "Look up the current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name"
}
},
"required": ["city"],
},
},
}
]
Use them with chat_with_tools(...) or chat_stream_with_tools(...).
Helper Builders
The module also exposes small helper builders:
querymt.user_message(...)querymt.assistant_message(...)querymt.text_block(...)querymt.image_block(...)querymt.image_url_block(...)querymt.pdf_block(...)querymt.audio_block(...)querymt.thinking_block(...)querymt.tool_use_block(...)querymt.tool_result_block(...)querymt.resource_link_block(...)querymt.function_tool(...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file querymt-0.5.2.tar.gz.
File metadata
- Download URL: querymt-0.5.2.tar.gz
- Upload date:
- Size: 432.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e4c4ef002c458ddafcb287a98b6fed9125e76b0d64cae74978c9fabd01743e
|
|
| MD5 |
6d73b800dd4d9bae30c45df8be9b3470
|
|
| BLAKE2b-256 |
9b894e7ae3c729500aa80e4ca2c309417f7c80bbe075f72d0d78d372ae5a0451
|
Provenance
The following attestation bundles were made for querymt-0.5.2.tar.gz:
Publisher:
publish-querymt-pypi.yml on querymt/querymt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
querymt-0.5.2.tar.gz -
Subject digest:
62e4c4ef002c458ddafcb287a98b6fed9125e76b0d64cae74978c9fabd01743e - Sigstore transparency entry: 1955474382
- Sigstore integration time:
-
Permalink:
querymt/querymt@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/querymt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-querymt-pypi.yml@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file querymt-0.5.2-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: querymt-0.5.2-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 20.5 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e3e12ff610ba3ac45b411488675720a3bc913b14aac1ec7f3bf6a332228128e
|
|
| MD5 |
c87638254886b164d51f34d31c0e8715
|
|
| BLAKE2b-256 |
cfc39f5c7370c2ea474c82c9bcee6f30a68d98c912c35d963a4e7bb3a5fa6f2d
|
Provenance
The following attestation bundles were made for querymt-0.5.2-cp310-abi3-win_amd64.whl:
Publisher:
publish-querymt-pypi.yml on querymt/querymt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
querymt-0.5.2-cp310-abi3-win_amd64.whl -
Subject digest:
7e3e12ff610ba3ac45b411488675720a3bc913b14aac1ec7f3bf6a332228128e - Sigstore transparency entry: 1955474514
- Sigstore integration time:
-
Permalink:
querymt/querymt@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/querymt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-querymt-pypi.yml@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 26.6 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005bfd45b5c8cb991fb1a4db0edcb5847381d3a2292285e23a49672b2b045e60
|
|
| MD5 |
0bc0fb162d54fbe5f72b942ee53fcbd0
|
|
| BLAKE2b-256 |
1e9cf082a67ef0097de9cbac3a0904d1265f49a68cc73d7bf7cf84585b9cd4d5
|
Provenance
The following attestation bundles were made for querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-querymt-pypi.yml on querymt/querymt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
005bfd45b5c8cb991fb1a4db0edcb5847381d3a2292285e23a49672b2b045e60 - Sigstore transparency entry: 1955474479
- Sigstore integration time:
-
Permalink:
querymt/querymt@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/querymt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-querymt-pypi.yml@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 26.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cc172c14872a2d7d351b4dec43007282300efb2f6587d7580c60fc13a8c5950
|
|
| MD5 |
48adc52e571e52fe2d25ddb7b59e6bed
|
|
| BLAKE2b-256 |
3df7b3c848751277c82059b9a4815af2425adf389d6b3e953089583f189798a6
|
Provenance
The following attestation bundles were made for querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish-querymt-pypi.yml on querymt/querymt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
1cc172c14872a2d7d351b4dec43007282300efb2f6587d7580c60fc13a8c5950 - Sigstore transparency entry: 1955474445
- Sigstore integration time:
-
Permalink:
querymt/querymt@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/querymt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-querymt-pypi.yml@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.1 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c1ec96f9fd43943dfce7ba1205a3946e415fa28a08d3b87b18e1b8ce65a37db
|
|
| MD5 |
c0ab08488497bef1bb75f76e1efb1ba0
|
|
| BLAKE2b-256 |
ce40053f014bc56baf44de9e9929f962098083393d3e9c877a0082bbe57cc07d
|
Provenance
The following attestation bundles were made for querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-querymt-pypi.yml on querymt/querymt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
2c1ec96f9fd43943dfce7ba1205a3946e415fa28a08d3b87b18e1b8ce65a37db - Sigstore transparency entry: 1955474414
- Sigstore integration time:
-
Permalink:
querymt/querymt@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/querymt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-querymt-pypi.yml@3ae3c68126d16ecb990b94754d5808bb76861e9b -
Trigger Event:
push
-
Statement type: