mixpeek 0.2__tar.gz → 0.6.1__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.
- mixpeek-0.2/LICENSE.rst → mixpeek-0.6.1/LICENSE +10 -9
- mixpeek-0.6.1/PKG-INFO +145 -0
- mixpeek-0.6.1/README.md +129 -0
- mixpeek-0.6.1/pyproject.toml +33 -0
- mixpeek-0.6.1/src/mixpeek/__init__.py +97 -0
- mixpeek-0.6.1/src/mixpeek/base_client.py +128 -0
- mixpeek-0.6.1/src/mixpeek/client.py +65 -0
- mixpeek-0.6.1/src/mixpeek/core/__init__.py +25 -0
- mixpeek-0.6.1/src/mixpeek/core/api_error.py +15 -0
- mixpeek-0.6.1/src/mixpeek/core/client_wrapper.py +83 -0
- mixpeek-0.6.1/src/mixpeek/core/datetime_utils.py +28 -0
- mixpeek-0.6.1/src/mixpeek/core/file.py +38 -0
- mixpeek-0.6.1/src/mixpeek/core/http_client.py +130 -0
- mixpeek-0.6.1/src/mixpeek/core/jsonable_encoder.py +103 -0
- mixpeek-0.6.1/src/mixpeek/core/remove_none_from_dict.py +11 -0
- mixpeek-0.6.1/src/mixpeek/core/request_options.py +32 -0
- mixpeek-0.6.1/src/mixpeek/errors/__init__.py +17 -0
- mixpeek-0.6.1/src/mixpeek/errors/bad_request_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/errors/forbidden_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/errors/internal_server_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/errors/not_found_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/errors/unauthorized_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/errors/unprocessable_entity_error.py +9 -0
- mixpeek-0.6.1/src/mixpeek/generators/__init__.py +2 -0
- mixpeek-0.6.1/src/mixpeek/generators/client.py +239 -0
- mixpeek-0.6.1/src/mixpeek/parse/__init__.py +2 -0
- mixpeek-0.6.1/src/mixpeek/parse/client.py +349 -0
- mixpeek-0.6.1/src/mixpeek/parse_client.py +14 -0
- mixpeek-0.6.1/src/mixpeek/pipelines/__init__.py +2 -0
- mixpeek-0.6.1/src/mixpeek/pipelines/client.py +546 -0
- mixpeek-0.6.1/src/mixpeek/py.typed +0 -0
- mixpeek-0.6.1/src/mixpeek/storage/__init__.py +2 -0
- mixpeek-0.6.1/src/mixpeek/storage/client.py +254 -0
- mixpeek-0.6.1/src/mixpeek/types/__init__.py +73 -0
- mixpeek-0.6.1/src/mixpeek/types/audio_params.py +29 -0
- mixpeek-0.6.1/src/mixpeek/types/configs_request.py +31 -0
- mixpeek-0.6.1/src/mixpeek/types/configs_response.py +31 -0
- mixpeek-0.6.1/src/mixpeek/types/connection.py +36 -0
- mixpeek-0.6.1/src/mixpeek/types/connection_engine.py +5 -0
- mixpeek-0.6.1/src/mixpeek/types/csv_params.py +29 -0
- mixpeek-0.6.1/src/mixpeek/types/destination_schema.py +31 -0
- mixpeek-0.6.1/src/mixpeek/types/embedding_request.py +32 -0
- mixpeek-0.6.1/src/mixpeek/types/embedding_response.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/error_message.py +29 -0
- mixpeek-0.6.1/src/mixpeek/types/error_response.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/field_schema.py +33 -0
- mixpeek-0.6.1/src/mixpeek/types/field_type.py +5 -0
- mixpeek-0.6.1/src/mixpeek/types/generation_response.py +34 -0
- mixpeek-0.6.1/src/mixpeek/types/html_params.py +29 -0
- mixpeek-0.6.1/src/mixpeek/types/http_validation_error.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/image_params.py +32 -0
- mixpeek-0.6.1/src/mixpeek/types/message.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/metadata.py +34 -0
- mixpeek-0.6.1/src/mixpeek/types/modality.py +5 -0
- mixpeek-0.6.1/src/mixpeek/types/model.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/pdf_params.py +41 -0
- mixpeek-0.6.1/src/mixpeek/types/pipeline_response.py +39 -0
- mixpeek-0.6.1/src/mixpeek/types/ppt_params.py +27 -0
- mixpeek-0.6.1/src/mixpeek/types/pptx_params.py +27 -0
- mixpeek-0.6.1/src/mixpeek/types/settings.py +35 -0
- mixpeek-0.6.1/src/mixpeek/types/source_schema.py +32 -0
- mixpeek-0.6.1/src/mixpeek/types/txt_params.py +27 -0
- mixpeek-0.6.1/src/mixpeek/types/validation_error.py +32 -0
- mixpeek-0.6.1/src/mixpeek/types/validation_error_loc_item.py +5 -0
- mixpeek-0.6.1/src/mixpeek/types/video_params.py +27 -0
- mixpeek-0.6.1/src/mixpeek/types/workflow_response.py +32 -0
- mixpeek-0.6.1/src/mixpeek/types/workflow_settings.py +30 -0
- mixpeek-0.6.1/src/mixpeek/types/xlsx_params.py +29 -0
- mixpeek-0.6.1/src/mixpeek/version.py +4 -0
- mixpeek-0.6.1/src/mixpeek/workflows/__init__.py +2 -0
- mixpeek-0.6.1/src/mixpeek/workflows/client.py +418 -0
- mixpeek-0.2/MANIFEST.in +0 -1
- mixpeek-0.2/PKG-INFO +0 -11
- mixpeek-0.2/README.md +0 -196
- mixpeek-0.2/mixpeek/__init__.py +0 -73
- mixpeek-0.2/mixpeek.egg-info/PKG-INFO +0 -11
- mixpeek-0.2/mixpeek.egg-info/SOURCES.txt +0 -12
- mixpeek-0.2/mixpeek.egg-info/dependency_links.txt +0 -1
- mixpeek-0.2/mixpeek.egg-info/requires.txt +0 -1
- mixpeek-0.2/mixpeek.egg-info/top_level.txt +0 -1
- mixpeek-0.2/pyproject.toml +0 -19
- mixpeek-0.2/setup.cfg +0 -8
- mixpeek-0.2/setup.py +0 -15
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Mixpeek.
|
3
4
|
|
4
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -11,10 +12,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
|
12
13
|
copies or substantial portions of the Software.
|
13
14
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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.
|
mixpeek-0.6.1/PKG-INFO
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: mixpeek
|
3
|
+
Version: 0.6.1
|
4
|
+
Summary:
|
5
|
+
Requires-Python: >=3.8,<4.0
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
7
|
+
Classifier: Programming Language :: Python :: 3.8
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
11
|
+
Requires-Dist: httpx (>=0.21.2)
|
12
|
+
Requires-Dist: pydantic (>=1.9.2)
|
13
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
|
16
|
+
# Mixpeek Python Library
|
17
|
+
|
18
|
+
[](https://github.com/fern-api/fern)
|
19
|
+
|
20
|
+
The Mixpeek Python Library provides convenient access to the Mixpeek API from applications written in Python.
|
21
|
+
|
22
|
+
## Installation
|
23
|
+
Add this dependency to your project's build file:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
pip install mixpeek
|
27
|
+
# or
|
28
|
+
poetry add mixpeek
|
29
|
+
```
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
Simply import `Mixpeek` and start making calls to our API.
|
33
|
+
|
34
|
+
```python
|
35
|
+
from mixpeek.client import Mixpeek
|
36
|
+
|
37
|
+
client = Mixpeek(
|
38
|
+
api_key="..."
|
39
|
+
)
|
40
|
+
```
|
41
|
+
|
42
|
+
## Async Client
|
43
|
+
|
44
|
+
The SDK also exports an async client so that you can make non-blocking
|
45
|
+
calls to our API.
|
46
|
+
|
47
|
+
```python
|
48
|
+
from mixpeek.client import AsymcMixpeek
|
49
|
+
|
50
|
+
client = AsyncMixpeek(
|
51
|
+
api_key="..."
|
52
|
+
)
|
53
|
+
```
|
54
|
+
|
55
|
+
## Exception Handling
|
56
|
+
All errors thrown by the SDK will be subclasses of [`ApiError`](./src/mixpeek/core/api_error.py).
|
57
|
+
|
58
|
+
```python
|
59
|
+
import mixpeek
|
60
|
+
|
61
|
+
try:
|
62
|
+
client.search(...)
|
63
|
+
except mixpeek.core.ApiError as e: # Handle all errors
|
64
|
+
print(e.status_code)
|
65
|
+
print(e.body)
|
66
|
+
```
|
67
|
+
|
68
|
+
## Advanced
|
69
|
+
|
70
|
+
### Retries
|
71
|
+
The Mixpeek SDK is instrumented with automatic retries with exponential backoff. A request will be
|
72
|
+
retried as long as the request is deemed retriable and the number of retry attempts has not grown larger
|
73
|
+
than the configured retry limit.
|
74
|
+
|
75
|
+
A request is deemed retriable when any of the following HTTP status codes is returned:
|
76
|
+
|
77
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
78
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
79
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
80
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
81
|
+
|
82
|
+
Use the `max_retries` request option to configure this behavior.
|
83
|
+
|
84
|
+
```python
|
85
|
+
from mixpeek.client import Mixpeek
|
86
|
+
|
87
|
+
client = Mixpeek(...)
|
88
|
+
|
89
|
+
# Override retries for a specific method
|
90
|
+
client.search(..., {
|
91
|
+
max_retries=5
|
92
|
+
})
|
93
|
+
```
|
94
|
+
|
95
|
+
### Timeouts
|
96
|
+
By default, requests time out after 60 seconds. You can configure this with a
|
97
|
+
timeout option at the client or request level.
|
98
|
+
|
99
|
+
```python
|
100
|
+
from mixpeek.client import Mixpeek
|
101
|
+
|
102
|
+
client = Mixpeek(
|
103
|
+
# All timeouts are 20 seconds
|
104
|
+
timeout=20.0,
|
105
|
+
)
|
106
|
+
|
107
|
+
# Override timeout for a specific method
|
108
|
+
client.search(..., {
|
109
|
+
timeout_in_seconds=20.0
|
110
|
+
})
|
111
|
+
```
|
112
|
+
|
113
|
+
### Custom HTTP client
|
114
|
+
You can override the httpx client to customize it for your use-case. Some common use-cases
|
115
|
+
include support for proxies and transports.
|
116
|
+
|
117
|
+
```python
|
118
|
+
import httpx
|
119
|
+
|
120
|
+
from mixpeek.client import Mixpeek
|
121
|
+
|
122
|
+
client = Mixpeek(
|
123
|
+
http_client=httpx.Client(
|
124
|
+
proxies="http://my.test.proxy.example.com",
|
125
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
126
|
+
),
|
127
|
+
)
|
128
|
+
```
|
129
|
+
|
130
|
+
## Beta Status
|
131
|
+
|
132
|
+
This SDK is in beta, and there may be breaking changes between versions without a major
|
133
|
+
version update. Therefore, we recommend pinning the package version to a specific version.
|
134
|
+
This way, you can install the same version each time without breaking changes.
|
135
|
+
|
136
|
+
## Contributing
|
137
|
+
|
138
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
139
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
140
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
141
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
142
|
+
an issue first to discuss with us!
|
143
|
+
|
144
|
+
On the other hand, contributions to the README are always very welcome!
|
145
|
+
|
mixpeek-0.6.1/README.md
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# Mixpeek Python Library
|
2
|
+
|
3
|
+
[](https://github.com/fern-api/fern)
|
4
|
+
|
5
|
+
The Mixpeek Python Library provides convenient access to the Mixpeek API from applications written in Python.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this dependency to your project's build file:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
pip install mixpeek
|
12
|
+
# or
|
13
|
+
poetry add mixpeek
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
Simply import `Mixpeek` and start making calls to our API.
|
18
|
+
|
19
|
+
```python
|
20
|
+
from mixpeek.client import Mixpeek
|
21
|
+
|
22
|
+
client = Mixpeek(
|
23
|
+
api_key="..."
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
27
|
+
## Async Client
|
28
|
+
|
29
|
+
The SDK also exports an async client so that you can make non-blocking
|
30
|
+
calls to our API.
|
31
|
+
|
32
|
+
```python
|
33
|
+
from mixpeek.client import AsymcMixpeek
|
34
|
+
|
35
|
+
client = AsyncMixpeek(
|
36
|
+
api_key="..."
|
37
|
+
)
|
38
|
+
```
|
39
|
+
|
40
|
+
## Exception Handling
|
41
|
+
All errors thrown by the SDK will be subclasses of [`ApiError`](./src/mixpeek/core/api_error.py).
|
42
|
+
|
43
|
+
```python
|
44
|
+
import mixpeek
|
45
|
+
|
46
|
+
try:
|
47
|
+
client.search(...)
|
48
|
+
except mixpeek.core.ApiError as e: # Handle all errors
|
49
|
+
print(e.status_code)
|
50
|
+
print(e.body)
|
51
|
+
```
|
52
|
+
|
53
|
+
## Advanced
|
54
|
+
|
55
|
+
### Retries
|
56
|
+
The Mixpeek SDK is instrumented with automatic retries with exponential backoff. A request will be
|
57
|
+
retried as long as the request is deemed retriable and the number of retry attempts has not grown larger
|
58
|
+
than the configured retry limit.
|
59
|
+
|
60
|
+
A request is deemed retriable when any of the following HTTP status codes is returned:
|
61
|
+
|
62
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
63
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
64
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
65
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
66
|
+
|
67
|
+
Use the `max_retries` request option to configure this behavior.
|
68
|
+
|
69
|
+
```python
|
70
|
+
from mixpeek.client import Mixpeek
|
71
|
+
|
72
|
+
client = Mixpeek(...)
|
73
|
+
|
74
|
+
# Override retries for a specific method
|
75
|
+
client.search(..., {
|
76
|
+
max_retries=5
|
77
|
+
})
|
78
|
+
```
|
79
|
+
|
80
|
+
### Timeouts
|
81
|
+
By default, requests time out after 60 seconds. You can configure this with a
|
82
|
+
timeout option at the client or request level.
|
83
|
+
|
84
|
+
```python
|
85
|
+
from mixpeek.client import Mixpeek
|
86
|
+
|
87
|
+
client = Mixpeek(
|
88
|
+
# All timeouts are 20 seconds
|
89
|
+
timeout=20.0,
|
90
|
+
)
|
91
|
+
|
92
|
+
# Override timeout for a specific method
|
93
|
+
client.search(..., {
|
94
|
+
timeout_in_seconds=20.0
|
95
|
+
})
|
96
|
+
```
|
97
|
+
|
98
|
+
### Custom HTTP client
|
99
|
+
You can override the httpx client to customize it for your use-case. Some common use-cases
|
100
|
+
include support for proxies and transports.
|
101
|
+
|
102
|
+
```python
|
103
|
+
import httpx
|
104
|
+
|
105
|
+
from mixpeek.client import Mixpeek
|
106
|
+
|
107
|
+
client = Mixpeek(
|
108
|
+
http_client=httpx.Client(
|
109
|
+
proxies="http://my.test.proxy.example.com",
|
110
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
111
|
+
),
|
112
|
+
)
|
113
|
+
```
|
114
|
+
|
115
|
+
## Beta Status
|
116
|
+
|
117
|
+
This SDK is in beta, and there may be breaking changes between versions without a major
|
118
|
+
version update. Therefore, we recommend pinning the package version to a specific version.
|
119
|
+
This way, you can install the same version each time without breaking changes.
|
120
|
+
|
121
|
+
## Contributing
|
122
|
+
|
123
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
124
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
125
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
126
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
127
|
+
an issue first to discuss with us!
|
128
|
+
|
129
|
+
On the other hand, contributions to the README are always very welcome!
|
@@ -0,0 +1,33 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "mixpeek"
|
3
|
+
version = "0.6.1"
|
4
|
+
description = ""
|
5
|
+
readme = "README.md"
|
6
|
+
authors = []
|
7
|
+
packages = [
|
8
|
+
{ include = "mixpeek", from = "src"}
|
9
|
+
]
|
10
|
+
|
11
|
+
[tool.poetry.dependencies]
|
12
|
+
python = "^3.8"
|
13
|
+
httpx = ">=0.21.2"
|
14
|
+
pydantic = ">= 1.9.2"
|
15
|
+
typing_extensions = ">= 4.0.0"
|
16
|
+
|
17
|
+
[tool.poetry.dev-dependencies]
|
18
|
+
mypy = "^1.8.0"
|
19
|
+
pytest = "^7.4.0"
|
20
|
+
pytest-asyncio = "^0.23.5"
|
21
|
+
python-dateutil = "^2.9.0"
|
22
|
+
|
23
|
+
[tool.pytest.ini_options]
|
24
|
+
testpaths = [ "tests" ]
|
25
|
+
asyncio_mode = "auto"
|
26
|
+
|
27
|
+
[tool.mypy]
|
28
|
+
plugins = ["pydantic.mypy"]
|
29
|
+
|
30
|
+
|
31
|
+
[build-system]
|
32
|
+
requires = ["poetry-core"]
|
33
|
+
build-backend = "poetry.core.masonry.api"
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from .types import (
|
4
|
+
AudioParams,
|
5
|
+
ConfigsRequest,
|
6
|
+
ConfigsResponse,
|
7
|
+
Connection,
|
8
|
+
ConnectionEngine,
|
9
|
+
CsvParams,
|
10
|
+
DestinationSchema,
|
11
|
+
EmbeddingRequest,
|
12
|
+
EmbeddingResponse,
|
13
|
+
ErrorMessage,
|
14
|
+
ErrorResponse,
|
15
|
+
FieldSchema,
|
16
|
+
FieldType,
|
17
|
+
GenerationResponse,
|
18
|
+
HtmlParams,
|
19
|
+
HttpValidationError,
|
20
|
+
ImageParams,
|
21
|
+
Message,
|
22
|
+
Metadata,
|
23
|
+
Modality,
|
24
|
+
Model,
|
25
|
+
PdfParams,
|
26
|
+
PipelineResponse,
|
27
|
+
PptParams,
|
28
|
+
PptxParams,
|
29
|
+
Settings,
|
30
|
+
SourceSchema,
|
31
|
+
TxtParams,
|
32
|
+
ValidationError,
|
33
|
+
ValidationErrorLocItem,
|
34
|
+
VideoParams,
|
35
|
+
WorkflowResponse,
|
36
|
+
WorkflowSettings,
|
37
|
+
XlsxParams,
|
38
|
+
)
|
39
|
+
from .errors import (
|
40
|
+
BadRequestError,
|
41
|
+
ForbiddenError,
|
42
|
+
InternalServerError,
|
43
|
+
NotFoundError,
|
44
|
+
UnauthorizedError,
|
45
|
+
UnprocessableEntityError,
|
46
|
+
)
|
47
|
+
from . import generators, parse, pipelines, storage, workflows
|
48
|
+
from .version import __version__
|
49
|
+
|
50
|
+
__all__ = [
|
51
|
+
"AudioParams",
|
52
|
+
"BadRequestError",
|
53
|
+
"ConfigsRequest",
|
54
|
+
"ConfigsResponse",
|
55
|
+
"Connection",
|
56
|
+
"ConnectionEngine",
|
57
|
+
"CsvParams",
|
58
|
+
"DestinationSchema",
|
59
|
+
"EmbeddingRequest",
|
60
|
+
"EmbeddingResponse",
|
61
|
+
"ErrorMessage",
|
62
|
+
"ErrorResponse",
|
63
|
+
"FieldSchema",
|
64
|
+
"FieldType",
|
65
|
+
"ForbiddenError",
|
66
|
+
"GenerationResponse",
|
67
|
+
"HtmlParams",
|
68
|
+
"HttpValidationError",
|
69
|
+
"ImageParams",
|
70
|
+
"InternalServerError",
|
71
|
+
"Message",
|
72
|
+
"Metadata",
|
73
|
+
"Modality",
|
74
|
+
"Model",
|
75
|
+
"NotFoundError",
|
76
|
+
"PdfParams",
|
77
|
+
"PipelineResponse",
|
78
|
+
"PptParams",
|
79
|
+
"PptxParams",
|
80
|
+
"Settings",
|
81
|
+
"SourceSchema",
|
82
|
+
"TxtParams",
|
83
|
+
"UnauthorizedError",
|
84
|
+
"UnprocessableEntityError",
|
85
|
+
"ValidationError",
|
86
|
+
"ValidationErrorLocItem",
|
87
|
+
"VideoParams",
|
88
|
+
"WorkflowResponse",
|
89
|
+
"WorkflowSettings",
|
90
|
+
"XlsxParams",
|
91
|
+
"__version__",
|
92
|
+
"generators",
|
93
|
+
"parse",
|
94
|
+
"pipelines",
|
95
|
+
"storage",
|
96
|
+
"workflows",
|
97
|
+
]
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import os
|
4
|
+
import typing
|
5
|
+
|
6
|
+
import httpx
|
7
|
+
|
8
|
+
from .core.api_error import ApiError
|
9
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
10
|
+
from .generators.client import AsyncGeneratorsClient, GeneratorsClient
|
11
|
+
from .parse.client import AsyncParseClient, ParseClient
|
12
|
+
from .pipelines.client import AsyncPipelinesClient, PipelinesClient
|
13
|
+
from .storage.client import AsyncStorageClient, StorageClient
|
14
|
+
from .workflows.client import AsyncWorkflowsClient, WorkflowsClient
|
15
|
+
|
16
|
+
|
17
|
+
class BaseMixpeek:
|
18
|
+
"""
|
19
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
|
20
|
+
|
21
|
+
Parameters:
|
22
|
+
- base_url: str. The base url to use for requests from the client.
|
23
|
+
|
24
|
+
- authorization: typing.Optional[str].
|
25
|
+
|
26
|
+
- index_id: typing.Optional[str].
|
27
|
+
|
28
|
+
- api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]].
|
29
|
+
|
30
|
+
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
|
31
|
+
|
32
|
+
- httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
33
|
+
---
|
34
|
+
from mixpeek.client import Mixpeek
|
35
|
+
|
36
|
+
client = Mixpeek(
|
37
|
+
authorization="YOUR_AUTHORIZATION",
|
38
|
+
index_id="YOUR_INDEX_ID",
|
39
|
+
api_key="YOUR_API_KEY",
|
40
|
+
base_url="https://yourhost.com/path/to/api",
|
41
|
+
)
|
42
|
+
"""
|
43
|
+
|
44
|
+
def __init__(
|
45
|
+
self,
|
46
|
+
*,
|
47
|
+
base_url: str,
|
48
|
+
authorization: typing.Optional[str] = None,
|
49
|
+
index_id: typing.Optional[str] = None,
|
50
|
+
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("MIXPEEK_API_KEY"),
|
51
|
+
timeout: typing.Optional[float] = None,
|
52
|
+
httpx_client: typing.Optional[httpx.Client] = None
|
53
|
+
):
|
54
|
+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
55
|
+
if api_key is None:
|
56
|
+
raise ApiError(
|
57
|
+
body="The client must be instantiated be either passing in api_key or setting MIXPEEK_API_KEY"
|
58
|
+
)
|
59
|
+
self._client_wrapper = SyncClientWrapper(
|
60
|
+
base_url=base_url,
|
61
|
+
authorization=authorization,
|
62
|
+
index_id=index_id,
|
63
|
+
api_key=api_key,
|
64
|
+
httpx_client=httpx.Client(timeout=_defaulted_timeout) if httpx_client is None else httpx_client,
|
65
|
+
timeout=_defaulted_timeout,
|
66
|
+
)
|
67
|
+
self.pipelines = PipelinesClient(client_wrapper=self._client_wrapper)
|
68
|
+
self.parse = ParseClient(client_wrapper=self._client_wrapper)
|
69
|
+
self.workflows = WorkflowsClient(client_wrapper=self._client_wrapper)
|
70
|
+
self.generators = GeneratorsClient(client_wrapper=self._client_wrapper)
|
71
|
+
self.storage = StorageClient(client_wrapper=self._client_wrapper)
|
72
|
+
|
73
|
+
|
74
|
+
class AsyncBaseMixpeek:
|
75
|
+
"""
|
76
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
|
77
|
+
|
78
|
+
Parameters:
|
79
|
+
- base_url: str. The base url to use for requests from the client.
|
80
|
+
|
81
|
+
- authorization: typing.Optional[str].
|
82
|
+
|
83
|
+
- index_id: typing.Optional[str].
|
84
|
+
|
85
|
+
- api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]].
|
86
|
+
|
87
|
+
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
|
88
|
+
|
89
|
+
- httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
90
|
+
---
|
91
|
+
from mixpeek.client import AsyncMixpeek
|
92
|
+
|
93
|
+
client = AsyncMixpeek(
|
94
|
+
authorization="YOUR_AUTHORIZATION",
|
95
|
+
index_id="YOUR_INDEX_ID",
|
96
|
+
api_key="YOUR_API_KEY",
|
97
|
+
base_url="https://yourhost.com/path/to/api",
|
98
|
+
)
|
99
|
+
"""
|
100
|
+
|
101
|
+
def __init__(
|
102
|
+
self,
|
103
|
+
*,
|
104
|
+
base_url: str,
|
105
|
+
authorization: typing.Optional[str] = None,
|
106
|
+
index_id: typing.Optional[str] = None,
|
107
|
+
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("MIXPEEK_API_KEY"),
|
108
|
+
timeout: typing.Optional[float] = None,
|
109
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None
|
110
|
+
):
|
111
|
+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
112
|
+
if api_key is None:
|
113
|
+
raise ApiError(
|
114
|
+
body="The client must be instantiated be either passing in api_key or setting MIXPEEK_API_KEY"
|
115
|
+
)
|
116
|
+
self._client_wrapper = AsyncClientWrapper(
|
117
|
+
base_url=base_url,
|
118
|
+
authorization=authorization,
|
119
|
+
index_id=index_id,
|
120
|
+
api_key=api_key,
|
121
|
+
httpx_client=httpx.AsyncClient(timeout=_defaulted_timeout) if httpx_client is None else httpx_client,
|
122
|
+
timeout=_defaulted_timeout,
|
123
|
+
)
|
124
|
+
self.pipelines = AsyncPipelinesClient(client_wrapper=self._client_wrapper)
|
125
|
+
self.parse = AsyncParseClient(client_wrapper=self._client_wrapper)
|
126
|
+
self.workflows = AsyncWorkflowsClient(client_wrapper=self._client_wrapper)
|
127
|
+
self.generators = AsyncGeneratorsClient(client_wrapper=self._client_wrapper)
|
128
|
+
self.storage = AsyncStorageClient(client_wrapper=self._client_wrapper)
|
@@ -0,0 +1,65 @@
|
|
1
|
+
|
2
|
+
import typing
|
3
|
+
import httpx
|
4
|
+
|
5
|
+
from .base_client import BaseMixpeek, \
|
6
|
+
AsyncBaseMixpeek
|
7
|
+
from .types.message import Message
|
8
|
+
from .types.model import Model
|
9
|
+
from .types.settings import Settings
|
10
|
+
from .types.generation_response import GenerationResponse
|
11
|
+
from .core.request_options import RequestOptions
|
12
|
+
|
13
|
+
|
14
|
+
# this is used as the default value for optional parameters
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
16
|
+
|
17
|
+
|
18
|
+
class Mixpeek(BaseMixpeek):
|
19
|
+
|
20
|
+
def generate(
|
21
|
+
self,
|
22
|
+
*,
|
23
|
+
model: Model,
|
24
|
+
# Pydantic model that represents the JSON schema of the response
|
25
|
+
response_format: typing.Optional[typing.Any],
|
26
|
+
context: typing.Optional[str] = OMIT,
|
27
|
+
messages: typing.Sequence[Message],
|
28
|
+
settings: typing.Optional[Settings] = OMIT,
|
29
|
+
request_options: typing.Optional[RequestOptions] = None,
|
30
|
+
) -> GenerationResponse:
|
31
|
+
if response_format is not None:
|
32
|
+
response_format = response_format.model_json_schema()
|
33
|
+
return self.generators.generate(
|
34
|
+
model=model,
|
35
|
+
response_format=response_format,
|
36
|
+
context=context,
|
37
|
+
messages=messages,
|
38
|
+
settings=settings,
|
39
|
+
request_options=request_options,
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
class AsyncMixpeek(AsyncBaseMixpeek):
|
44
|
+
|
45
|
+
async def generate(
|
46
|
+
self,
|
47
|
+
*,
|
48
|
+
model: Model,
|
49
|
+
# Pydantic model that represents the JSON schema of the response
|
50
|
+
response_format: typing.Optional[typing.Any],
|
51
|
+
context: typing.Optional[str] = OMIT,
|
52
|
+
messages: typing.Sequence[Message],
|
53
|
+
settings: typing.Optional[Settings] = OMIT,
|
54
|
+
request_options: typing.Optional[RequestOptions] = None,
|
55
|
+
) -> GenerationResponse:
|
56
|
+
if response_format is not None:
|
57
|
+
response_format = response_format.model_json_schema()
|
58
|
+
return await self.generators.generate(
|
59
|
+
model=model,
|
60
|
+
response_format=response_format,
|
61
|
+
context=context,
|
62
|
+
messages=messages,
|
63
|
+
settings=settings,
|
64
|
+
request_options=request_options,
|
65
|
+
)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from .api_error import ApiError
|
4
|
+
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
5
|
+
from .datetime_utils import serialize_datetime
|
6
|
+
from .file import File, convert_file_dict_to_httpx_tuples
|
7
|
+
from .http_client import AsyncHttpClient, HttpClient
|
8
|
+
from .jsonable_encoder import jsonable_encoder
|
9
|
+
from .remove_none_from_dict import remove_none_from_dict
|
10
|
+
from .request_options import RequestOptions
|
11
|
+
|
12
|
+
__all__ = [
|
13
|
+
"ApiError",
|
14
|
+
"AsyncClientWrapper",
|
15
|
+
"AsyncHttpClient",
|
16
|
+
"BaseClientWrapper",
|
17
|
+
"File",
|
18
|
+
"HttpClient",
|
19
|
+
"RequestOptions",
|
20
|
+
"SyncClientWrapper",
|
21
|
+
"convert_file_dict_to_httpx_tuples",
|
22
|
+
"jsonable_encoder",
|
23
|
+
"remove_none_from_dict",
|
24
|
+
"serialize_datetime",
|
25
|
+
]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
|
5
|
+
|
6
|
+
class ApiError(Exception):
|
7
|
+
status_code: typing.Optional[int]
|
8
|
+
body: typing.Any
|
9
|
+
|
10
|
+
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
|
11
|
+
self.status_code = status_code
|
12
|
+
self.body = body
|
13
|
+
|
14
|
+
def __str__(self) -> str:
|
15
|
+
return f"status_code: {self.status_code}, body: {self.body}"
|