mixpeek 0.6.8__py3-none-any.whl → 0.6.10__py3-none-any.whl

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.
Files changed (85) hide show
  1. mixpeek/__init__.py +1 -106
  2. mixpeek/client.py +21 -65
  3. mixpeek/endpoints/connections.py +16 -0
  4. mixpeek/endpoints/embed.py +50 -0
  5. mixpeek/endpoints/extract.py +16 -0
  6. mixpeek/endpoints/generate.py +17 -0
  7. mixpeek/endpoints/tools.py +23 -0
  8. mixpeek/exceptions.py +13 -0
  9. mixpeek-0.6.10.dist-info/METADATA +68 -0
  10. mixpeek-0.6.10.dist-info/RECORD +13 -0
  11. {mixpeek-0.6.8.dist-info → mixpeek-0.6.10.dist-info}/WHEEL +2 -1
  12. mixpeek-0.6.10.dist-info/top_level.txt +1 -0
  13. mixpeek/base_client.py +0 -1015
  14. mixpeek/core/__init__.py +0 -27
  15. mixpeek/core/api_error.py +0 -15
  16. mixpeek/core/client_wrapper.py +0 -83
  17. mixpeek/core/datetime_utils.py +0 -28
  18. mixpeek/core/file.py +0 -38
  19. mixpeek/core/http_client.py +0 -130
  20. mixpeek/core/jsonable_encoder.py +0 -99
  21. mixpeek/core/pydantic_utilities.py +0 -12
  22. mixpeek/core/remove_none_from_dict.py +0 -11
  23. mixpeek/core/request_options.py +0 -32
  24. mixpeek/environment.py +0 -7
  25. mixpeek/errors/__init__.py +0 -17
  26. mixpeek/errors/bad_request_error.py +0 -9
  27. mixpeek/errors/forbidden_error.py +0 -9
  28. mixpeek/errors/internal_server_error.py +0 -9
  29. mixpeek/errors/not_found_error.py +0 -9
  30. mixpeek/errors/unauthorized_error.py +0 -9
  31. mixpeek/errors/unprocessable_entity_error.py +0 -9
  32. mixpeek/pipeline/__init__.py +0 -2
  33. mixpeek/pipeline/client.py +0 -482
  34. mixpeek/storage/__init__.py +0 -5
  35. mixpeek/storage/client.py +0 -145
  36. mixpeek/storage/sample/__init__.py +0 -2
  37. mixpeek/storage/sample/client.py +0 -286
  38. mixpeek/types/__init__.py +0 -81
  39. mixpeek/types/api_key.py +0 -27
  40. mixpeek/types/audio_params.py +0 -25
  41. mixpeek/types/configs_response.py +0 -38
  42. mixpeek/types/connection.py +0 -32
  43. mixpeek/types/connection_engine.py +0 -5
  44. mixpeek/types/csv_params.py +0 -25
  45. mixpeek/types/destination.py +0 -38
  46. mixpeek/types/embedding_response.py +0 -30
  47. mixpeek/types/error_message.py +0 -25
  48. mixpeek/types/error_response.py +0 -26
  49. mixpeek/types/extract_response.py +0 -31
  50. mixpeek/types/field_type.py +0 -5
  51. mixpeek/types/generation_response.py +0 -32
  52. mixpeek/types/html_params.py +0 -25
  53. mixpeek/types/http_validation_error.py +0 -26
  54. mixpeek/types/image_params.py +0 -28
  55. mixpeek/types/message.py +0 -33
  56. mixpeek/types/metadata.py +0 -28
  57. mixpeek/types/modality.py +0 -5
  58. mixpeek/types/model.py +0 -34
  59. mixpeek/types/models.py +0 -5
  60. mixpeek/types/pdf_params.py +0 -37
  61. mixpeek/types/pipeline_response.py +0 -45
  62. mixpeek/types/pipeline_task_response.py +0 -28
  63. mixpeek/types/ppt_params.py +0 -23
  64. mixpeek/types/pptx_params.py +0 -23
  65. mixpeek/types/settings.py +0 -31
  66. mixpeek/types/source.py +0 -39
  67. mixpeek/types/source_destination_mapping.py +0 -40
  68. mixpeek/types/txt_params.py +0 -23
  69. mixpeek/types/user.py +0 -32
  70. mixpeek/types/validation_error.py +0 -28
  71. mixpeek/types/validation_error_loc_item.py +0 -5
  72. mixpeek/types/video_params.py +0 -23
  73. mixpeek/types/workflow_code_response.py +0 -25
  74. mixpeek/types/workflow_response.py +0 -28
  75. mixpeek/types/workflow_settings.py +0 -26
  76. mixpeek/types/xlsx_params.py +0 -25
  77. mixpeek/user/__init__.py +0 -2
  78. mixpeek/user/client.py +0 -312
  79. mixpeek/version.py +0 -4
  80. mixpeek/workflow/__init__.py +0 -2
  81. mixpeek/workflow/client.py +0 -543
  82. mixpeek-0.6.8.dist-info/LICENSE +0 -21
  83. mixpeek-0.6.8.dist-info/METADATA +0 -145
  84. mixpeek-0.6.8.dist-info/RECORD +0 -76
  85. /mixpeek/{py.typed → endpoints/__init__.py} +0 -0
mixpeek/__init__.py CHANGED
@@ -1,106 +1 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .types import (
4
- ApiKey,
5
- AudioParams,
6
- ConfigsResponse,
7
- Connection,
8
- ConnectionEngine,
9
- CsvParams,
10
- Destination,
11
- EmbeddingResponse,
12
- ErrorMessage,
13
- ErrorResponse,
14
- ExtractResponse,
15
- FieldType,
16
- GenerationResponse,
17
- HtmlParams,
18
- HttpValidationError,
19
- ImageParams,
20
- Message,
21
- Metadata,
22
- Modality,
23
- Model,
24
- Models,
25
- PdfParams,
26
- PipelineResponse,
27
- PipelineTaskResponse,
28
- PptParams,
29
- PptxParams,
30
- Settings,
31
- Source,
32
- SourceDestinationMapping,
33
- TxtParams,
34
- User,
35
- ValidationError,
36
- ValidationErrorLocItem,
37
- VideoParams,
38
- WorkflowCodeResponse,
39
- WorkflowResponse,
40
- WorkflowSettings,
41
- XlsxParams,
42
- )
43
- from .errors import (
44
- BadRequestError,
45
- ForbiddenError,
46
- InternalServerError,
47
- NotFoundError,
48
- UnauthorizedError,
49
- UnprocessableEntityError,
50
- )
51
- from . import pipeline, storage, user, workflow
52
- from .environment import MixpeekEnvironment
53
- from .version import __version__
54
-
55
- __all__ = [
56
- "ApiKey",
57
- "AudioParams",
58
- "BadRequestError",
59
- "ConfigsResponse",
60
- "Connection",
61
- "ConnectionEngine",
62
- "CsvParams",
63
- "Destination",
64
- "EmbeddingResponse",
65
- "ErrorMessage",
66
- "ErrorResponse",
67
- "ExtractResponse",
68
- "FieldType",
69
- "ForbiddenError",
70
- "GenerationResponse",
71
- "HtmlParams",
72
- "HttpValidationError",
73
- "ImageParams",
74
- "InternalServerError",
75
- "Message",
76
- "Metadata",
77
- "MixpeekEnvironment",
78
- "Modality",
79
- "Model",
80
- "Models",
81
- "NotFoundError",
82
- "PdfParams",
83
- "PipelineResponse",
84
- "PipelineTaskResponse",
85
- "PptParams",
86
- "PptxParams",
87
- "Settings",
88
- "Source",
89
- "SourceDestinationMapping",
90
- "TxtParams",
91
- "UnauthorizedError",
92
- "UnprocessableEntityError",
93
- "User",
94
- "ValidationError",
95
- "ValidationErrorLocItem",
96
- "VideoParams",
97
- "WorkflowCodeResponse",
98
- "WorkflowResponse",
99
- "WorkflowSettings",
100
- "XlsxParams",
101
- "__version__",
102
- "pipeline",
103
- "storage",
104
- "user",
105
- "workflow",
106
- ]
1
+ from .client import Mixpeek
mixpeek/client.py CHANGED
@@ -1,65 +1,21 @@
1
- import typing
2
- import httpx
3
-
4
- from .base_client import BaseMixpeek, AsyncBaseMixpeek
5
- from .types.message import Message
6
- from .types.model import Model
7
- from .types.settings import Settings
8
- from .types.generation_response import GenerationResponse
9
- from .core.request_options import RequestOptions
10
-
11
-
12
- # this is used as the default value for optional parameters
13
- OMIT = typing.cast(typing.Any, ...)
14
-
15
-
16
- class Mixpeek(BaseMixpeek):
17
-
18
- def generate(
19
- self,
20
- *,
21
- model: Model,
22
- # Pydantic model that represents the JSON schema of the response
23
- response_format: typing.Optional[typing.Any],
24
- context: typing.Optional[str] = OMIT,
25
- messages: typing.Sequence[Message],
26
- settings: typing.Optional[Settings] = OMIT,
27
- request_options: typing.Optional[RequestOptions] = None,
28
- ) -> GenerationResponse:
29
- if response_format is not None:
30
- response_format = response_format.model_json_schema()
31
-
32
- return self.base_generate(
33
- model=model,
34
- response_format=response_format,
35
- context=context,
36
- messages=messages,
37
- settings=settings,
38
- request_options=request_options,
39
- )
40
-
41
-
42
- class AsyncMixpeek(AsyncBaseMixpeek):
43
-
44
- async def generate(
45
- self,
46
- *,
47
- model: Model,
48
- # Pydantic model that represents the JSON schema of the response
49
- response_format: typing.Optional[typing.Any],
50
- context: typing.Optional[str] = OMIT,
51
- messages: typing.Sequence[Message],
52
- settings: typing.Optional[Settings] = OMIT,
53
- request_options: typing.Optional[RequestOptions] = None,
54
- ) -> GenerationResponse:
55
- if response_format is not None:
56
- response_format = response_format.model_json_schema()
57
-
58
- return await self.base_generate(
59
- model=model,
60
- response_format=response_format,
61
- context=context,
62
- messages=messages,
63
- settings=settings,
64
- request_options=request_options,
65
- )
1
+ import requests
2
+
3
+ from .endpoints.extract import Extract
4
+ from .endpoints.embed import Embed
5
+ from .endpoints.generate import Generate
6
+ from .endpoints.connections import Connections
7
+ from .endpoints.tools import Tools
8
+
9
+ class Mixpeek:
10
+ def __init__(self, api_key: str):
11
+ self.api_key = api_key
12
+ self.base_url = "https://api.mixpeek.com/"
13
+ self.headers = {
14
+ "Authorization": f"Bearer {self.api_key}",
15
+ "Content-Type": "application/json"
16
+ }
17
+ self.extract = Extract(self.base_url, self.headers)
18
+ self.embed = Embed(self.base_url, self.headers)
19
+ self.generate = Generate(self.base_url, self.headers)
20
+ self.connections = Connections(self.base_url, self.headers)
21
+ self.tools = Tools(self.base_url, self.headers)
@@ -0,0 +1,16 @@
1
+ import requests
2
+
3
+ class Connections:
4
+ def __init__(self, base_url, headers):
5
+ self.base_url = base_url
6
+ self.headers = headers
7
+
8
+ def create_connection(self, alias: str, engine: str, details: dict):
9
+ url = f"{self.base_url}connections/"
10
+ data = {
11
+ "alias": alias,
12
+ "engine": engine,
13
+ "details": details
14
+ }
15
+ response = requests.post(url, json=data, headers=self.headers)
16
+ return response.json()
@@ -0,0 +1,50 @@
1
+ import requests
2
+
3
+ class Embed:
4
+ def __init__(self, base_url, headers):
5
+ self.base_url = base_url
6
+ self.headers = headers
7
+
8
+ def video(self, model: str, input: str, input_type: str):
9
+ url = f"{self.base_url}embed/"
10
+ data = {
11
+ "modality": "video",
12
+ "model": model,
13
+ "input": input,
14
+ "input_type": input_type
15
+ }
16
+ response = requests.post(url, json=data, headers=self.headers)
17
+ return response.json()
18
+
19
+ def text(self, model: str, input: str, input_type: str):
20
+ url = f"{self.base_url}embed/"
21
+ data = {
22
+ "modality": "text",
23
+ "model": model,
24
+ "input": input,
25
+ "input_type": input_type
26
+ }
27
+ response = requests.post(url, json=data, headers=self.headers)
28
+ return response.json()
29
+
30
+ def image(self, model: str, input: str, input_type: str):
31
+ url = f"{self.base_url}embed/"
32
+ data = {
33
+ "modality": "image",
34
+ "model": model,
35
+ "input": input,
36
+ "input_type": input_type
37
+ }
38
+ response = requests.post(url, json=data, headers=self.headers)
39
+ return response.json()
40
+
41
+ def audio(self, model: str, input: str, input_type: str):
42
+ url = f"{self.base_url}embed/"
43
+ data = {
44
+ "modality": "audio",
45
+ "model": model,
46
+ "input": input,
47
+ "input_type": input_type
48
+ }
49
+ response = requests.post(url, json=data, headers=self.headers)
50
+ return response.json()
@@ -0,0 +1,16 @@
1
+ import requests
2
+
3
+ class Extract:
4
+ def __init__(self, base_url, headers):
5
+ self.base_url = base_url
6
+ self.headers = headers
7
+
8
+ def extract(self, modality: str, input: str, input_type: str):
9
+ url = f"{self.base_url}extract/"
10
+ data = {
11
+ "modality": modality,
12
+ "input": input,
13
+ "input_type": input_type
14
+ }
15
+ response = requests.post(url, json=data, headers=self.headers)
16
+ return response.json()
@@ -0,0 +1,17 @@
1
+ import requests
2
+ from pydantic import BaseModel
3
+
4
+ class Generate:
5
+ def __init__(self, base_url, headers):
6
+ self.base_url = base_url
7
+ self.headers = headers
8
+
9
+ def generate(self, response_format: BaseModel, context: str):
10
+ url = f"{self.base_url}generate/text"
11
+ data = {
12
+ "response_format": response_format.model_json_schema(),
13
+ "context": context
14
+ }
15
+ response = requests.post(url, json=data, headers=self.headers)
16
+ return response.json()
17
+
@@ -0,0 +1,23 @@
1
+ import requests
2
+
3
+ class Tools:
4
+ def __init__(self, base_url, headers):
5
+ self.base_url = base_url
6
+ self.headers = headers
7
+ self.video = self.Video(self)
8
+
9
+ class Video:
10
+ def __init__(self, parent):
11
+ self.base_url = parent.base_url
12
+ self.headers = parent.headers
13
+
14
+ def process(self, url: str, frame_interval: int, resolution: list, return_base64: bool):
15
+ endpoint = f"{self.base_url}tools/video/process"
16
+ data = {
17
+ "url": url,
18
+ "frame_interval": frame_interval,
19
+ "resolution": resolution,
20
+ "use_base64": return_base64
21
+ }
22
+ response = requests.post(endpoint, json=data, headers=self.headers)
23
+ return response.json()
mixpeek/exceptions.py ADDED
@@ -0,0 +1,13 @@
1
+ class MixpeekException(Exception):
2
+ pass
3
+
4
+ class AuthenticationError(MixpeekException):
5
+ pass
6
+
7
+ class BadRequestError(MixpeekException):
8
+ pass
9
+
10
+ class NotFoundError(MixpeekException):
11
+ pass
12
+
13
+ # Define more exceptions as needed
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.1
2
+ Name: mixpeek
3
+ Version: 0.6.10
4
+ Summary: Mixpeek Python SDK
5
+ Home-page: https://github.com/mixpeek/mixpeek-python
6
+ Author: Ethan Steininger
7
+ Author-email: ethan@mixpeek.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Mixpeek SDK
15
+
16
+ A Python SDK for the Mixpeek API.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install mixpeek
22
+ ```
23
+
24
+ ```python
25
+ from mixpeek import Mixpeek
26
+ from pydantic import BaseModel
27
+
28
+ mixpeek = Mixpeek("YOUR_API_KEY")
29
+
30
+ # Example usage
31
+ extraction = mixpeek.extract.text(
32
+ input="s3://document.pdf",
33
+ input_type="url"
34
+ )
35
+
36
+ embedding = mixpeek.embed.video(
37
+ model="mixpeek/vuse-generic-v1",
38
+ input="s3://waving_boy.mp4",
39
+ input_type="url"
40
+ )
41
+
42
+ class ResponseFormat(BaseModel):
43
+ city: int
44
+ weather: float
45
+
46
+ generated_content = mixpeek.generate.text(
47
+ response_format=ResponseFormat,
48
+ context="Please tell me the weather and make sure to respond in the provided JSON schema"
49
+ )
50
+
51
+ mixpeek.create_connection(
52
+ alias="my-mongo-test",
53
+ engine="mongodb",
54
+ details={
55
+ "host": "your_host_address",
56
+ "database": "your_database_name",
57
+ "username": "your_username",
58
+ "password": "your_password"
59
+ }
60
+ )
61
+
62
+ response = mixpeek.tools.video.process(
63
+ url="https://s3/video.mp4",
64
+ frame_interval=5,
65
+ resolution=[720, 1280],
66
+ return_base64=True
67
+ )
68
+ ```
@@ -0,0 +1,13 @@
1
+ mixpeek/__init__.py,sha256=XDdcK7wTEOEcF1cp-GeWmgPJ21Ny1R9pB0PPNrdDTMo,28
2
+ mixpeek/client.py,sha256=h-YSg18sjAoKgZFMMlRJGkuanpa7zQ5K0JPMhJP0aDg,789
3
+ mixpeek/exceptions.py,sha256=Orhdo5UFLn3fcWVJtlgkznW8Iy5ndL96h0qTY8zOlDA,235
4
+ mixpeek/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ mixpeek/endpoints/connections.py,sha256=N7Zr97lI68HOanvB8OkVRjQhecNXfNPdnvonCnPvxj4,480
6
+ mixpeek/endpoints/embed.py,sha256=D_xOYllx4cdPZZVXejRYhfvPOyJylum5aJ5gki-lbVQ,1562
7
+ mixpeek/endpoints/extract.py,sha256=1KWxvgbQanRwYcFPWGthyv32LVj2gAhxDERwY3QgHUg,476
8
+ mixpeek/endpoints/generate.py,sha256=TAJ79KCchwHYQBWZSnOZBFeXprXBZqAb2mNrQrT8VWM,513
9
+ mixpeek/endpoints/tools.py,sha256=Yw6mvBqbrREY79l_BM6ek_CjxDPbFUdkmZqiaZcYSe8,787
10
+ mixpeek-0.6.10.dist-info/METADATA,sha256=nSnMlCnbPHriwr-seumxGIrE0HijDHIs6c5Q5Ht1FB4,1483
11
+ mixpeek-0.6.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
12
+ mixpeek-0.6.10.dist-info/top_level.txt,sha256=EJ8Jc4IhqyUwnUlBwKbs498Ju4O9a-IDh2kXc_lo6Vg,8
13
+ mixpeek-0.6.10.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ mixpeek