amigo_sdk 0.52.0__py3-none-any.whl → 0.67.0__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.
- amigo_sdk/__init__.py +1 -1
- amigo_sdk/_retry_utils.py +2 -3
- amigo_sdk/errors.py +5 -5
- amigo_sdk/generated/model.py +9372 -8981
- amigo_sdk/http_client.py +4 -4
- amigo_sdk/resources/conversation.py +2 -2
- amigo_sdk/resources/service.py +2 -4
- amigo_sdk/resources/user.py +6 -8
- amigo_sdk/sdk_client.py +13 -13
- {amigo_sdk-0.52.0.dist-info → amigo_sdk-0.67.0.dist-info}/METADATA +6 -2
- amigo_sdk-0.67.0.dist-info/RECORD +18 -0
- {amigo_sdk-0.52.0.dist-info → amigo_sdk-0.67.0.dist-info}/WHEEL +1 -1
- amigo_sdk-0.52.0.dist-info/RECORD +0 -18
- {amigo_sdk-0.52.0.dist-info → amigo_sdk-0.67.0.dist-info}/entry_points.txt +0 -0
- {amigo_sdk-0.52.0.dist-info → amigo_sdk-0.67.0.dist-info}/licenses/LICENSE +0 -0
amigo_sdk/http_client.py
CHANGED
|
@@ -6,7 +6,7 @@ import time
|
|
|
6
6
|
from collections.abc import AsyncIterator, Iterator
|
|
7
7
|
from dataclasses import dataclass
|
|
8
8
|
from email.utils import parsedate_to_datetime
|
|
9
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
10
10
|
|
|
11
11
|
import httpx
|
|
12
12
|
|
|
@@ -82,7 +82,7 @@ class _RetryConfig:
|
|
|
82
82
|
return random.uniform(0.0, window)
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
def _should_refresh_token(token:
|
|
85
|
+
def _should_refresh_token(token: UserSignInWithApiKeyResponse | None) -> bool:
|
|
86
86
|
if not token:
|
|
87
87
|
return True
|
|
88
88
|
return dt.datetime.now(dt.UTC) > token.expires_at - dt.timedelta(minutes=5)
|
|
@@ -133,7 +133,7 @@ class AmigoAsyncHttpClient:
|
|
|
133
133
|
**httpx_kwargs: Any,
|
|
134
134
|
) -> None:
|
|
135
135
|
self._cfg = cfg
|
|
136
|
-
self._token:
|
|
136
|
+
self._token: UserSignInWithApiKeyResponse | None = None
|
|
137
137
|
self._client = httpx.AsyncClient(
|
|
138
138
|
base_url=cfg.base_url,
|
|
139
139
|
**httpx_kwargs,
|
|
@@ -274,7 +274,7 @@ class AmigoHttpClient:
|
|
|
274
274
|
**httpx_kwargs: Any,
|
|
275
275
|
) -> None:
|
|
276
276
|
self._cfg = cfg
|
|
277
|
-
self._token:
|
|
277
|
+
self._token: UserSignInWithApiKeyResponse | None = None
|
|
278
278
|
self._client = httpx.Client(base_url=cfg.base_url, **httpx_kwargs)
|
|
279
279
|
# Retry configuration
|
|
280
280
|
self._retry_cfg = _RetryConfig(
|
|
@@ -48,7 +48,7 @@ class AsyncConversationResource:
|
|
|
48
48
|
body: ConversationCreateConversationRequest,
|
|
49
49
|
params: CreateConversationParametersQuery,
|
|
50
50
|
abort_event: asyncio.Event | None = None,
|
|
51
|
-
) -> "AsyncGenerator[ConversationCreateConversationResponse
|
|
51
|
+
) -> "AsyncGenerator[ConversationCreateConversationResponse]":
|
|
52
52
|
"""Create a new conversation and stream NDJSON events.
|
|
53
53
|
|
|
54
54
|
Returns an async generator yielding `ConversationCreateConversationResponse` events.
|
|
@@ -77,7 +77,7 @@ class AsyncConversationResource:
|
|
|
77
77
|
text_message: str | None = None,
|
|
78
78
|
audio_bytes: bytes | None = None,
|
|
79
79
|
audio_content_type: Literal["audio/mpeg", "audio/wav"] | None = None,
|
|
80
|
-
) -> "AsyncGenerator[ConversationInteractWithConversationResponse
|
|
80
|
+
) -> "AsyncGenerator[ConversationInteractWithConversationResponse]":
|
|
81
81
|
"""Interact with a conversation and stream NDJSON events.
|
|
82
82
|
|
|
83
83
|
Returns an async generator yielding `ConversationInteractWithConversationResponse` events.
|
amigo_sdk/resources/service.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
from amigo_sdk.generated.model import (
|
|
4
2
|
GetServicesParametersQuery,
|
|
5
3
|
ServiceGetServicesResponse,
|
|
@@ -15,7 +13,7 @@ class AsyncServiceResource:
|
|
|
15
13
|
self._organization_id = organization_id
|
|
16
14
|
|
|
17
15
|
async def get_services(
|
|
18
|
-
self, params:
|
|
16
|
+
self, params: GetServicesParametersQuery | None = None
|
|
19
17
|
) -> ServiceGetServicesResponse:
|
|
20
18
|
"""Get all services."""
|
|
21
19
|
response = await self._http.request(
|
|
@@ -34,7 +32,7 @@ class ServiceResource:
|
|
|
34
32
|
self._organization_id = organization_id
|
|
35
33
|
|
|
36
34
|
def get_services(
|
|
37
|
-
self, params:
|
|
35
|
+
self, params: GetServicesParametersQuery | None = None
|
|
38
36
|
) -> ServiceGetServicesResponse:
|
|
39
37
|
response = self._http.request(
|
|
40
38
|
"GET",
|
amigo_sdk/resources/user.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
from amigo_sdk.generated.model import (
|
|
4
2
|
GetUsersParametersQuery,
|
|
5
3
|
UserCreateInvitedUserRequest,
|
|
@@ -18,7 +16,7 @@ class AsyncUserResource:
|
|
|
18
16
|
self._organization_id = organization_id
|
|
19
17
|
|
|
20
18
|
async def get_users(
|
|
21
|
-
self, params:
|
|
19
|
+
self, params: GetUsersParametersQuery | None = None
|
|
22
20
|
) -> UserGetUsersResponse:
|
|
23
21
|
"""Get a list of users in the organization."""
|
|
24
22
|
response = await self._http.request(
|
|
@@ -36,7 +34,7 @@ class AsyncUserResource:
|
|
|
36
34
|
"""Create (invite) a new user to the organization."""
|
|
37
35
|
response = await self._http.request(
|
|
38
36
|
"POST",
|
|
39
|
-
f"/v1/{self._organization_id}/user/
|
|
37
|
+
f"/v1/{self._organization_id}/user/",
|
|
40
38
|
json=body.model_dump(mode="json", exclude_none=True),
|
|
41
39
|
)
|
|
42
40
|
return UserCreateInvitedUserResponse.model_validate_json(response.text)
|
|
@@ -52,7 +50,7 @@ class AsyncUserResource:
|
|
|
52
50
|
"""Update user information. Returns None on success (e.g., 204)."""
|
|
53
51
|
await self._http.request(
|
|
54
52
|
"POST",
|
|
55
|
-
f"/v1/{self._organization_id}/user/{user_id}
|
|
53
|
+
f"/v1/{self._organization_id}/user/{user_id}",
|
|
56
54
|
json=body.model_dump(mode="json", exclude_none=True),
|
|
57
55
|
)
|
|
58
56
|
|
|
@@ -65,7 +63,7 @@ class UserResource:
|
|
|
65
63
|
self._organization_id = organization_id
|
|
66
64
|
|
|
67
65
|
def get_users(
|
|
68
|
-
self, params:
|
|
66
|
+
self, params: GetUsersParametersQuery | None = None
|
|
69
67
|
) -> UserGetUsersResponse:
|
|
70
68
|
response = self._http.request(
|
|
71
69
|
"GET",
|
|
@@ -81,7 +79,7 @@ class UserResource:
|
|
|
81
79
|
) -> UserCreateInvitedUserResponse:
|
|
82
80
|
response = self._http.request(
|
|
83
81
|
"POST",
|
|
84
|
-
f"/v1/{self._organization_id}/user/
|
|
82
|
+
f"/v1/{self._organization_id}/user/",
|
|
85
83
|
json=body.model_dump(mode="json", exclude_none=True),
|
|
86
84
|
)
|
|
87
85
|
return UserCreateInvitedUserResponse.model_validate_json(response.text)
|
|
@@ -92,6 +90,6 @@ class UserResource:
|
|
|
92
90
|
def update_user(self, user_id: str, body: UserUpdateUserInfoRequest) -> None:
|
|
93
91
|
self._http.request(
|
|
94
92
|
"POST",
|
|
95
|
-
f"/v1/{self._organization_id}/user/{user_id}
|
|
93
|
+
f"/v1/{self._organization_id}/user/{user_id}",
|
|
96
94
|
json=body.model_dump(mode="json", exclude_none=True),
|
|
97
95
|
)
|
amigo_sdk/sdk_client.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any
|
|
2
2
|
|
|
3
3
|
from amigo_sdk.config import AmigoConfig
|
|
4
4
|
from amigo_sdk.http_client import AmigoAsyncHttpClient, AmigoHttpClient
|
|
@@ -20,12 +20,12 @@ class AsyncAmigoClient:
|
|
|
20
20
|
def __init__(
|
|
21
21
|
self,
|
|
22
22
|
*,
|
|
23
|
-
api_key:
|
|
24
|
-
api_key_id:
|
|
25
|
-
user_id:
|
|
26
|
-
organization_id:
|
|
27
|
-
base_url:
|
|
28
|
-
config:
|
|
23
|
+
api_key: str | None = None,
|
|
24
|
+
api_key_id: str | None = None,
|
|
25
|
+
user_id: str | None = None,
|
|
26
|
+
organization_id: str | None = None,
|
|
27
|
+
base_url: str | None = None,
|
|
28
|
+
config: AmigoConfig | None = None,
|
|
29
29
|
**httpx_kwargs: Any,
|
|
30
30
|
):
|
|
31
31
|
"""
|
|
@@ -119,12 +119,12 @@ class AmigoClient:
|
|
|
119
119
|
def __init__(
|
|
120
120
|
self,
|
|
121
121
|
*,
|
|
122
|
-
api_key:
|
|
123
|
-
api_key_id:
|
|
124
|
-
user_id:
|
|
125
|
-
organization_id:
|
|
126
|
-
base_url:
|
|
127
|
-
config:
|
|
122
|
+
api_key: str | None = None,
|
|
123
|
+
api_key_id: str | None = None,
|
|
124
|
+
user_id: str | None = None,
|
|
125
|
+
organization_id: str | None = None,
|
|
126
|
+
base_url: str | None = None,
|
|
127
|
+
config: AmigoConfig | None = None,
|
|
128
128
|
**httpx_kwargs: Any,
|
|
129
129
|
):
|
|
130
130
|
if config:
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amigo_sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.67.0
|
|
4
4
|
Summary: Amigo AI Python SDK
|
|
5
5
|
Author: Amigo AI
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
|
|
8
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Requires-Python: >=3.13
|
|
9
11
|
Requires-Dist: email-validator<3.0,>=2.0
|
|
10
12
|
Requires-Dist: httpx<1.0,>=0.25
|
|
11
13
|
Requires-Dist: pydantic-settings<3.0,>=2.0
|
|
@@ -30,6 +32,8 @@ The official Python SDK for the Amigo API, providing a simple and intuitive inte
|
|
|
30
32
|
|
|
31
33
|
## Installation
|
|
32
34
|
|
|
35
|
+
This SDK requires Python 3.13 or newer.
|
|
36
|
+
|
|
33
37
|
Install the SDK using pip:
|
|
34
38
|
|
|
35
39
|
```bash
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
amigo_sdk/__init__.py,sha256=_Vt20XUAV719JwAfR87fdDdt_AzUTzcNx0cHi5VVTdA,139
|
|
2
|
+
amigo_sdk/_retry_utils.py,sha256=VbA_Uwv268J80d11R9XfnCjZiV-NwE1aXRsSlRjjRio,2108
|
|
3
|
+
amigo_sdk/auth.py,sha256=WaM9PcEcnaC6CzNsgRKueHkdSAxNbRylzpR_3Q6guQ0,1765
|
|
4
|
+
amigo_sdk/config.py,sha256=0eZIo-hcJ8ODftKAr-mwB-FGJxGO5PT5T4dRpyWPqAg,1491
|
|
5
|
+
amigo_sdk/errors.py,sha256=Yn12AxIQ6zE9jnGLWO0MUVbBsmw77Kzh82AijyreOkA,4818
|
|
6
|
+
amigo_sdk/http_client.py,sha256=tfMXHqMTmlz2ja7aJhOVgbwAiJNlKCzPcK4UGNqXHO8,13488
|
|
7
|
+
amigo_sdk/models.py,sha256=V-G6iL43_ZNOPDcatCJCSszGWGz-nzp_RSyGNm-rBAc,45
|
|
8
|
+
amigo_sdk/sdk_client.py,sha256=5nj8hzjHSFRs9JMNabdYIhQAcFE2G1jI_r7SHVGr9No,6106
|
|
9
|
+
amigo_sdk/generated/model.py,sha256=byPdfHdBjkFPxltnyGsxQEo1yl8pF9x53IIF_OKJWzE,456940
|
|
10
|
+
amigo_sdk/resources/conversation.py,sha256=u4kOx5LPbhX92L41UnmPmaF9TkQA5bGev8N00dMoP9I,14805
|
|
11
|
+
amigo_sdk/resources/organization.py,sha256=yX4UlOHNegRzFW4gCJrCxjiLCAGnGegasjviR1yad_Q,1211
|
|
12
|
+
amigo_sdk/resources/service.py,sha256=t1iA3nS9co-wuR-x5jBhAXXTWfMeGsLwfQcLycwVrCA,1536
|
|
13
|
+
amigo_sdk/resources/user.py,sha256=zikijiuGXgmkBVtrldor6XQGQK6jWXonDvNFuQs6XK4,3472
|
|
14
|
+
amigo_sdk-0.67.0.dist-info/METADATA,sha256=qTyi_Kit19ZHi0PkFa6POvNZDZOoiBvsCCnetJZc40s,8499
|
|
15
|
+
amigo_sdk-0.67.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
16
|
+
amigo_sdk-0.67.0.dist-info/entry_points.txt,sha256=ivKZ8S9W6SH796zUDHeM-qHodrwmkmUItophi-jJWK0,82
|
|
17
|
+
amigo_sdk-0.67.0.dist-info/licenses/LICENSE,sha256=tx3FiTVbGxwBUOxQbNh05AAQlC2jd5hGvNpIkSfVbCo,1062
|
|
18
|
+
amigo_sdk-0.67.0.dist-info/RECORD,,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
amigo_sdk/__init__.py,sha256=8IxK7MT56E1YHulC2M9fDgB1DS3u8DnV7azNRFAUTPg,139
|
|
2
|
-
amigo_sdk/_retry_utils.py,sha256=kFjw9Wqye6MB5-B4rjLxsbSNcfYBIztcollIoncd1hY,2142
|
|
3
|
-
amigo_sdk/auth.py,sha256=WaM9PcEcnaC6CzNsgRKueHkdSAxNbRylzpR_3Q6guQ0,1765
|
|
4
|
-
amigo_sdk/config.py,sha256=0eZIo-hcJ8ODftKAr-mwB-FGJxGO5PT5T4dRpyWPqAg,1491
|
|
5
|
-
amigo_sdk/errors.py,sha256=RkRyF5eAASd8fIOS6YvL9rLDvLAYWqHfpHSCR7jqvl4,4840
|
|
6
|
-
amigo_sdk/http_client.py,sha256=v25UoUbXcMeHTnfJMcrl8RSSwCVkKUL1Jv-0HoXP1B4,13507
|
|
7
|
-
amigo_sdk/models.py,sha256=V-G6iL43_ZNOPDcatCJCSszGWGz-nzp_RSyGNm-rBAc,45
|
|
8
|
-
amigo_sdk/sdk_client.py,sha256=Kr9M9o66pOLu0T2VDvqdYMmPZzgKJyTELu7BSPgGrYQ,6152
|
|
9
|
-
amigo_sdk/generated/model.py,sha256=s0401eJ2-BMjhOqzPLa-NZyzj-2FPQYkOfr_NTL5ax0,438453
|
|
10
|
-
amigo_sdk/resources/conversation.py,sha256=5PkJOvLKqnriSS9K9hKw2VRPxRLTuABEbCyPy1fz1r0,14817
|
|
11
|
-
amigo_sdk/resources/organization.py,sha256=yX4UlOHNegRzFW4gCJrCxjiLCAGnGegasjviR1yad_Q,1211
|
|
12
|
-
amigo_sdk/resources/service.py,sha256=SiwEHXCQk4r1b_tGv47M08VuB7RALDHJQzWlpuD937g,1571
|
|
13
|
-
amigo_sdk/resources/user.py,sha256=i4t5aVzBI37KwAtLKSDWTMwf4D4KQdSDoUiblFe1u7o,3529
|
|
14
|
-
amigo_sdk-0.52.0.dist-info/METADATA,sha256=5EFXnlSqIpLyM5yuiO6Ls5hvGcZ7Q2LQXa6Bp6t2bGA,8350
|
|
15
|
-
amigo_sdk-0.52.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
16
|
-
amigo_sdk-0.52.0.dist-info/entry_points.txt,sha256=ivKZ8S9W6SH796zUDHeM-qHodrwmkmUItophi-jJWK0,82
|
|
17
|
-
amigo_sdk-0.52.0.dist-info/licenses/LICENSE,sha256=tx3FiTVbGxwBUOxQbNh05AAQlC2jd5hGvNpIkSfVbCo,1062
|
|
18
|
-
amigo_sdk-0.52.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|