llm-api-adapter-mistral 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llm_api_adapter_mistral-0.1.0/LICENSE +21 -0
- llm_api_adapter_mistral-0.1.0/MANIFEST.in +10 -0
- llm_api_adapter_mistral-0.1.0/PKG-INFO +72 -0
- llm_api_adapter_mistral-0.1.0/README.md +24 -0
- llm_api_adapter_mistral-0.1.0/pyproject.toml +49 -0
- llm_api_adapter_mistral-0.1.0/setup.cfg +4 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/__init__.py +18 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/adapter.py +1049 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/clients/__init__.py +6 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/clients/async_client.py +89 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/clients/sync_client.py +102 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/documents.py +83 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/plugin.py +27 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/py.typed +0 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/registry/__init__.py +27 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral/registry/organizations/mistral.json +50 -0
- llm_api_adapter_mistral-0.1.0/src/llm_api_adapter_mistral.egg-info/SOURCES.txt +15 -0
- llm_api_adapter_mistral-0.1.0/tests/test_mistral_adapter.py +747 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sergey Inozemtsev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include src/llm_api_adapter_mistral/py.typed
|
|
4
|
+
recursive-include src/llm_api_adapter_mistral/registry/organizations *.json
|
|
5
|
+
|
|
6
|
+
global-exclude *.py[cod]
|
|
7
|
+
prune **/__pycache__
|
|
8
|
+
prune **/.pytest_cache
|
|
9
|
+
global-exclude *.egg-info
|
|
10
|
+
prune **/*.egg-info
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llm-api-adapter-mistral
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Mistral API package for llm-api-adapter
|
|
5
|
+
Author: Sergey Inozemtsev
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Sergey Inozemtsev
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Repository, https://github.com/Inozem/llm_api_adapter/
|
|
29
|
+
Keywords: llm,mistral,adapter,api
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
36
|
+
Classifier: Typing :: Typed
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Requires-Python: >=3.10
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: llm-api-adapter<1.0.0,>=0.9.0
|
|
43
|
+
Provides-Extra: async
|
|
44
|
+
Requires-Dist: llm-api-adapter[async]<1.0.0,>=0.9.0; extra == "async"
|
|
45
|
+
Provides-Extra: httpx
|
|
46
|
+
Requires-Dist: llm-api-adapter[httpx]<1.0.0,>=0.9.0; extra == "httpx"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# llm-api-adapter-mistral
|
|
50
|
+
|
|
51
|
+
Official direct-API support for Mistral in
|
|
52
|
+
[llm-api-adapter](https://github.com/Inozem/llm_api_adapter/).
|
|
53
|
+
|
|
54
|
+
Supported models:
|
|
55
|
+
|
|
56
|
+
- `mistral-small-2603`
|
|
57
|
+
- `mistral-medium-3-5`
|
|
58
|
+
- `mistral-large-2512`
|
|
59
|
+
|
|
60
|
+
## PDF input
|
|
61
|
+
|
|
62
|
+
`DocumentPart` supports PDF URLs and bytes. Before the chat request, the
|
|
63
|
+
adapter sends each PDF to Mistral OCR 4.1 (`mistral-ocr-4-1`) and supplies the resulting Markdown to
|
|
64
|
+
the selected chat model. This creates a separate OCR API request, subject to
|
|
65
|
+
Mistral's OCR limits and pricing; `ChatResponse` usage and cost cover only the
|
|
66
|
+
chat completion.
|
|
67
|
+
|
|
68
|
+
Install the package alongside a compatible core distribution:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install llm-api-adapter-mistral
|
|
72
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# llm-api-adapter-mistral
|
|
2
|
+
|
|
3
|
+
Official direct-API support for Mistral in
|
|
4
|
+
[llm-api-adapter](https://github.com/Inozem/llm_api_adapter/).
|
|
5
|
+
|
|
6
|
+
Supported models:
|
|
7
|
+
|
|
8
|
+
- `mistral-small-2603`
|
|
9
|
+
- `mistral-medium-3-5`
|
|
10
|
+
- `mistral-large-2512`
|
|
11
|
+
|
|
12
|
+
## PDF input
|
|
13
|
+
|
|
14
|
+
`DocumentPart` supports PDF URLs and bytes. Before the chat request, the
|
|
15
|
+
adapter sends each PDF to Mistral OCR 4.1 (`mistral-ocr-4-1`) and supplies the resulting Markdown to
|
|
16
|
+
the selected chat model. This creates a separate OCR API request, subject to
|
|
17
|
+
Mistral's OCR limits and pricing; `ChatResponse` usage and cost cover only the
|
|
18
|
+
chat completion.
|
|
19
|
+
|
|
20
|
+
Install the package alongside a compatible core distribution:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install llm-api-adapter-mistral
|
|
24
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "llm-api-adapter-mistral"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Official Mistral API package for llm-api-adapter"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
authors = [{name = "Sergey Inozemtsev"}]
|
|
13
|
+
keywords = ["llm", "mistral", "adapter", "api"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
]
|
|
25
|
+
dependencies = ["llm-api-adapter>=0.9.0,<1.0.0"]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
async = ["llm-api-adapter[async]>=0.9.0,<1.0.0"]
|
|
29
|
+
httpx = ["llm-api-adapter[httpx]>=0.9.0,<1.0.0"]
|
|
30
|
+
|
|
31
|
+
[project.entry-points."llm_api_adapter.organizations"]
|
|
32
|
+
mistral = "llm_api_adapter_mistral.plugin:PLUGIN"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Repository = "https://github.com/Inozem/llm_api_adapter/"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.package-dir]
|
|
38
|
+
"" = "src"
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
where = ["src"]
|
|
42
|
+
include = ["llm_api_adapter_mistral*"]
|
|
43
|
+
exclude = ["tests*", "*/tests*"]
|
|
44
|
+
|
|
45
|
+
[tool.setuptools]
|
|
46
|
+
include-package-data = true
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-data]
|
|
49
|
+
"llm_api_adapter_mistral" = ["py.typed", "registry/organizations/*.json"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Official direct-API support for Mistral models."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from .adapter import MistralAdapter
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def __getattr__(name: str) -> Any:
|
|
11
|
+
"""Load the adapter only when the public class is requested."""
|
|
12
|
+
if name == "MistralAdapter":
|
|
13
|
+
from .adapter import MistralAdapter
|
|
14
|
+
|
|
15
|
+
return MistralAdapter
|
|
16
|
+
raise AttributeError(name)
|
|
17
|
+
|
|
18
|
+
__all__ = ["MistralAdapter"]
|