devupai 1.0.0a1__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.
- devupai/__init__.py +85 -0
- devupai/_client.py +1154 -0
- devupai/_errors.py +314 -0
- devupai/_response.py +225 -0
- devupai/_streaming.py +515 -0
- devupai/_version.py +3 -0
- devupai/py.typed +0 -0
- devupai/resources/__init__.py +137 -0
- devupai/resources/_base.py +207 -0
- devupai/resources/audio.py +663 -0
- devupai/resources/balance.py +103 -0
- devupai/resources/chat.py +428 -0
- devupai/resources/embeddings.py +141 -0
- devupai/resources/health.py +113 -0
- devupai/resources/images.py +503 -0
- devupai/resources/inference.py +347 -0
- devupai/resources/me.py +208 -0
- devupai/resources/models.py +405 -0
- devupai/resources/rerank.py +147 -0
- devupai/resources/responses.py +400 -0
- devupai/resources/shared.py +314 -0
- devupai/resources/video.py +600 -0
- devupai/types/__init__.py +264 -0
- devupai/types/_base.py +167 -0
- devupai/types/account.py +48 -0
- devupai/types/audio.py +89 -0
- devupai/types/chat.py +284 -0
- devupai/types/embeddings.py +51 -0
- devupai/types/images.py +238 -0
- devupai/types/models.py +107 -0
- devupai/types/rerank.py +41 -0
- devupai/types/responses.py +219 -0
- devupai/types/shared.py +79 -0
- devupai/types/video.py +218 -0
- devupai/types/webhooks.py +61 -0
- devupai/webhooks.py +278 -0
- devupai-1.0.0a1.dist-info/METADATA +221 -0
- devupai-1.0.0a1.dist-info/RECORD +40 -0
- devupai-1.0.0a1.dist-info/WHEEL +4 -0
- devupai-1.0.0a1.dist-info/licenses/LICENSE +21 -0
devupai/__init__.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""The official Python client for the DEVUP AI API.
|
|
2
|
+
|
|
3
|
+
Create a client and call the API::
|
|
4
|
+
|
|
5
|
+
from devupai import DevupAI
|
|
6
|
+
|
|
7
|
+
client = DevupAI() # reads the key from DEVUP_API_KEY, then DEVUPAI_API_KEY
|
|
8
|
+
|
|
9
|
+
``AsyncDevupAI`` offers the same options for ``asyncio`` code. ``create(stream=True)`` returns a ``Stream`` (an
|
|
10
|
+
``AsyncStream`` on the async client), and a binary result is a ``BinaryResponse`` (``AsyncBinaryResponse``).
|
|
11
|
+
|
|
12
|
+
An answer or a connection problem raises a subclass of ``DevupAPIError`` (``APIConnectionError`` when no response
|
|
13
|
+
was received); a webhook that cannot be verified raises ``DevupWebhookVerificationError``. An option or header value
|
|
14
|
+
that is not valid raises ``TypeError`` or ``ValueError`` before anything is sent, and a closed client raises
|
|
15
|
+
``RuntimeError``.
|
|
16
|
+
|
|
17
|
+
Request parameter and response types live in ``devupai.types``. Webhook signatures are checked with
|
|
18
|
+
``client.webhooks``, or with ``verify_webhook_signature`` and ``construct_webhook_event`` without a client.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from devupai import types
|
|
22
|
+
from devupai._client import AsyncDevupAI, DebugEvent, DevupAI, RequestOptions
|
|
23
|
+
from devupai._errors import (
|
|
24
|
+
APIConnectionError,
|
|
25
|
+
APITimeoutError,
|
|
26
|
+
AuthenticationError,
|
|
27
|
+
BadRequestError,
|
|
28
|
+
ConflictError,
|
|
29
|
+
DevupAPIError,
|
|
30
|
+
DevupWebhookVerificationError,
|
|
31
|
+
InternalServerError,
|
|
32
|
+
NotFoundError,
|
|
33
|
+
PayloadTooLargeError,
|
|
34
|
+
PaymentRequiredError,
|
|
35
|
+
PermissionDeniedError,
|
|
36
|
+
RateLimitError,
|
|
37
|
+
UnprocessableEntityError,
|
|
38
|
+
UnsupportedMediaTypeError,
|
|
39
|
+
)
|
|
40
|
+
from devupai._response import APIResponse, AsyncBinaryResponse, BinaryResponse
|
|
41
|
+
from devupai._streaming import AsyncStream, Stream
|
|
42
|
+
from devupai._version import __version__
|
|
43
|
+
from devupai.webhooks import Webhooks, construct_webhook_event, verify_webhook_signature
|
|
44
|
+
|
|
45
|
+
VERSION: str = __version__
|
|
46
|
+
"""The version of this package, the same value as ``__version__``."""
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
# Clients and responses.
|
|
50
|
+
"DevupAI",
|
|
51
|
+
"AsyncDevupAI",
|
|
52
|
+
"APIResponse",
|
|
53
|
+
"DebugEvent",
|
|
54
|
+
"RequestOptions",
|
|
55
|
+
# Streams and binary results.
|
|
56
|
+
"Stream",
|
|
57
|
+
"AsyncStream",
|
|
58
|
+
"BinaryResponse",
|
|
59
|
+
"AsyncBinaryResponse",
|
|
60
|
+
# Version.
|
|
61
|
+
"VERSION",
|
|
62
|
+
"__version__",
|
|
63
|
+
# Errors.
|
|
64
|
+
"DevupAPIError",
|
|
65
|
+
"BadRequestError",
|
|
66
|
+
"AuthenticationError",
|
|
67
|
+
"PaymentRequiredError",
|
|
68
|
+
"PermissionDeniedError",
|
|
69
|
+
"NotFoundError",
|
|
70
|
+
"ConflictError",
|
|
71
|
+
"PayloadTooLargeError",
|
|
72
|
+
"UnsupportedMediaTypeError",
|
|
73
|
+
"UnprocessableEntityError",
|
|
74
|
+
"RateLimitError",
|
|
75
|
+
"InternalServerError",
|
|
76
|
+
"APIConnectionError",
|
|
77
|
+
"APITimeoutError",
|
|
78
|
+
"DevupWebhookVerificationError",
|
|
79
|
+
# Webhooks.
|
|
80
|
+
"Webhooks",
|
|
81
|
+
"verify_webhook_signature",
|
|
82
|
+
"construct_webhook_event",
|
|
83
|
+
# Request parameter and response types.
|
|
84
|
+
"types",
|
|
85
|
+
]
|